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

Function FreeHotSpotMapInternals

Descent3/hotspotmap.cpp:830–854  ·  view source on GitHub ↗

This function frees up the allocated memory within a hotspotmap struct. It does not free up the struct though.

Source from the content-addressed store, hash-verified

828
829// This function frees up the allocated memory within a hotspotmap struct. It does not free up the struct though.
830void FreeHotSpotMapInternals(hotspotmap_t *hsmap) {
831 mprintf(0, "Freeing HSM internals\n");
832
833 ASSERT(hsmap);
834
835 if (!hsmap->hs)
836 return;
837
838 int curr_hs;
839 int num_hs;
840
841 num_hs = hsmap->num_of_hotspots;
842 for (curr_hs = 0; curr_hs < num_hs; curr_hs++) {
843 if (hsmap->hs[curr_hs].scanlines) {
844 if (hsmap->hs[curr_hs].x) {
845 mem_free(hsmap->hs[curr_hs].x);
846 hsmap->hs[curr_hs].x = NULL;
847 }
848 }
849 }
850 if (hsmap->hs) {
851 mem_free(hsmap->hs);
852 hsmap->hs = NULL;
853 }
854}
855
856// This function (given a filename) loads a TGA file, extracts a hotspot map, and saves the hotspot map
857bool menutga_ConvertTGAtoHSM(const char *fpath) {

Callers 6

CBriefEditMethod · 0.85
CreateHotSpotMapFunction · 0.85
menutga_LoadHotSpotMapFunction · 0.85
menutga_ConvertTGAtoHSMFunction · 0.85
TelComDeactivateFunction · 0.85
LoadTelcomBitmapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected