| 2160 | } |
| 2161 | |
| 2162 | void CWorldTexturesDialog::ChangeSize(int w, int h) { |
| 2163 | int n = D3EditState.texdlg_texture; |
| 2164 | char str[255]; |
| 2165 | |
| 2166 | sprintf(str, "Are you sure you wish to change this texture to %d x %d?", w, h); |
| 2167 | |
| 2168 | int answer = MessageBox(str, GameTextures[n].name, MB_YESNO); |
| 2169 | if (answer == IDNO) |
| 2170 | return; |
| 2171 | |
| 2172 | if (GameTextures[n].flags & TF_ANIMATED) { |
| 2173 | vclip *vc = &GameVClips[GameTextures[n].bm_handle]; |
| 2174 | for (int i = 0; i < vc->num_frames; i++) |
| 2175 | bm_ChangeSize(vc->frames[i], w, h); |
| 2176 | } else { |
| 2177 | bm_ChangeSize(GameTextures[n].bm_handle, w, h); |
| 2178 | } |
| 2179 | |
| 2180 | GameTextures[n].flags &= ~(TF_TEXTURE_32 | TF_TEXTURE_64 | TF_TEXTURE_256); |
| 2181 | if (w == 64) |
| 2182 | GameTextures[n].flags |= TF_TEXTURE_64; |
| 2183 | else if (w == 32) |
| 2184 | GameTextures[n].flags |= TF_TEXTURE_32; |
| 2185 | |
| 2186 | mprintf(0, "Texture changed to %d x %d!\n", w, h); |
| 2187 | |
| 2188 | UpdateDialog(); |
| 2189 | } |
| 2190 | |
| 2191 | void CWorldTexturesDialog::OnConvertToNormal() { ChangeSize(128, 128); } |
| 2192 |
nothing calls this directly
no test coverage detected