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

Function bm_InitBitmaps

bitmap/bitmain.cpp:442–471  ·  view source on GitHub ↗

Sets all the bitmaps to unused

Source from the content-addressed store, hash-verified

440void bm_FreeBitmapMain(int handle);
441// Sets all the bitmaps to unused
442void bm_InitBitmaps() {
443 int i, ret;
444 bm_InitHashTable();
445 Bitmaps_initted = 1;
446 for (i = 0; i < MAX_BITMAPS; i++) {
447 GameBitmaps[i].used = 0;
448 GameBitmaps[i].data16 = NULL;
449 GameBitmaps[i].format = BITMAP_FORMAT_STANDARD;
450 GameBitmaps[i].cache_slot = -1;
451 GameBitmaps[i].flags = 0;
452 }
453 int bm = bm_AllocBitmap(128, 128, 0);
454 ASSERT(bm == BAD_BITMAP_HANDLE);
455 if (cfexist(".\\error1.ogf"))
456 ret = bm_AllocLoadFileBitmap(".\\error1.ogf", 0);
457 else
458 ret = -1;
459 if (ret == -1)
460 bm_MakeBad(bm);
461 else {
462 bm_ScaleBitmapToBitmap(bm, ret);
463 bm_FreeBitmap(ret);
464 }
465
466 // bm_GenerateMipMaps (bm);
467 atexit(bm_ShutdownBitmaps);
468 // Initialize lightmaps and bumpmaps
469 lm_InitLightmaps();
470 bump_InitBumpmaps();
471}
472void bm_ShutdownBitmaps(void) {
473 int i;
474 mprintf(0, "Freeing all bitmap memory.\n");

Callers 2

InitSystemsFunction · 0.85
InitGraphicsFunction · 0.85

Calls 9

bm_InitHashTableFunction · 0.85
bm_AllocBitmapFunction · 0.85
cfexistFunction · 0.85
bm_AllocLoadFileBitmapFunction · 0.85
bm_MakeBadFunction · 0.85
bm_ScaleBitmapToBitmapFunction · 0.85
bm_FreeBitmapFunction · 0.85
lm_InitLightmapsFunction · 0.85
bump_InitBumpmapsFunction · 0.85

Tested by

no test coverage detected