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

Function InitLightmapInfo

Descent3/lightmap_info.cpp:52–86  ·  view source on GitHub ↗

Sets all the lightmaps to unused

Source from the content-addressed store, hash-verified

50
51// Sets all the lightmaps to unused
52void InitLightmapInfo(int nummaps) {
53 int i;
54
55 if (Dedicated_server)
56 return;
57
58 if (nummaps == 0) {
59 LightmapInfo = (lightmap_info *)mem_malloc(MAX_LIGHTMAP_INFOS * sizeof(lightmap_info));
60 ASSERT(LightmapInfo);
61 Free_lmi_list = (uint16_t *)mem_malloc(MAX_LIGHTMAP_INFOS * sizeof(uint16_t));
62 ASSERT(Free_lmi_list);
63
64 for (i = 0; i < MAX_LIGHTMAP_INFOS; i++) {
65 LightmapInfo[i].used = 0;
66 Free_lmi_list[i] = i;
67 }
68 }
69 /* //DAJ this did not work! the lm_FreeLightmap() is refcount-- not a free()
70 else {
71 LightmapInfo=(lightmap_info *)mem_malloc (nummaps*sizeof(lightmap_info));
72 ASSERT (LightmapInfo);
73 Free_lmi_list=(uint16_t *)mem_malloc (nummaps*sizeof(uint16_t));
74 ASSERT (Free_lmi_list);
75
76
77 for (i=0;i<nummaps;i++)
78 {
79 LightmapInfo[i].used=0;
80 Free_lmi_list[i]=i;
81 }
82 }
83 */
84 Num_of_lightmap_info = 0;
85 atexit(CloseLightmapInfos);
86}
87// Allocs a lightmap of w x h size
88// Returns lightmap handle if successful, -1 if otherwise
89

Callers 2

OnTestTest1Method · 0.85
InitD3Systems1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected