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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Sep 30 14:59:49 CEST 2010


Revision: 52944
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52944&view=rev
Author:   drmccoy
Date:     2010-09-30 12:59:48 +0000 (Thu, 30 Sep 2010)

Log Message:
-----------
GOB: Stub setting up of 16bpp graphics

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

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2010-09-30 12:59:18 UTC (rev 52943)
+++ scummvm/trunk/engines/gob/gob.cpp	2010-09-30 12:59:48 UTC (rev 52944)
@@ -230,6 +230,11 @@
 }
 
 bool GobEngine::isTrueColor() const {
+	if (_features & kFeaturesTrueColor) {
+		warning("TODO: _features & kFeaturesTrueColor");
+		return false;
+	}
+
 	return (_features & kFeaturesTrueColor) != 0;
 }
 
@@ -243,8 +248,10 @@
 		return Common::kUnknownError;
 	}
 
-	_video->setSize(is640x480());
-	_video->init();
+	if (!initGraphics()) {
+		GUIErrorMessage("GobEngine::init(): Failed to set up graphics");
+		return Common::kUnknownError;
+	}
 
 	// On some systems it's not safe to run CD audio games from the CD.
 	if (isCD())
@@ -522,22 +529,6 @@
 
 	_inter->setupOpcodes();
 
-	if (is640x480()) {
-		_video->_surfWidth = _width = 640;
-		_video->_surfHeight = _video->_splitHeight1 = _height = 480;
-		_global->_mouseMaxX = 640;
-		_global->_mouseMaxY = 480;
-		_mode = 0x18;
-		_global->_primarySurfDesc = SurfaceDescPtr(new SurfaceDesc(0x18, 640, 480));
-	} else {
-		_video->_surfWidth = _width = 320;
-		_video->_surfHeight = _video->_splitHeight1 = _height = 200;
-		_global->_mouseMaxX = 320;
-		_global->_mouseMaxY = 200;
-		_mode = 0x14;
-		_global->_primarySurfDesc = SurfaceDescPtr(new SurfaceDesc(0x14, 320, 200));
-	}
-
 	return true;
 }
 
@@ -560,4 +551,36 @@
 	delete _dataIO;    _dataIO = 0;
 }
 
+bool GobEngine::initGraphics() {
+	if        (is800x600()) {
+		warning("GobEngine::initGraphics(): 800x600 games currently unsupported");
+		return false;
+	} else if (is640x480()) {
+		_width  = 640;
+		_height = 480;
+		_mode   = 0x18;
+	} else {
+		_width  = 320;
+		_height = 200;
+		_mode   = 0x14;
+	}
+
+	_video->setSize(is640x480());
+
+	_pixelFormat = g_system->getScreenFormat();
+
+	_video->_surfWidth    = _width;
+	_video->_surfHeight   = _height;
+	_video->_splitHeight1 = _height;
+
+	_global->_mouseMaxX = _width;
+	_global->_mouseMaxY = _height;
+
+	_global->_primarySurfDesc = SurfaceDescPtr(new SurfaceDesc(_mode, _width, _height));
+
+	_video->init();
+
+	return true;
+}
+
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2010-09-30 12:59:18 UTC (rev 52943)
+++ scummvm/trunk/engines/gob/gob.h	2010-09-30 12:59:48 UTC (rev 52944)
@@ -164,6 +164,8 @@
 	bool initGameParts();
 	void deinitGameParts();
 
+	bool initGraphics();
+
 public:
 	static const Common::Language _gobToScummVMLang[];
 
@@ -174,6 +176,8 @@
 	uint16 _height;
 	uint8 _mode;
 
+	Graphics::PixelFormat _pixelFormat;
+
 	Common::String _startStk;
 	Common::String _startTot;
 	uint32 _demoIndex;

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2010-09-30 12:59:18 UTC (rev 52943)
+++ scummvm/trunk/engines/gob/video.cpp	2010-09-30 12:59:48 UTC (rev 52944)
@@ -257,7 +257,10 @@
 }
 
 void Video::setSize(bool defaultTo1XScaler) {
-	initGraphics(_vm->_width, _vm->_height, defaultTo1XScaler);
+	if (_vm->isTrueColor())
+		initGraphics(_vm->_width, _vm->_height, defaultTo1XScaler, 0);
+	else
+		initGraphics(_vm->_width, _vm->_height, defaultTo1XScaler);
 }
 
 void Video::retrace(bool mouse) {


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