diff options
| -rw-r--r-- | engines/gob/gob.cpp | 59 | ||||
| -rw-r--r-- | engines/gob/gob.h | 4 | ||||
| -rw-r--r-- | engines/gob/video.cpp | 5 | 
3 files changed, 49 insertions, 19 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index e97dce836c..f04fa67bf9 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -230,6 +230,11 @@ bool GobEngine::is800x600() const {  }  bool GobEngine::isTrueColor() const { +	if (_features & kFeaturesTrueColor) { +		warning("TODO: _features & kFeaturesTrueColor"); +		return false; +	} +  	return (_features & kFeaturesTrueColor) != 0;  } @@ -243,8 +248,10 @@ Common::Error GobEngine::run() {  		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 @@ bool GobEngine::initGameParts() {  	_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 @@ void GobEngine::deinitGameParts() {  	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 diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 9b07568223..cfefe62267 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -164,6 +164,8 @@ private:  	bool initGameParts();  	void deinitGameParts(); +	bool initGraphics(); +  public:  	static const Common::Language _gobToScummVMLang[]; @@ -174,6 +176,8 @@ public:  	uint16 _height;  	uint8 _mode; +	Graphics::PixelFormat _pixelFormat; +  	Common::String _startStk;  	Common::String _startTot;  	uint32 _demoIndex; diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index e2c25c3a22..12f470acab 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -257,7 +257,10 @@ void Video::clearScreen() {  }  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) {  | 
