Sets all the bitmaps to unused
| 440 | void bm_FreeBitmapMain(int handle); |
| 441 | // Sets all the bitmaps to unused |
| 442 | void 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 | } |
| 472 | void bm_ShutdownBitmaps(void) { |
| 473 | int i; |
| 474 | mprintf(0, "Freeing all bitmap memory.\n"); |
no test coverage detected