From 816bd9a7ea4f99aaae67c6e82f686b88dd8c728f Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 27 Jul 2009 16:29:36 +0000 Subject: Add ARM code version of Normal2x scaler. Add ARM only aspect ratio correcting version of Normal2x scaler. Make WinCE port use Normal2x by default if the screen is large enough. Make WinCE port use aspect ratio correcting version if panel is hidden. svn-id: r42843 --- backends/platform/wince/wince-sdl.cpp | 70 +++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 8 deletions(-) (limited to 'backends') diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 8b2e0848f8..47d9597f4f 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -1147,10 +1147,69 @@ void OSystem_WINCE3::setGraphicsModeIntern() { } bool OSystem_WINCE3::update_scalers() { + _videoMode.aspectRatioCorrection = false; + if (_videoMode.mode != GFX_NORMAL) return false; - _videoMode.aspectRatioCorrection = false; + /* If we're on a device with a large enough screen to accomodate a + * doubled screen, double the screen. */ + if ((!_orientationLandscape) && + (_videoMode.screenWidth == 320 || !_videoMode.screenWidth) && + (getScreenWidth() >= 640) && + (getScreenHeight() >= 480)) + { +#ifdef USE_ARM_SCALER_ASM + if (!_panelVisible && !_overlayVisible && _canBeAspectScaled) + { + _scaleFactorXm = 2; + _scaleFactorXd = 1; + _scaleFactorYm = 12; + _scaleFactorYd = 5; + _scalerProc = Normal2xAspect; + _modeFlags = 0; + _videoMode.aspectRatioCorrection = true; + } + else +#endif + { + _scaleFactorXm = 2; + _scaleFactorXd = 1; + _scaleFactorYm = 2; + _scaleFactorYd = 1; + _scalerProc = Normal2x; + _modeFlags = 0; + } + return true; + } + if ((_orientationLandscape) && + (_videoMode.screenWidth == 320 || !_videoMode.screenWidth) && + (getScreenWidth() >= 480) && + (getScreenHeight() >= 640)) + { +#ifdef USE_ARM_SCALER_ASM + if (!_panelVisible && !_overlayVisible && _canBeAspectScaled) + { + _scaleFactorXm = 2; + _scaleFactorXd = 1; + _scaleFactorYm = 12; + _scaleFactorYd = 5; + _scalerProc = Normal2xAspect; + _modeFlags = 0; + _videoMode.aspectRatioCorrection = true; + } + else +#endif + { + _scaleFactorXm = 2; + _scaleFactorXd = 1; + _scaleFactorYm = 2; + _scaleFactorYd = 1; + _scalerProc = Normal2x; + _modeFlags = 0; + } + return true; + } if (CEDevice::hasPocketPCResolution()) { if ( (!_orientationLandscape && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth)) @@ -1369,13 +1428,8 @@ bool OSystem_WINCE3::loadGFXMode() { // Create the surface that contains the scaled graphics in 16 bit mode // Always use full screen mode to have a "clean screen" - if (!_videoMode.aspectRatioCorrection) { - displayWidth = _videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd; - displayHeight = _videoMode.screenHeight * _scaleFactorYm / _scaleFactorYd; - } else { - displayWidth = _videoMode.screenWidth; - displayHeight = _videoMode.screenHeight; - } + displayWidth = _videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd; + displayHeight = _videoMode.screenHeight * _scaleFactorYm / _scaleFactorYd; switch (_orientationLandscape) { case 1: -- cgit v1.2.3