aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2011-03-17 20:27:00 +0100
committerJohannes Schickel2011-03-17 21:20:20 +0100
commit83b199e9212092bcc737e36eb3f0cff0666ddeac (patch)
tree19f5e4d856e8ccf58bdd94482b418e61582e3ba6
parent8d87a460b075793c3a06f5339eb5ee14c7498005 (diff)
downloadscummvm-rg350-83b199e9212092bcc737e36eb3f0cff0666ddeac.tar.gz
scummvm-rg350-83b199e9212092bcc737e36eb3f0cff0666ddeac.tar.bz2
scummvm-rg350-83b199e9212092bcc737e36eb3f0cff0666ddeac.zip
OPENGL: Move setFullscreenMode to OpenGLGraphicsManager.
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp21
-rw-r--r--backends/graphics/opengl/opengl-graphics.h5
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp13
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.h3
4 files changed, 26 insertions, 16 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 915a686285..0729ff331c 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -98,6 +98,10 @@ bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) {
void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
+ case OSystem::kFeatureFullscreenMode:
+ setFullscreenMode(enable);
+ break;
+
case OSystem::kFeatureAspectRatioCorrection:
// TODO: If we enable aspect ratio correction, we automatically set
// the video mode to 4/3. That is quity messy, but since we have that
@@ -108,6 +112,7 @@ void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
if (enable)
_videoMode.mode = OpenGL::GFX_4_3;
break;
+
default:
break;
}
@@ -115,8 +120,12 @@ void OpenGLGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
bool OpenGLGraphicsManager::getFeatureState(OSystem::Feature f) {
switch (f) {
+ case OSystem::kFeatureFullscreenMode:
+ return _videoMode.fullscreen;
+
case OSystem::kFeatureAspectRatioCorrection:
return _videoMode.mode == OpenGL::GFX_4_3;
+
default:
return false;
}
@@ -677,6 +686,18 @@ void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) {
// Intern
//
+void OpenGLGraphicsManager::setFullscreenMode(bool enable) {
+ assert(_transactionMode == kTransactionActive);
+
+ if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
+ return;
+
+ if (_transactionMode == kTransactionActive) {
+ _videoMode.fullscreen = enable;
+ _transactionDetails.needRefresh = true;
+ }
+}
+
void OpenGLGraphicsManager::refreshGameScreen() {
if (_screenNeedsRedraw)
_screenDirtyRect = Common::Rect(0, 0, _screenData.w, _screenData.h);
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 31606cf336..c8b64fab89 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -176,6 +176,11 @@ protected:
virtual void unloadGFXMode();
/**
+ * Setup the fullscreen mode state.
+ */
+ void setFullscreenMode(bool enable);
+
+ /**
* Set the scale factor.
*
* This can only be used in a GFX transaction.
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 3eb15bd684..e16a51762c 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -79,9 +79,6 @@ bool OpenGLSdlGraphicsManager::hasFeature(OSystem::Feature f) {
void OpenGLSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
- case OSystem::kFeatureFullscreenMode:
- setFullscreenMode(enable);
- break;
case OSystem::kFeatureIconifyWindow:
if (enable)
SDL_WM_IconifyWindow();
@@ -422,16 +419,6 @@ void OpenGLSdlGraphicsManager::displayScaleChangedMsg() {
}
#endif
-void OpenGLSdlGraphicsManager::setFullscreenMode(bool enable) {
- if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
- return;
-
- if (_transactionMode == kTransactionActive) {
- _videoMode.fullscreen = enable;
- _transactionDetails.needRefresh = true;
- }
-}
-
bool OpenGLSdlGraphicsManager::isHotkey(const Common::Event &event) {
if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
if (event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_MINUS ||
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index f706fc2bf5..e9e5ed882d 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -57,9 +57,6 @@ protected:
virtual bool loadGFXMode();
virtual void unloadGFXMode();
-
- virtual void setFullscreenMode(bool enable);
-
virtual bool isHotkey(const Common::Event &event);
#ifdef USE_RGB_COLOR