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

Function bm_MakeBitmapResident

bitmap/bitmain.cpp:1067–1079  ·  view source on GitHub ↗

Makes sure a bitmap is in memory...if not it attempts to page it in

Source from the content-addressed store, hash-verified

1065}
1066// Makes sure a bitmap is in memory...if not it attempts to page it in
1067int bm_MakeBitmapResident(int handle) {
1068 if (GameBitmaps[handle].flags & BF_NOT_RESIDENT) {
1069 if (bm_page_in_file(handle) > 0) // DAJ -1FIX
1070 {
1071 GameBitmaps[handle].flags &= ~BF_NOT_RESIDENT;
1072 GameBitmaps[handle].flags |= BF_CHANGED | BF_BRAND_NEW;
1073 } else {
1074 mprintf(0, "Error paging in bitmap %s!\n", GameBitmaps[handle].name);
1075 return 0;
1076 }
1077 }
1078 return 1;
1079}
1080// Saves a bitmap to a file. Saves the bitmap as an OUTRAGE_COMPRESSED_OGF.
1081// Returns -1 if something is wrong.
1082int bm_SaveFileBitmap(const std::filesystem::path &filename, int handle) {

Callers 7

bm_SaveFileBitmapFunction · 0.85
bm_wFunction · 0.85
bm_hFunction · 0.85
bm_miplevelsFunction · 0.85
bm_mippedFunction · 0.85
bm_dataFunction · 0.85
bm_formatFunction · 0.85

Calls 1

bm_page_in_fileFunction · 0.85

Tested by

no test coverage detected