aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2011-01-16 16:28:47 +0000
committerSven Hesse2011-01-16 16:28:47 +0000
commite063ced21a4522638b901b343710b83ed7424826 (patch)
tree85514a738e1749cb5d92ec14fd73541d26ae91fc /engines
parent7de179c2c816700629e8e53307ae7c1d995edae0 (diff)
downloadscummvm-rg350-e063ced21a4522638b901b343710b83ed7424826.tar.gz
scummvm-rg350-e063ced21a4522638b901b343710b83ed7424826.tar.bz2
scummvm-rg350-e063ced21a4522638b901b343710b83ed7424826.zip
GOB: Add setTrueColor()
To change ScummVM's color mode on-the-fly svn-id: r55261
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/gob.cpp28
-rw-r--r--engines/gob/gob.h2
2 files changed, 30 insertions, 0 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 8c8d77a9a6..5effa9bd90 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -246,6 +246,34 @@ const Graphics::PixelFormat &GobEngine::getPixelFormat() const {
return _pixelFormat;
}
+void GobEngine::setTrueColor(bool trueColor) {
+ if (isTrueColor() == trueColor)
+ return;
+
+ _features = (_features & ~kFeaturesTrueColor) | (trueColor ? kFeaturesTrueColor : 0);
+
+ _video->setSize(is640x480());
+
+ _pixelFormat = g_system->getScreenFormat();
+
+ Common::Array<SurfacePtr>::iterator surf;
+ for (surf = _draw->_spritesArray.begin(); surf != _draw->_spritesArray.end(); ++surf)
+ if (*surf)
+ (*surf)->setBPP(_pixelFormat.bytesPerPixel);
+
+ if (_draw->_backSurface)
+ _draw->_backSurface->setBPP(_pixelFormat.bytesPerPixel);
+ if (_draw->_frontSurface)
+ _draw->_frontSurface->setBPP(_pixelFormat.bytesPerPixel);
+ if (_draw->_cursorSprites)
+ _draw->_cursorSprites->setBPP(_pixelFormat.bytesPerPixel);
+ if (_draw->_cursorSpritesBack)
+ _draw->_cursorSpritesBack->setBPP(_pixelFormat.bytesPerPixel);
+ if (_draw->_scummvmCursor)
+ _draw->_scummvmCursor->setBPP(_pixelFormat.bytesPerPixel);
+ SurfacePtr _scummvmCursor;
+}
+
Common::Error GobEngine::run() {
if (!initGameParts()) {
GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index fe69e27c01..af0c9d4591 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -231,6 +231,8 @@ public:
bool isTrueColor() const;
bool isDemo() const;
+ void setTrueColor(bool trueColor);
+
GUI::Debugger *getDebugger() { return _console; }
const Graphics::PixelFormat &getPixelFormat() const;