[Scummvm-cvs-logs] SF.net SVN: scummvm:[43008] scummvm/trunk/backends/platform/wince/wince-sdl .cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sun Aug 2 21:50:24 CEST 2009
Revision: 43008
http://scummvm.svn.sourceforge.net/scummvm/?rev=43008&view=rev
Author: knakos
Date: 2009-08-02 19:50:24 +0000 (Sun, 02 Aug 2009)
Log Message:
-----------
clean up and fix vga aspect scaler routines
Modified Paths:
--------------
scummvm/trunk/backends/platform/wince/wince-sdl.cpp
Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp 2009-08-02 19:46:18 UTC (rev 43007)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp 2009-08-02 19:50:24 UTC (rev 43008)
@@ -1149,70 +1149,11 @@
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 @@
}
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 @@
// 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:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list