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

Function ResaveBitmap

editor/LightingDialog.cpp:1570–1598  ·  view source on GitHub ↗

Takes a bitmap name and resaves it

Source from the content-addressed store, hash-verified

1568
1569// Takes a bitmap name and resaves it
1570void ResaveBitmap(char *name) {
1571 int bm_handle = bm_FindBitmapName(name);
1572 if (bm_handle >= 0) {
1573 char search[256];
1574
1575 // Make sure its paged in
1576 bm_data(bm_handle, 0);
1577
1578 ddio_MakePath(search, LocalD3Dir, "data", "graphics", GameBitmaps[bm_handle].name, NULL);
1579 mprintf(0, "Resaving bitmap %s.\n", search);
1580
1581 bm_SaveFileBitmap(search, bm_handle);
1582 } else {
1583 char search[256];
1584
1585 ddio_MakePath(search, LocalD3Dir, "data", "graphics", name, NULL);
1586
1587 bm_handle = bm_AllocLoadFileBitmap(search, 0);
1588 if (bm_handle >= 0) {
1589 // Make sure its paged in
1590 bm_data(bm_handle, 0);
1591
1592 mprintf(0, "Resaving bitmap %s.\n", search);
1593
1594 bm_SaveFileBitmap(search, bm_handle);
1595 } else
1596 Int3();
1597 }
1598}
1599
1600// Takes a vclip name and resaves it
1601void ResaveVClip(char *name) {

Callers 1

ResaveAllBitmapsFunction · 0.85

Calls 5

bm_FindBitmapNameFunction · 0.85
bm_dataFunction · 0.85
bm_SaveFileBitmapFunction · 0.85
bm_AllocLoadFileBitmapFunction · 0.85
ddio_MakePathFunction · 0.50

Tested by

no test coverage detected