aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl/opengl-graphics.cpp
diff options
context:
space:
mode:
authorAlejandro Marzini2010-08-06 21:39:54 +0000
committerAlejandro Marzini2010-08-06 21:39:54 +0000
commit7b898648bcd17767945db07618d0934b76a5dcd5 (patch)
tree5e4cd641f37a5ffafa907f46cf0fe2717a4fe05f /backends/graphics/opengl/opengl-graphics.cpp
parent4e890f8d7425200a5c34556249b06aec88e3fb85 (diff)
downloadscummvm-rg350-7b898648bcd17767945db07618d0934b76a5dcd5.tar.gz
scummvm-rg350-7b898648bcd17767945db07618d0934b76a5dcd5.tar.bz2
scummvm-rg350-7b898648bcd17767945db07618d0934b76a5dcd5.zip
OPENGL: Add 5/3 and 5/4 aspect ratio corrections.
svn-id: r51806
Diffstat (limited to 'backends/graphics/opengl/opengl-graphics.cpp')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 600f280bc8..02e54ac8e4 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -75,6 +75,10 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_desiredAspectRatio = kAspectRatio16_9;
else if (!scumm_stricmp(desiredAspectRatio.c_str(), "16/10"))
_desiredAspectRatio = kAspectRatio16_10;
+ else if (!scumm_stricmp(desiredAspectRatio.c_str(), "5/3"))
+ _desiredAspectRatio = kAspectRatio5_3;
+ else if (!scumm_stricmp(desiredAspectRatio.c_str(), "5/4"))
+ _desiredAspectRatio = kAspectRatio5_4;
#endif
}
@@ -1187,7 +1191,7 @@ void OpenGLGraphicsManager::setAspectRatioCorrection(int ratio) {
if (ratio == -1)
// If -1, switch to next mode
#ifdef USE_ALL_ASR
- _videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 5;
+ _videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 7;
#else
if (_videoMode.aspectRatioCorrection == kAspectRatioNone)
_videoMode.aspectRatioCorrection = kAspectRatioConserve;
@@ -1214,8 +1218,13 @@ Common::String OpenGLGraphicsManager::getAspectRatioName() {
return "16/9";
case kAspectRatio16_10:
return "16/10";
+ case kAspectRatio5_3:
+ return "5/3";
+ case kAspectRatio5_4:
+ return "5/4";
+ default:
+ return "";
}
- return "";
}
uint OpenGLGraphicsManager::getAspectRatio() {
@@ -1228,6 +1237,10 @@ uint OpenGLGraphicsManager::getAspectRatio() {
return 17777;
case kAspectRatio16_10:
return 16000;
+ case kAspectRatio5_3:
+ return 16666;
+ case kAspectRatio5_4:
+ return 12500;
default:
return _videoMode.hardwareWidth * 10000 / _videoMode.hardwareHeight;
}
@@ -1297,7 +1310,7 @@ bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
int width = _videoMode.hardwareWidth;
int height = _videoMode.hardwareHeight;
- // Allocate space for screenshot
+ // Allocate memory for screenshot
uint8 *pixels = new uint8[width * height * 3];
// Get pixel data from OpenGL buffer
@@ -1336,6 +1349,7 @@ bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
// Write pixel data to BMP
out.write(pixels, width * height * 3);
+ // Free allocated memory
delete[] pixels;
return true;