diff options
author | Kostas Nakos | 2009-08-02 19:50:24 +0000 |
---|---|---|
committer | Kostas Nakos | 2009-08-02 19:50:24 +0000 |
commit | acec9026a10aaec94577bbaeade91d97689c7b55 (patch) | |
tree | f68fe8670a9d4e7dac248d96b980c9256b0dbce2 /backends/platform | |
parent | 07de4b50e3d4f27e2a82a965736ca1d35aacf5b1 (diff) | |
download | scummvm-rg350-acec9026a10aaec94577bbaeade91d97689c7b55.tar.gz scummvm-rg350-acec9026a10aaec94577bbaeade91d97689c7b55.tar.bz2 scummvm-rg350-acec9026a10aaec94577bbaeade91d97689c7b55.zip |
clean up and fix vga aspect scaler routines
svn-id: r43008
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/wince/wince-sdl.cpp | 103 |
1 files changed, 36 insertions, 67 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 8343c84f28..9834fef67c 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -1149,70 +1149,11 @@ void OSystem_WINCE3::setGraphicsModeIntern() { bool OSystem_WINCE3::update_scalers() { _videoMode.aspectRatioCorrection = false; - if (_videoMode.mode != GFX_NORMAL) - return 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)) + if (_videoMode.mode != GFX_NORMAL) + return false; + + if ((!_orientationLandscape && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth)) || CEDevice::hasSquareQVGAResolution() ) { if (getScreenWidth() != 320) { _scaleFactorXm = 3; @@ -1263,9 +1204,32 @@ bool OSystem_WINCE3::update_scalers() { } return true; - } + } else if (CEDevice::hasWideResolution()) { +#ifdef USE_ARM_SCALER_ASM + if ( _videoMode.mode == GFX_DOUBLESIZE && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth) ) { + if ( !_panelVisible && !_overlayVisible && _canBeAspectScaled ) { + _scaleFactorXm = 2; + _scaleFactorXd = 1; + _scaleFactorYm = 12; + _scaleFactorYd = 5; + _scalerProc = Normal2xAspect; + _modeFlags = 0; + _videoMode.aspectRatioCorrection = true; + } else if ( (_panelVisible || _overlayVisible) && _canBeAspectScaled ) { + _scaleFactorXm = 2; + _scaleFactorXd = 1; + _scaleFactorYm = 2; + _scaleFactorYd = 1; + _scalerProc = Normal2x; + _modeFlags = 0; + } + return true; + } +#endif + } else if (CEDevice::hasSmartphoneResolution()) { + if (_videoMode.mode != GFX_NORMAL) + return false; - if (CEDevice::hasSmartphoneResolution()) { if (_videoMode.screenWidth > 320) error("Game resolution not supported on Smartphone"); #ifdef ARM @@ -1428,8 +1392,13 @@ 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" - displayWidth = _videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd; - displayHeight = _videoMode.screenHeight * _scaleFactorYm / _scaleFactorYd; + if (!_videoMode.aspectRatioCorrection) { + displayWidth = _videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd; + displayHeight = _videoMode.screenHeight * _scaleFactorYm / _scaleFactorYd; + } else { + displayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + displayHeight = _videoMode.screenHeight* _videoMode.scaleFactor; + } switch (_orientationLandscape) { case 1: |