aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/engine.cpp14
-rw-r--r--engines/engine.h6
-rw-r--r--engines/scumm/scumm.cpp6
3 files changed, 25 insertions, 1 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 269bb0bc28..4be4fe90be 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -124,11 +124,23 @@ void initCommonGFX(bool defaultTo1XScaler) {
if (gameDomain && gameDomain->contains("fullscreen"))
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
}
-
void initGraphics(int width, int height, bool defaultTo1xScaler) {
+#ifdef ENABLE_16BIT
+ Common::List<Graphics::ColorFormat> formatList;
+ formatList.push_back(Graphics::kFormat8Bit);
+ initGraphics(width,height,defaultTo1xScaler, formatList);
+}
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorFormat> formatList) {
+#endif
+
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
+#ifdef ENABLE_16BIT
+ Graphics::ColorFormat format = g_system->findCompatibleFormat(formatList);
+ debug("%X",format); //TODO: set up the pixelFormat here
+ g_system->initFormat(format);
+#endif
g_system->initSize(width, height);
OSystem::TransactionError gfxError = g_system->endGFXTransaction();
diff --git a/engines/engine.h b/engines/engine.h
index 45477f408d..8538cc779f 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -29,6 +29,9 @@
#include "common/error.h"
#include "common/fs.h"
#include "common/str.h"
+#ifdef ENABLE_16BIT
+#include "graphics/pixelformat.h"
+#endif
class OSystem;
@@ -59,6 +62,9 @@ void initCommonGFX(bool defaultTo1XScaler);
* Errors out when backend is not able to switch to the specified
* mode.
*/
+#ifdef ENABLE_16BIT
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorFormat> formatList);
+#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
/**
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0599139778..3d0a2d0bc2 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1083,6 +1083,12 @@ Common::Error ScummEngine::init() {
// CJK FT and DIG use usual NUT fonts, not FM-TOWNS ROM, so
// there is no text surface for them. This takes that into account
(_screenWidth * _textSurfaceMultiplier > 320));
+ } else if (_game.features & GF_16BIT_COLOR) {
+ int format = Graphics::kFormatRGB555 | Graphics::kFormatRGB;
+ Common::List<Graphics::ColorFormat> formatList;
+ formatList.push_back((Graphics::ColorFormat) format);
+ formatList.push_back(Graphics::kFormat8Bit);
+ initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList);
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
}