mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-20 00:41:12 +00:00
clean up and fix vga aspect scaler routines
svn-id: r43008
This commit is contained in:
parent
07de4b50e3
commit
acec9026a1
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user