diff options
| -rw-r--r-- | engines/gargoyle/gargoyle.cpp | 18 | ||||
| -rw-r--r-- | engines/gargoyle/gargoyle.h | 5 | 
2 files changed, 22 insertions, 1 deletions
diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp index 3135fcb5fe..1a817c605d 100644 --- a/engines/gargoyle/gargoyle.cpp +++ b/engines/gargoyle/gargoyle.cpp @@ -68,7 +68,7 @@ void GargoyleEngine::initialize() {  	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");  	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling"); -	initGraphics(640, 480, false); +	initGraphicsMode();  	_conf = new Conf();  	_screen = new Screen(); @@ -80,6 +80,22 @@ void GargoyleEngine::initialize() {  	_windowMask = new WindowMask();  } +void GargoyleEngine::initGraphicsMode() { +	uint width = ConfMan.hasKey("width") ? ConfMan.getInt("width") : 640; +	uint height = ConfMan.hasKey("height") ? ConfMan.getInt("height") : 480; +	Common::List<Graphics::PixelFormat> formats = g_system->getSupportedFormats(); +	Graphics::PixelFormat format = formats.front(); + +	for (Common::List<Graphics::PixelFormat>::iterator i = formats.begin(); i != formats.end(); ++i) { +		if ((*i).bytesPerPixel > 1) { +			format = *i; +			break; +		} +	} + +	initGraphics(width, height, &format); +} +  Common::Error GargoyleEngine::run() {  	initialize(); diff --git a/engines/gargoyle/gargoyle.h b/engines/gargoyle/gargoyle.h index 0b8bca7856..728dc0fae3 100644 --- a/engines/gargoyle/gargoyle.h +++ b/engines/gargoyle/gargoyle.h @@ -81,6 +81,11 @@ private:  	 * Handles basic initialization  	 */  	void initialize(); + +	/** +	 * Setup the video mode +	 */ +	void initGraphicsMode();  protected:  	const GargoyleGameDescription *_gameDescription;  	Common::RandomSource _random;  | 
