File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -981,7 +981,8 @@ wxMemoryDC* GameSprite::getDC(SpriteSize size)
981981 if (!dc[size]) {
982982 ASSERT (width >= 1 && height >= 1 );
983983
984- wxImage image (width * SPRITE_PIXELS, height * SPRITE_PIXELS);
984+ uint8_t image_size = std::max<uint8_t >(width, height) * SPRITE_PIXELS;
985+ wxImage image (image_size, image_size);
985986
986987 for (uint8_t l = 0 ; l < layers; l++) {
987988 for (uint8_t w = 0 ; w < width; w++) {
@@ -1000,8 +1001,8 @@ wxMemoryDC* GameSprite::getDC(SpriteSize size)
10001001
10011002 // Now comes the resizing / antialiasing
10021003 if (size == SPRITE_SIZE_16x16 || image.GetWidth () > SPRITE_PIXELS || image.GetHeight () > SPRITE_PIXELS) {
1003- int wh = SPRITE_SIZE_16x16 ? 16 : 32 ;
1004- image.Rescale (wh, wh );
1004+ int new_size = SPRITE_SIZE_16x16 ? 16 : 32 ;
1005+ image.Rescale (new_size, new_size );
10051006 }
10061007
10071008 wxBitmap bmp (image);
You can’t perform that action at this time.
0 commit comments