MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / OnTestTest1

Method OnTestTest1

editor/MainFrm.cpp:2514–2562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2512
2513extern uint16_t *Free_lmi_list;
2514
2515void CMainFrame::OnTestTest1() {
2516 if (MessageBox("Do you really really want to murder the lightmaps?", "Confirm", MB_YESNO) != IDYES)
2517 return;
2518
2519 // severly bash lightmaps
2520 int r, f;
2521 room *rp;
2522 face *fp;
2523
2524 for (r = 0; r <= Highest_room_index; r++) {
2525 if (!Rooms[r].used)
2526 continue;
2527 rp = &Rooms[r];
2528 for (f = 0; f < rp->num_faces; f++) {
2529 fp = &rp->faces[f];
2530 fp->flags &= ~FF_LIGHTMAP;
2531 fp->lmi_handle = BAD_LMI_INDEX;
2532 }
2533 }
2534
2535 // now free lightmap infos
2536 void CloseLightmapInfos();
2537 CloseLightmapInfos();
2538 InitLightmapInfo(0);
2539 Num_of_lightmap_info = 0;
2540 Num_lightmap_infos_read = 0;
2541
2542 int i, m, t;
2543 for (i = 0; i < MAX_OBJECTS; i++) {
2544 if (!Objects[i].lm_object.used)
2545 continue;
2546
2547 poly_model *pm = &Poly_models[Objects[i].rtype.pobj_info.model_num];
2548 for (m = 0; m < pm->n_models; m++) {
2549 if (IsNonRenderableSubmodel(pm, m))
2550 continue;
2551
2552 for (t = 0; t < Objects[i].lm_object.num_faces[m]; t++) {
2553 lightmap_object_face *fp = &Objects[i].lm_object.lightmap_faces[m][t];
2554 fp->lmi_handle = BAD_LMI_INDEX;
2555 mem_free(fp->u2);
2556 mem_free(fp->v2);
2557 }
2558 mem_free(Objects[i].lm_object.lightmap_faces[m]);
2559 }
2560
2561 Objects[i].lm_object.used = 0;
2562 }
2563}
2564
2565extern void dump_text_to_clipboard(char *text);

Callers

nothing calls this directly

Calls 3

CloseLightmapInfosFunction · 0.85
InitLightmapInfoFunction · 0.85
IsNonRenderableSubmodelFunction · 0.85

Tested by

no test coverage detected