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

Function bm_FreeBitmapData

bitmap/bitmain.cpp:606–621  ·  view source on GitHub ↗

simply frees up a bitmap

Source from the content-addressed store, hash-verified

604}
605// simply frees up a bitmap
606void bm_FreeBitmapData(int handle) {
607 if (GameBitmaps[handle].data16 != NULL && !(GameBitmaps[handle].flags & BF_NOT_RESIDENT)) {
608 if (!(GameBitmaps[handle].flags & BF_NOT_RESIDENT)) {
609 int mem_used = (GameBitmaps[handle].width * GameBitmaps[handle].height * 2);
610 Bitmap_memory_used -= mem_used;
611 if (GameBitmaps[handle].flags & BF_MIPMAPPED)
612 Bitmap_memory_used -= (mem_used / 3);
613 }
614 mem_free(GameBitmaps[handle].data16);
615 }
616 GameBitmaps[handle].cache_slot = -1;
617 GameBitmaps[handle].flags |= BF_NOT_RESIDENT;
618 if (GameBitmaps[handle].flags & BF_MIPMAPPED)
619 GameBitmaps[handle].flags |= BF_WANTS_MIP;
620 GameBitmaps[handle].data16 = NULL;
621}
622// simply frees up a bitmap
623void bm_FreeBitmapMain(int handle) {
624 bm_deleteNode(&GameBitmaps[handle]);

Callers 2

bm_FreeBitmapMainFunction · 0.85
FlushDataCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected