aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/engine.cpp17
-rw-r--r--engines/engine.h2
-rw-r--r--engines/scumm/scumm.cpp9
3 files changed, 12 insertions, 16 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 7ddc286b0f..213f69e7b1 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -126,20 +126,17 @@ void initCommonGFX(bool defaultTo1XScaler) {
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
#ifdef ENABLE_16BIT
- Common::List<Graphics::ColorMode> formatList;
- formatList.push_back(Graphics::kFormatCLUT8);
- initGraphics(width,height,defaultTo1xScaler, formatList);
+ Graphics::PixelFormat format = Graphics::kFormatCLUT8;
+ initGraphics(width,height,defaultTo1xScaler, format);
}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorMode> formatList) {
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
#endif
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
#ifdef ENABLE_16BIT
- Graphics::ColorMode format = g_system->findCompatibleFormat(formatList);
- debug("%X",format); //TODO: set up the pixelFormat here
- g_system->initFormat(g_system->getPixelFormat(format));
+ g_system->initFormat(format);
#endif
g_system->initSize(width, height);
@@ -161,16 +158,16 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Gr
error("%s", message.c_str());
}
+ // Just show warnings then these occur:
#ifdef ENABLE_16BIT
if (gfxError & OSystem::kTransactionPixelFormatNotSupported) {
Common::String message = "Could not initialize color format.";
- GUIErrorMessage(message);
- error("%s", message.c_str());
+ GUI::MessageDialog dialog(message);
+ dialog.runModal();
}
#endif
- // Just show warnings then these occur:
if (gfxError & OSystem::kTransactionModeSwitchFailed) {
Common::String message = "Could not switch to video mode: '";
message += ConfMan.get("gfx_mode");
diff --git a/engines/engine.h b/engines/engine.h
index 87ee70b1b9..1ea1b70b5d 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -63,7 +63,7 @@ void initCommonGFX(bool defaultTo1XScaler);
* mode.
*/
#ifdef ENABLE_16BIT
-void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorMode> formatList);
+void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format);
#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0ebf832a37..5fec6ec835 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1085,11 +1085,10 @@ Common::Error ScummEngine::init() {
(_screenWidth * _textSurfaceMultiplier > 320));
#ifdef ENABLE_16BIT
} else if (_game.features & GF_16BIT_COLOR) {
- int format = Graphics::kFormatRGB555;
- Common::List<Graphics::ColorMode> formatList;
- formatList.push_back((Graphics::ColorMode) format);
- formatList.push_back(Graphics::kFormatCLUT8);
- initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList);
+ Graphics::PixelFormat format = Graphics::kFormatRGB555;
+ initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
+ if (format != _system->getScreenFormat())
+ return Common::kUnsupportedColorMode;
#endif
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);