| 1149 | } |
| 1150 | |
| 1151 | void 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 | |
| 1179 | BOOL CWorldTexturesDialog::DestroyWindow() { |
| 1180 |
nothing calls this directly
no test coverage detected