diff options
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/sdl_v.cpp | 7 | ||||
-rw-r--r-- | src/video/win32_v.cpp | 16 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 12478cfc9..6bf74488d 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -127,8 +127,7 @@ static void GetVideoModes() for (i = 0; modes[i]; i++) { int w = modes[i]->w; int h = modes[i]->h; - if (IsInsideMM(w, 640, MAX_SCREEN_WIDTH + 1) && - IsInsideMM(h, 480, MAX_SCREEN_HEIGHT + 1)) { + if (w >= 640 && h >= 480) { int j; for (j = 0; j < n; j++) { if (_resolutions[j][0] == w && _resolutions[j][1] == h) break; @@ -419,8 +418,8 @@ static int PollEvent() break; case SDL_VIDEORESIZE: { - int w = Clamp(ev.resize.w, 64, MAX_SCREEN_WIDTH); - int h = Clamp(ev.resize.h, 64, MAX_SCREEN_HEIGHT); + int w = max(ev.resize.w, 64); + int h = max(ev.resize.h, 64); ChangeResInGame(w, h); break; } diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 5030362c6..0ab7be62f 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -545,8 +545,8 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP w = r->right - r->left - (r2.right - r2.left); h = r->bottom - r->top - (r2.bottom - r2.top); - w = Clamp(w, 64, MAX_SCREEN_WIDTH); - h = Clamp(h, 64, MAX_SCREEN_HEIGHT); + w = max(w, 64); + h = max(h, 64); SetRect(&r2, 0, 0, w, h); AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE); @@ -677,8 +677,8 @@ static bool AllocateDibSection(int w, int h) HDC dc; int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(); - w = Clamp(w, 64, MAX_SCREEN_WIDTH); - h = Clamp(h, 64, MAX_SCREEN_HEIGHT); + w = max(w, 64); + h = max(h, 64); if (bpp == 0) error("Can't use a blitter that blits 0 bpp for normal visuals"); @@ -737,8 +737,8 @@ static void FindResolutions() * Doesn't really matter since we don't pass a string anyways, but still * a letdown */ for (i = 0; EnumDisplaySettingsA(NULL, i, &dm) != 0; i++) { - if (dm.dmBitsPerPel == BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() && IsInsideMM(dm.dmPelsWidth, 640, MAX_SCREEN_WIDTH + 1) && - IsInsideMM(dm.dmPelsHeight, 480, MAX_SCREEN_HEIGHT + 1)) { + if (dm.dmBitsPerPel == BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() && + dm.dmPelsWidth >= 640 && dm.dmPelsHeight >= 480) { uint j; for (j = 0; j < n; j++) { @@ -787,10 +787,10 @@ const char *VideoDriver_Win32::Start(const char * const *parm) _wnd.height_org = _cur_resolution[1]; AllocateDibSection(_cur_resolution[0], _cur_resolution[1]); - MarkWholeScreenDirty(); - MakeWindow(_fullscreen); + MarkWholeScreenDirty(); + return NULL; } |