Fix save game preview (#33)

This commit is contained in:
k3tamina 2022-06-07 23:14:52 +02:00 committed by GitHub
parent 893dc0e090
commit 12cbfe262c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -626,9 +626,10 @@ int _QuickSnapShot()
}
// For preview take 640x380 area in the center of isometric window.
unsigned char* isoWindowBuffer = windowGetBuffer(gIsoWindow)
+ (screenGetWidth() - ORIGINAL_ISO_WINDOW_WIDTH) / 2 * (screenGetHeight() - ORIGINAL_ISO_WINDOW_HEIGHT) / 2
+ (screenGetWidth() - ORIGINAL_ISO_WINDOW_WIDTH) / 2;
Window* window = windowGetWindow(gIsoWindow);
unsigned char* isoWindowBuffer = window->buffer
+ window->width * (window->height - ORIGINAL_ISO_WINDOW_HEIGHT) / 2
+ (window->width - ORIGINAL_ISO_WINDOW_WIDTH) / 2;
blitBufferToBufferStretch(isoWindowBuffer,
ORIGINAL_ISO_WINDOW_WIDTH,
ORIGINAL_ISO_WINDOW_HEIGHT,
@ -1107,9 +1108,10 @@ int lsgWindowInit(int windowType)
}
// For preview take 640x380 area in the center of isometric window.
unsigned char* isoWindowBuffer = windowGetBuffer(gIsoWindow)
+ (screenGetWidth() - ORIGINAL_ISO_WINDOW_WIDTH) / 2 * (screenGetHeight() - ORIGINAL_ISO_WINDOW_HEIGHT) / 2
+ (screenGetWidth() - ORIGINAL_ISO_WINDOW_WIDTH) / 2;
Window* window = windowGetWindow(gIsoWindow);
unsigned char* isoWindowBuffer = window->buffer
+ window->width * (window->height - ORIGINAL_ISO_WINDOW_HEIGHT) / 2
+ (window->width - ORIGINAL_ISO_WINDOW_WIDTH) / 2;
blitBufferToBufferStretch(isoWindowBuffer,
ORIGINAL_ISO_WINDOW_WIDTH,
ORIGINAL_ISO_WINDOW_HEIGHT,