aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJody Northup2009-06-10 05:35:54 +0000
committerJody Northup2009-06-10 05:35:54 +0000
commit58a348fd18727aab57c0f4f8ab4cc5ad893ee795 (patch)
tree62e2599fe1de7016bfad027fce53acaad78306b1 /engines
parent0a793f08a4d198f3f766214ed4ce85ac51ccea5e (diff)
downloadscummvm-rg350-58a348fd18727aab57c0f4f8ab4cc5ad893ee795.tar.gz
scummvm-rg350-58a348fd18727aab57c0f4f8ab4cc5ad893ee795.tar.bz2
scummvm-rg350-58a348fd18727aab57c0f4f8ab4cc5ad893ee795.zip
Scumm engine now dynamically requests 16-bit color based on game features, (using ad-hoc request format)
svn-id: r41417
Diffstat (limited to 'engines')
-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);
}