543 SetRect(&r2, 0, 0, 0, 0); |
543 SetRect(&r2, 0, 0, 0, 0); |
544 AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE); |
544 AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE); |
545 |
545 |
546 w = r->right - r->left - (r2.right - r2.left); |
546 w = r->right - r->left - (r2.right - r2.left); |
547 h = r->bottom - r->top - (r2.bottom - r2.top); |
547 h = r->bottom - r->top - (r2.bottom - r2.top); |
548 w = Clamp(w, 64, MAX_SCREEN_WIDTH); |
548 w = max(w, 64); |
549 h = Clamp(h, 64, MAX_SCREEN_HEIGHT); |
549 h = max(h, 64); |
550 SetRect(&r2, 0, 0, w, h); |
550 SetRect(&r2, 0, 0, w, h); |
551 |
551 |
552 AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE); |
552 AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE); |
553 w = r2.right - r2.left; |
553 w = r2.right - r2.left; |
554 h = r2.bottom - r2.top; |
554 h = r2.bottom - r2.top; |
675 { |
675 { |
676 BITMAPINFO *bi; |
676 BITMAPINFO *bi; |
677 HDC dc; |
677 HDC dc; |
678 int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(); |
678 int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth(); |
679 |
679 |
680 w = Clamp(w, 64, MAX_SCREEN_WIDTH); |
680 w = max(w, 64); |
681 h = Clamp(h, 64, MAX_SCREEN_HEIGHT); |
681 h = max(h, 64); |
682 |
682 |
683 if (bpp == 0) error("Can't use a blitter that blits 0 bpp for normal visuals"); |
683 if (bpp == 0) error("Can't use a blitter that blits 0 bpp for normal visuals"); |
684 |
684 |
685 if (w == _screen.width && h == _screen.height) |
685 if (w == _screen.width && h == _screen.height) |
686 return false; |
686 return false; |
735 |
735 |
736 /* XXX - EnumDisplaySettingsW crashes with unicows.dll on Windows95 |
736 /* XXX - EnumDisplaySettingsW crashes with unicows.dll on Windows95 |
737 * Doesn't really matter since we don't pass a string anyways, but still |
737 * Doesn't really matter since we don't pass a string anyways, but still |
738 * a letdown */ |
738 * a letdown */ |
739 for (i = 0; EnumDisplaySettingsA(NULL, i, &dm) != 0; i++) { |
739 for (i = 0; EnumDisplaySettingsA(NULL, i, &dm) != 0; i++) { |
740 if (dm.dmBitsPerPel == BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() && IsInsideMM(dm.dmPelsWidth, 640, MAX_SCREEN_WIDTH + 1) && |
740 if (dm.dmBitsPerPel == BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() && |
741 IsInsideMM(dm.dmPelsHeight, 480, MAX_SCREEN_HEIGHT + 1)) { |
741 dm.dmPelsWidth >= 640 && dm.dmPelsHeight >= 480) { |
742 uint j; |
742 uint j; |
743 |
743 |
744 for (j = 0; j < n; j++) { |
744 for (j = 0; j < n; j++) { |
745 if (_resolutions[j][0] == dm.dmPelsWidth && _resolutions[j][1] == dm.dmPelsHeight) break; |
745 if (_resolutions[j][0] == dm.dmPelsWidth && _resolutions[j][1] == dm.dmPelsHeight) break; |
746 } |
746 } |
785 // fullscreen uses those |
785 // fullscreen uses those |
786 _wnd.width_org = _cur_resolution[0]; |
786 _wnd.width_org = _cur_resolution[0]; |
787 _wnd.height_org = _cur_resolution[1]; |
787 _wnd.height_org = _cur_resolution[1]; |
788 |
788 |
789 AllocateDibSection(_cur_resolution[0], _cur_resolution[1]); |
789 AllocateDibSection(_cur_resolution[0], _cur_resolution[1]); |
|
790 MakeWindow(_fullscreen); |
|
791 |
790 MarkWholeScreenDirty(); |
792 MarkWholeScreenDirty(); |
791 |
|
792 MakeWindow(_fullscreen); |
|
793 |
793 |
794 return NULL; |
794 return NULL; |
795 } |
795 } |
796 |
796 |
797 void VideoDriver_Win32::Stop() |
797 void VideoDriver_Win32::Stop() |