This function frees up the allocated memory within a hotspotmap struct. It does not free up the struct though.
| 828 | |
| 829 | // This function frees up the allocated memory within a hotspotmap struct. It does not free up the struct though. |
| 830 | void 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 |
| 857 | bool menutga_ConvertTGAtoHSM(const char *fpath) { |
no outgoing calls
no test coverage detected