diff options
author | Jody Northup | 2009-06-27 05:58:44 +0000 |
---|---|---|
committer | Jody Northup | 2009-06-27 05:58:44 +0000 |
commit | 853aec05ba4485f0bfc90e7515322dfd56a8d4af (patch) | |
tree | d088498595ba59e32df821d2f4b96602e7c91779 /backends/platform/sdl | |
parent | fe65f6163c88b77a5997d47eff842b78812085be (diff) | |
download | scummvm-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 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 13 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 2 |
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; } |