aboutsummaryrefslogtreecommitdiff
path: root/engines/engine.cpp
diff options
context:
space:
mode:
authorJody Northup2009-08-21 09:37:51 +0000
committerJody Northup2009-08-21 09:37:51 +0000
commit3084919b32771d43d17fdd5d584505cd31d20b72 (patch)
tree3f42b5e0cb69f340ccd30fad96f6ee4e51e260cf /engines/engine.cpp
parentcba2897cc8f7b70d27fc75ca8b8d55cde4738e4a (diff)
parent89d7fea4e619cd44d5ce16eee1e46ad417e26c9c (diff)
downloadscummvm-rg350-3084919b32771d43d17fdd5d584505cd31d20b72.tar.gz
scummvm-rg350-3084919b32771d43d17fdd5d584505cd31d20b72.tar.bz2
scummvm-rg350-3084919b32771d43d17fdd5d584505cd31d20b72.zip
Merged RGB color API and support in from /scummvm/branches/gsoc2009-16bit/
svn-id: r43577
Diffstat (limited to 'engines/engine.cpp')
-rw-r--r--engines/engine.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 0847e27246..eb46add82f 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 ENABLE_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 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");
@@ -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");