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

Method SaveTexturesOnClose

editor/WorldTexturesDialog.cpp:1151–1177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149}
1150
1151void CWorldTexturesDialog::SaveTexturesOnClose() {
1152 int i, t;
1153
1154 // When closing, save all our textures locally
1155
1156 if (!Network_up)
1157 return; // don't save a damn thing if the network is down
1158
1159 for (i = 0; i < MAX_TRACKLOCKS; i++) {
1160 if (GlobalTrackLocks[i].used == 1 && GlobalTrackLocks[i].pagetype == PAGETYPE_TEXTURE) {
1161 t = FindTextureName(GlobalTrackLocks[i].name);
1162 ASSERT(t != -1);
1163
1164 mng_ReplacePage(GameTextures[t].name, GameTextures[t].name, t, PAGETYPE_TEXTURE, 1);
1165
1166 std::filesystem::path fname;
1167
1168 if (GameTextures[t].flags & TF_ANIMATED) {
1169 fname = LocalManageGraphicsDir / GameVClips[GameTextures[t].bm_handle].name;
1170 SaveVClip(fname, GameTextures[t].bm_handle);
1171 } else {
1172 fname = LocalManageGraphicsDir / GameBitmaps[GameTextures[t].bm_handle].name;
1173 bm_SaveFileBitmap(fname, GameTextures[t].bm_handle);
1174 }
1175 }
1176 }
1177}
1178
1179BOOL CWorldTexturesDialog::DestroyWindow() {
1180

Callers

nothing calls this directly

Calls 4

FindTextureNameFunction · 0.85
mng_ReplacePageFunction · 0.85
SaveVClipFunction · 0.85
bm_SaveFileBitmapFunction · 0.85

Tested by

no test coverage detected