aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJody Northup2009-06-27 05:58:44 +0000
committerJody Northup2009-06-27 05:58:44 +0000
commit853aec05ba4485f0bfc90e7515322dfd56a8d4af (patch)
treed088498595ba59e32df821d2f4b96602e7c91779 /engines
parentfe65f6163c88b77a5997d47eff842b78812085be (diff)
downloadscummvm-rg350-853aec05ba4485f0bfc90e7515322dfd56a8d4af.tar.gz
scummvm-rg350-853aec05ba4485f0bfc90e7515322dfd56a8d4af.tar.bz2
scummvm-rg350-853aec05ba4485f0bfc90e7515322dfd56a8d4af.zip
changed initGraphics, and OSystem::initSize to take Graphics::PixelFormat * parameters instead of Graphics::PixelFormat parameters, to save unnecessary pixelformat initialization if ENABLE_RGB_COLOR is not set.
svn-id: r41909
Diffstat (limited to 'engines')
-rw-r--r--engines/engine.cpp7
-rw-r--r--engines/engine.h7
-rw-r--r--engines/groovie/groovie.cpp2
-rw-r--r--engines/scumm/scumm.cpp2
4 files changed, 4 insertions, 14 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 7a76de36dc..198bfceaed 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -124,12 +124,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
if (gameDomain && gameDomain->contains("fullscreen"))
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
-void initGraphics(int width, int height, bool defaultTo1xScaler) {
-#ifdef ENABLE_RGB_COLOR
- initGraphics(width,height,defaultTo1xScaler, Graphics::PixelFormat::createFormatCLUT8());
-}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
-#endif
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat *format) {
g_system->beginGFXTransaction();
diff --git a/engines/engine.h b/engines/engine.h
index 864450d6e1..67454629e7 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -29,9 +29,7 @@
#include "common/error.h"
#include "common/fs.h"
#include "common/str.h"
-#ifdef ENABLE_RGB_COLOR
#include "graphics/pixelformat.h"
-#endif
class OSystem;
@@ -62,10 +60,7 @@ void initCommonGFX(bool defaultTo1XScaler);
* Errors out when backend is not able to switch to the specified
* mode.
*/
-#ifdef ENABLE_RGB_COLOR
-void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format);
-#endif
-void initGraphics(int width, int height, bool defaultTo1xScaler);
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat *format = NULL);
/**
* Initializes graphics and shows error message.
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 5b1a139dbe..9a22a18a21 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -74,7 +74,7 @@ Common::Error GroovieEngine::run() {
case kGroovieV2:
#ifdef ENABLE_RGB_COLOR
_pixelFormat = _system->getSupportedFormats().front();
- initGraphics(640, 480, true, _pixelFormat);
+ initGraphics(640, 480, true, &_pixelFormat);
break;
#endif
case kGroovieT7G:
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index cab8db2d45..fe38bbf82f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1086,7 +1086,7 @@ Common::Error ScummEngine::init() {
} else if (_game.features & GF_16BIT_COLOR) {
#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatRGB555();
- initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
+ initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
if (format != _system->getScreenFormat())
return Common::kUnsupportedColorMode;
#else