diff options
author | Paul Gilbert | 2018-11-08 18:48:29 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | 596a36aef02e3bdd41f15c1b2f142acbd49f50f0 (patch) | |
tree | 6c0801771fc0928fa45b32de2fc94ec62336718f /engines | |
parent | 88315e7349a011d8168dc3e4c562f40e6e51c1c1 (diff) | |
download | scummvm-rg350-596a36aef02e3bdd41f15c1b2f142acbd49f50f0.tar.gz scummvm-rg350-596a36aef02e3bdd41f15c1b2f142acbd49f50f0.tar.bz2 scummvm-rg350-596a36aef02e3bdd41f15c1b2f142acbd49f50f0.zip |
GLK: Allow video mode to be specified in the configuration
Diffstat (limited to 'engines')
-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; |