[Scummvm-cvs-logs] SF.net SVN: scummvm:[40226] scummvm/trunk/backends/platform/sdl
Tramboi at users.sourceforge.net
Tramboi at users.sourceforge.net
Fri May 1 11:09:08 CEST 2009
Revision: 40226
http://scummvm.svn.sourceforge.net/scummvm/?rev=40226&view=rev
Author: Tramboi
Date: 2009-05-01 09:09:07 +0000 (Fri, 01 May 2009)
Log Message:
-----------
Renamed aspectRatio to aspectRatioCorrection in the SDL backend to match the accessor functions
(don't worry, o reader, for this is the only modification going to the SVN :) )
Modified Paths:
--------------
scummvm/trunk/backends/platform/sdl/events.cpp
scummvm/trunk/backends/platform/sdl/graphics.cpp
scummvm/trunk/backends/platform/sdl/sdl.cpp
scummvm/trunk/backends/platform/sdl/sdl.h
Modified: scummvm/trunk/backends/platform/sdl/events.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/events.cpp 2009-05-01 07:36:50 UTC (rev 40225)
+++ scummvm/trunk/backends/platform/sdl/events.cpp 2009-05-01 09:09:07 UTC (rev 40226)
@@ -80,7 +80,7 @@
if (!_overlayVisible) {
event.mouse.x /= _videoMode.scaleFactor;
event.mouse.y /= _videoMode.scaleFactor;
- if (_videoMode.aspectRatio)
+ if (_videoMode.aspectRatioCorrection)
event.mouse.y = aspect2Real(event.mouse.y);
}
}
Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp 2009-05-01 07:36:50 UTC (rev 40225)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp 2009-05-01 09:09:07 UTC (rev 40226)
@@ -111,10 +111,10 @@
errors |= kTransactionFullscreenFailed;
_videoMode.fullscreen = _oldVideoMode.fullscreen;
- } else if (_videoMode.aspectRatio != _oldVideoMode.aspectRatio) {
+ } else if (_videoMode.aspectRatioCorrection != _oldVideoMode.aspectRatioCorrection) {
errors |= kTransactionAspectRatioFailed;
- _videoMode.aspectRatio = _oldVideoMode.aspectRatio;
+ _videoMode.aspectRatioCorrection = _oldVideoMode.aspectRatioCorrection;
} else if (_videoMode.mode != _oldVideoMode.mode) {
errors |= kTransactionModeSwitchFailed;
@@ -130,7 +130,7 @@
}
if (_videoMode.fullscreen == _oldVideoMode.fullscreen &&
- _videoMode.aspectRatio == _oldVideoMode.aspectRatio &&
+ _videoMode.aspectRatioCorrection == _oldVideoMode.aspectRatioCorrection &&
_videoMode.mode == _oldVideoMode.mode &&
_videoMode.screenWidth == _oldVideoMode.screenWidth &&
_videoMode.screenHeight == _oldVideoMode.screenHeight) {
@@ -369,9 +369,9 @@
_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
- _videoMode.aspectRatio = false;
+ _videoMode.aspectRatioCorrection = false;
- if (_videoMode.aspectRatio)
+ if (_videoMode.aspectRatioCorrection)
_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
hwW = _videoMode.screenWidth * _videoMode.scaleFactor;
@@ -593,7 +593,7 @@
if (_currentShakePos != _newShakePos) {
SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor};
- if (_videoMode.aspectRatio && !_overlayVisible)
+ if (_videoMode.aspectRatioCorrection && !_overlayVisible)
blackrect.h = real2Aspect(blackrect.h - 1) + 1;
SDL_FillRect(_hwscreen, &blackrect, 0);
@@ -702,7 +702,7 @@
orig_dst_y = dst_y;
dst_y = dst_y * scale1;
- if (_videoMode.aspectRatio && !_overlayVisible)
+ if (_videoMode.aspectRatioCorrection && !_overlayVisible)
dst_y = real2Aspect(dst_y);
assert(scalerProc != NULL);
@@ -716,7 +716,7 @@
r->h = dst_h * scale1;
#ifndef DISABLE_SCALERS
- if (_videoMode.aspectRatio && orig_dst_y < height && !_overlayVisible)
+ if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible)
r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1);
#endif
}
@@ -768,11 +768,11 @@
void OSystem_SDL::setAspectRatioCorrection(bool enable) {
Common::StackLock lock(_graphicsMutex);
- if (_oldVideoMode.setup && _oldVideoMode.aspectRatio == enable)
+ if (_oldVideoMode.setup && _oldVideoMode.aspectRatioCorrection == enable)
return;
if (_transactionMode == kTransactionActive) {
- _videoMode.aspectRatio = enable;
+ _videoMode.aspectRatioCorrection = enable;
_transactionDetails.needHotswap = true;
}
}
@@ -936,7 +936,7 @@
}
#ifndef DISABLE_SCALERS
- if (_videoMode.aspectRatio && !_overlayVisible && !realCoordinates) {
+ if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) {
makeRectStretchable(x, y, w, h);
}
#endif
@@ -1131,7 +1131,7 @@
// Since resolution could change, put mouse to adjusted position
// Fixes bug #1349059
x = _mouseCurState.x * _videoMode.scaleFactor;
- if (_videoMode.aspectRatio)
+ if (_videoMode.aspectRatioCorrection)
y = real2Aspect(_mouseCurState.y) * _videoMode.scaleFactor;
else
y = _mouseCurState.y * _videoMode.scaleFactor;
@@ -1155,7 +1155,7 @@
// Fixes bug #1349059
x = _mouseCurState.x / _videoMode.scaleFactor;
y = _mouseCurState.y / _videoMode.scaleFactor;
- if (_videoMode.aspectRatio)
+ if (_videoMode.aspectRatioCorrection)
y = aspect2Real(y);
warpMouse(x, y);
@@ -1188,7 +1188,7 @@
(byte *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight);
#ifndef DISABLE_SCALERS
- if (_videoMode.aspectRatio)
+ if (_videoMode.aspectRatioCorrection)
stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch,
_videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0);
#endif
@@ -1291,7 +1291,7 @@
void OSystem_SDL::warpMouse(int x, int y) {
int y1 = y;
- if (_videoMode.aspectRatio && !_overlayVisible)
+ if (_videoMode.aspectRatioCorrection && !_overlayVisible)
y1 = real2Aspect(y);
if (_mouseCurState.x != x || _mouseCurState.y != y) {
@@ -1444,7 +1444,7 @@
int rH1 = rH; // store original to pass to aspect-correction function later
#endif
- if (_videoMode.aspectRatio && _cursorTargetScale == 1) {
+ if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) {
rH = real2Aspect(rH - 1) + 1;
_mouseCurState.rHotY = real2Aspect(_mouseCurState.rHotY);
}
@@ -1489,7 +1489,7 @@
_mouseCurState.w, _mouseCurState.h);
#ifndef DISABLE_SCALERS
- if (_videoMode.aspectRatio && _cursorTargetScale == 1)
+ if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1)
cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0);
#endif
@@ -1586,7 +1586,7 @@
dst.y += _currentShakePos;
}
- if (_videoMode.aspectRatio && !_overlayVisible)
+ if (_videoMode.aspectRatioCorrection && !_overlayVisible)
dst.y = real2Aspect(dst.y);
dst.x = scale * dst.x - _mouseCurState.rHotX;
@@ -1703,11 +1703,11 @@
// Ctrl-Alt-a toggles aspect ratio correction
if (key.keysym.sym == 'a') {
beginGFXTransaction();
- setFeatureState(kFeatureAspectRatioCorrection, !_videoMode.aspectRatio);
+ setFeatureState(kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection);
endGFXTransaction();
#ifdef USE_OSD
char buffer[128];
- if (_videoMode.aspectRatio)
+ if (_videoMode.aspectRatioCorrection)
sprintf(buffer, "Enabled aspect ratio correction\n%d x %d -> %d x %d",
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h
Modified: scummvm/trunk/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.cpp 2009-05-01 07:36:50 UTC (rev 40225)
+++ scummvm/trunk/backends/platform/sdl/sdl.cpp 2009-05-01 09:09:07 UTC (rev 40226)
@@ -123,12 +123,12 @@
#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && !defined(DISABLE_SCALERS)
_videoMode.mode = GFX_DOUBLESIZE;
_videoMode.scaleFactor = 2;
- _videoMode.aspectRatio = ConfMan.getBool("aspect_ratio");
+ _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio");
_scalerProc = Normal2x;
#else // for small screen platforms
_videoMode.mode = GFX_NORMAL;
_videoMode.scaleFactor = 1;
- _videoMode.aspectRatio = false;
+ _videoMode.aspectRatioCorrection = false;
_scalerProc = Normal1x;
#endif
_scalerType = 0;
@@ -438,7 +438,7 @@
case kFeatureFullscreenMode:
return _videoMode.fullscreen;
case kFeatureAspectRatioCorrection:
- return _videoMode.aspectRatio;
+ return _videoMode.aspectRatioCorrection;
case kFeatureAutoComputeDirtyRects:
return _modeFlags & DF_WANT_RECT_OPTIM;
default:
Modified: scummvm/trunk/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.h 2009-05-01 07:36:50 UTC (rev 40225)
+++ scummvm/trunk/backends/platform/sdl/sdl.h 2009-05-01 09:09:07 UTC (rev 40226)
@@ -267,7 +267,7 @@
bool setup;
bool fullscreen;
- bool aspectRatio;
+ bool aspectRatioCorrection;
int mode;
int scaleFactor;
@@ -425,7 +425,7 @@
virtual bool saveScreenshot(const char *filename); // overloaded by CE backend
int effectiveScreenHeight() const {
- return (_videoMode.aspectRatio ? real2Aspect(_videoMode.screenHeight) : _videoMode.screenHeight)
+ return (_videoMode.aspectRatioCorrection ? real2Aspect(_videoMode.screenHeight) : _videoMode.screenHeight)
* _videoMode.scaleFactor;
}
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