diff options
Diffstat (limited to 'engines/engine.cpp')
-rw-r--r-- | engines/engine.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp index 0847e27246..1fd77eb310 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -125,11 +125,16 @@ void initCommonGFX(bool defaultTo1XScaler) { g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen")); } -void initGraphics(int width, int height, bool defaultTo1xScaler) { +void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format) { + g_system->beginGFXTransaction(); initCommonGFX(defaultTo1xScaler); +#ifdef ENABLE_RGB_COLOR + g_system->initSize(width, height, format); +#else g_system->initSize(width, height); +#endif OSystem::TransactionError gfxError = g_system->endGFXTransaction(); @@ -150,6 +155,15 @@ void initGraphics(int width, int height, bool defaultTo1xScaler) { } // Just show warnings then these occur: +#ifdef ENABLE_RGB_COLOR + if (gfxError & OSystem::kTransactionFormatNotSupported) { + Common::String message = "Could not initialize color format."; + + GUI::MessageDialog dialog(message); + dialog.runModal(); + } +#endif + if (gfxError & OSystem::kTransactionModeSwitchFailed) { Common::String message = "Could not switch to video mode: '"; message += ConfMan.get("gfx_mode"); |