diff options
author | Norbert Lange | 2009-08-24 17:51:47 +0000 |
---|---|---|
committer | Norbert Lange | 2009-08-24 17:51:47 +0000 |
commit | 917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5 (patch) | |
tree | e652563203a00f8acecfaafbf93c64dbfbd13f25 /engines/engine.cpp | |
parent | 5f87d5090cfcb34cda3c1f5d430e0865344d7366 (diff) | |
parent | dd7868acc2512c9761d892e67a4837f4dc38bdc0 (diff) | |
download | scummvm-rg350-917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5.tar.gz scummvm-rg350-917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5.tar.bz2 scummvm-rg350-917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5.zip |
Merge with trunk
svn-id: r43701
Diffstat (limited to 'engines/engine.cpp')
-rw-r--r-- | engines/engine.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp index 0847e27246..a64a2fd1f3 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -125,11 +125,21 @@ 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 USE_RGB_COLOR + if (format) + g_system->initSize(width, height, format); + else { + Graphics::PixelFormat Format = g_system->getSupportedFormats().front(); + g_system->initSize(width, height, &Format); + } +#else g_system->initSize(width, height); +#endif OSystem::TransactionError gfxError = g_system->endGFXTransaction(); @@ -150,6 +160,15 @@ void initGraphics(int width, int height, bool defaultTo1xScaler) { } // Just show warnings then these occur: +#ifdef USE_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"); @@ -169,6 +188,14 @@ void initGraphics(int width, int height, bool defaultTo1xScaler) { dialog.runModal(); } } +void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList) { + Graphics::PixelFormat format = Graphics::findCompatibleFormat(g_system->getSupportedFormats(),formatList); + initGraphics(width,height,defaultTo1xScaler,&format); +} +void initGraphics(int width, int height, bool defaultTo1xScaler) { + Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8(); + initGraphics(width,height,defaultTo1xScaler,&format); +} void GUIErrorMessage(const Common::String msg) { g_system->setWindowCaption("Error"); |