aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/sdl/graphics.cpp13
-rw-r--r--backends/platform/sdl/sdl.h2
-rw-r--r--common/system.h2
-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
7 files changed, 14 insertions, 21 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index f6b4d76418..a45f31108b 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -354,18 +354,21 @@ int OSystem_SDL::getGraphicsMode() const {
return _videoMode.mode;
}
-void OSystem_SDL::initSize(uint w, uint h, Graphics::PixelFormat format) {
+void OSystem_SDL::initSize(uint w, uint h, Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
#ifdef ENABLE_RGB_COLOR
//avoid redundant format changes
- assert(format.bytesPerPixel > 0);
+ if (!format)
+ format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
+
+ assert(format->bytesPerPixel > 0);
- if (format != _videoMode.format)
+ if (*format != _videoMode.format)
{
- _videoMode.format = format;
+ _videoMode.format = *format;
_transactionDetails.formatChanged = true;
- _screenFormat = format;
+ _screenFormat = *format;
}
#endif
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 2048b7f536..befb82cc89 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -123,7 +123,7 @@ public:
// Set the size and format of the video bitmap.
// Typically, 320x200 CLUT8
- virtual void initSize(uint w, uint h, Graphics::PixelFormat format); // overloaded by CE backend
+ virtual void initSize(uint w, uint h, Graphics::PixelFormat *format); // overloaded by CE backend
virtual int getScreenChangeID() const { return _screenChangeCount; }
diff --git a/common/system.h b/common/system.h
index 28947d00c5..4e8be5024c 100644
--- a/common/system.h
+++ b/common/system.h
@@ -401,7 +401,7 @@ public:
* @param height the new virtual screen height
* @param format the new virtual screen pixel format
*/
- virtual void initSize(uint width, uint height, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0;
+ virtual void initSize(uint width, uint height, Graphics::PixelFormat *format = NULL) = 0;
/**
* Return an int value which is changed whenever any screen
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