aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/graphics.cpp13
-rw-r--r--backends/platform/sdl/sdl.h2
2 files changed, 9 insertions, 6 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; }