aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJody Northup2009-06-23 02:02:51 +0000
committerJody Northup2009-06-23 02:02:51 +0000
commit7c622423157e29b7206ba0c39a7756443ed1e70d (patch)
treed83c24ec9d14669996f2b1db824f37d827083510 /backends
parenta937dfde96b35738b916e4299cc4e917fc6d2d9e (diff)
downloadscummvm-rg350-7c622423157e29b7206ba0c39a7756443ed1e70d.tar.gz
scummvm-rg350-7c622423157e29b7206ba0c39a7756443ed1e70d.tar.bz2
scummvm-rg350-7c622423157e29b7206ba0c39a7756443ed1e70d.zip
Merged format initialization into InitSize to allow for backends not supporting gfx transactions.
svn-id: r41801
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/sdl/graphics.cpp21
-rw-r--r--backends/platform/sdl/sdl.h10
2 files changed, 13 insertions, 18 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index a08239d472..b5ec9b9db8 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -353,23 +353,22 @@ int OSystem_SDL::getGraphicsMode() const {
assert (_transactionMode == kTransactionNone);
return _videoMode.mode;
}
-#ifdef ENABLE_RGB_COLOR
-void OSystem_SDL::initFormat(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
- if (format == _videoMode.format)
- return;
+ assert(format.bytesPerPixel > 0);
- _videoMode.format = format;
- _transactionDetails.formatChanged = true;
- _screenFormat = format;
-}
+ if (format != _videoMode.format)
+ {
+ _videoMode.format = format;
+ _transactionDetails.formatChanged = true;
+ _screenFormat = format;
+ }
#endif
-void OSystem_SDL::initSize(uint w, uint h) {
- assert(_transactionMode == kTransactionActive);
-
// Avoid redundant res changes
if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
return;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index aee15fcbd0..db855094cb 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -82,10 +82,6 @@ public:
TransactionError endGFXTransaction(void);
#ifdef ENABLE_RGB_COLOR
- // Set the depth and format of the video bitmap
- // Typically, CLUT8
- virtual void initFormat(Graphics::PixelFormat format);
-
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
@@ -108,9 +104,9 @@ public:
}
#endif
- // Set the size of the video bitmap.
- // Typically, 320x200
- virtual void initSize(uint w, uint h); // overloaded by CE backend
+ // 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 int getScreenChangeID() const { return _screenChangeCount; }