[Scummvm-cvs-logs] SF.net SVN: scummvm:[52502] scummvm/branches/gsoc2010-opengl/backends/ graphics/opengl
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Fri Sep 3 05:47:06 CEST 2010
Revision: 52502
http://scummvm.svn.sourceforge.net/scummvm/?rev=52502&view=rev
Author: vgvgf
Date: 2010-09-03 03:47:05 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
OPENGL: Fix enable aspect ratio feature.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp 2010-09-03 03:23:46 UTC (rev 52501)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.cpp 2010-09-03 03:47:05 UTC (rev 52502)
@@ -48,7 +48,8 @@
_cursorVisible(false), _cursorKeyColor(0),
_cursorTargetScale(1),
_formatBGR(false),
- _displayX(0), _displayY(0), _displayWidth(0), _displayHeight(0) {
+ _displayX(0), _displayY(0), _displayWidth(0), _displayHeight(0),
+ _aspectRatioCorrection(false) {
memset(&_oldVideoMode, 0, sizeof(_oldVideoMode));
memset(&_videoMode, 0, sizeof(_videoMode));
@@ -95,7 +96,8 @@
void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
- setGraphicsMode(enable ? OpenGL::GFX_CONSERVE : OpenGL::GFX_NORMAL);
+ _videoMode.mode = OpenGL::GFX_4_3;
+ _aspectRatioCorrection = enable;
break;
default:
break;
@@ -1293,6 +1295,7 @@
_videoMode.mode = mode;
_transactionDetails.needRefresh = true;
+ _aspectRatioCorrection = false;
}
}
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h 2010-09-03 03:23:46 UTC (rev 52501)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/opengl-graphics.h 2010-09-03 03:47:05 UTC (rev 52502)
@@ -189,6 +189,8 @@
virtual void calculateDisplaySize(int &width, int &height);
virtual void refreshDisplaySize();
+ bool _aspectRatioCorrection;
+
/**
* Returns the current target aspect ratio x 10000
*/
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp 2010-09-03 03:23:46 UTC (rev 52501)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/openglsdl/openglsdl-graphics.cpp 2010-09-03 03:47:05 UTC (rev 52502)
@@ -315,6 +315,10 @@
}
bool OpenGLSdlGraphicsManager::loadGFXMode() {
+ // Force 4/3 if feature enabled
+ if (_aspectRatioCorrection)
+ _videoMode.mode = OpenGL::GFX_4_3;
+
_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
@@ -587,6 +591,7 @@
beginGFXTransaction();
_videoMode.mode = sdlKey - (isNormalNumber ? SDLK_1 : SDLK_KP1);
_transactionDetails.needRefresh = true;
+ _aspectRatioCorrection = false;
endGFXTransaction();
#ifdef USE_OSD
if (lastMode != _videoMode.mode)
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