[Scummvm-cvs-logs] SF.net SVN: scummvm:[55261] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Jan 16 17:28:47 CET 2011


Revision: 55261
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55261&view=rev
Author:   drmccoy
Date:     2011-01-16 16:28:47 +0000 (Sun, 16 Jan 2011)

Log Message:
-----------
GOB: Add setTrueColor()

To change ScummVM's color mode on-the-fly

Modified Paths:
--------------
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/gob.h

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2011-01-16 16:28:17 UTC (rev 55260)
+++ scummvm/trunk/engines/gob/gob.cpp	2011-01-16 16:28:47 UTC (rev 55261)
@@ -246,6 +246,34 @@
 	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");

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2011-01-16 16:28:17 UTC (rev 55260)
+++ scummvm/trunk/engines/gob/gob.h	2011-01-16 16:28:47 UTC (rev 55261)
@@ -231,6 +231,8 @@
 	bool isTrueColor() const;
 	bool isDemo() const;
 
+	void setTrueColor(bool trueColor);
+
 	GUI::Debugger *getDebugger() { return _console; }
 
 	const Graphics::PixelFormat &getPixelFormat() const;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list