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

Function lm_FreeLightmap

bitmap/lightmap.cpp:100–114  ·  view source on GitHub ↗

Given a handle, frees the lightmap memory and flags this lightmap as unused

Source from the content-addressed store, hash-verified

98}
99// Given a handle, frees the lightmap memory and flags this lightmap as unused
100void lm_FreeLightmap(int handle) {
101 if (GameLightmaps[handle].used < 1)
102 return;
103 GameLightmaps[handle].used--;
104 if (GameLightmaps[handle].used == 0) {
105 if (GameLightmaps[handle].data != NULL)
106 mem_free(GameLightmaps[handle].data);
107 Lightmap_mem_used -= (GameLightmaps[handle].width * GameLightmaps[handle].height * 2);
108
109 GameLightmaps[handle].data = NULL;
110 GameLightmaps[handle].cache_slot = -1;
111
112 Free_lightmap_list[--Num_of_lightmaps] = handle;
113 }
114}
115// returns a lightmaps width else -1 if something is wrong
116int lm_w(int handle) {
117 int w;

Callers 4

CopySqueezeDataForRoomsFunction · 0.85
CopySqueezeDataForObjectFunction · 0.85
lm_ShutdownLightmapsFunction · 0.85
FreeLightmapInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected