Fixed taking screenshots with DirectDraw;

Reenabled minimizing the window - it no longer crashes the emulator.
This commit is contained in:
OBattler
2017-11-18 16:39:01 +01:00
parent 21c60d5a3e
commit d64c481952
4 changed files with 28 additions and 4 deletions

View File

@@ -152,7 +152,19 @@ int64_t main_time;
static int unscaled_size_x = SCREEN_RES_X, /* current unscaled size X */
unscaled_size_y = SCREEN_RES_Y; /* current unscaled size Y */
unscaled_size_y = SCREEN_RES_Y, /* current unscaled size Y */
efscrnsz_y = SCREEN_RES_Y;
int get_actual_size_x(void)
{
return unscaled_size_x;
}
int get_actual_size_y(void)
{
return efscrnsz_y;
}
/* Log something to the logfile or stdout. */
@@ -210,7 +222,6 @@ set_screen_size(int x, int y)
int temp_overscan_x = overscan_x;
int temp_overscan_y = overscan_y;
double dx, dy, dtx, dty;
int efscrnsz_y;
/* Make sure we keep usable values. */
#if 0

View File

@@ -218,6 +218,9 @@ extern void video_update_timing(void);
extern void loadfont(wchar_t *s, int format);
extern int get_actual_size_x(void);
extern int get_actual_size_y(void);
#ifdef ENABLE_VRAM_DUMP
extern void svga_dump_vram(void);
#endif

View File

@@ -963,10 +963,10 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
/* Set up main window for resizing if configured. */
if (vid_resize)
SetWindowLongPtr(hwnd, GWL_STYLE,
(WS_OVERLAPPEDWINDOW&~WS_MINIMIZEBOX));
(WS_OVERLAPPEDWINDOW));
else
SetWindowLongPtr(hwnd, GWL_STYLE,
(WS_OVERLAPPEDWINDOW&~WS_SIZEBOX&~WS_THICKFRAME&~WS_MAXIMIZEBOX&~WS_MINIMIZEBOX));
(WS_OVERLAPPEDWINDOW&~WS_SIZEBOX&~WS_THICKFRAME&~WS_MAXIMIZEBOX));
/* Move to the last-saved position if needed. */
if (window_remember)

View File

@@ -353,6 +353,7 @@ ddraw_blit(int x, int y, int y1, int y2, int w, int h)
void
ddraw_take_screenshot(wchar_t *fn)
{
#if 0
xs = xsize;
ys = ys2 = ysize;
@@ -369,6 +370,15 @@ ddraw_take_screenshot(wchar_t *fn)
else
ys += overscan_y;
}
#endif
xs = get_actual_size_x();
ys = ys2 = get_actual_size_y();
if (ysize <= 250) {
ys >>= 1;
ys2 >>= 1;
}
CopySurface(lpdds_back2);