aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJody Northup2009-06-11 05:56:00 +0000
committerJody Northup2009-06-11 05:56:00 +0000
commit6adbd0c41e79b5a21f0430e060347d4978e9ce78 (patch)
treee8d99c06d597b74a64b7d1590885c13db2f03010 /engines
parentb4c44a018b636a9805c725f9a286e58be554afc2 (diff)
downloadscummvm-rg350-6adbd0c41e79b5a21f0430e060347d4978e9ce78.tar.gz
scummvm-rg350-6adbd0c41e79b5a21f0430e060347d4978e9ce78.tar.bz2
scummvm-rg350-6adbd0c41e79b5a21f0430e060347d4978e9ce78.zip
Renamed Graphics::ColorFormat to Graphics::ColorMode, streamlined enum by removing order section and temporarily removing kFormatARGB1555
Converted cursor code to make use of _screenFormat, instead of a parameter passed directly to it by the engine. Adjusted scumm engine to account for these changes. This should probably have been two separate commits, but the changes concern the same files... svn-id: r41443
Diffstat (limited to 'engines')
-rw-r--r--engines/engine.cpp17
-rw-r--r--engines/engine.h2
-rw-r--r--engines/scumm/cursor.cpp19
-rw-r--r--engines/scumm/scumm.cpp10
4 files changed, 24 insertions, 24 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 4be4fe90be..31ead2df1a 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -126,18 +126,18 @@ void initCommonGFX(bool defaultTo1XScaler) {
}
void initGraphics(int width, int height, bool defaultTo1xScaler) {
#ifdef ENABLE_16BIT
- Common::List<Graphics::ColorFormat> formatList;
- formatList.push_back(Graphics::kFormat8Bit);
+ Common::List<Graphics::ColorMode> formatList;
+ formatList.push_back(Graphics::kFormatCLUT8);
initGraphics(width,height,defaultTo1xScaler, formatList);
}
-void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorFormat> formatList) {
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorMode> formatList) {
#endif
g_system->beginGFXTransaction();
initCommonGFX(defaultTo1xScaler);
#ifdef ENABLE_16BIT
- Graphics::ColorFormat format = g_system->findCompatibleFormat(formatList);
+ Graphics::ColorMode format = g_system->findCompatibleFormat(formatList);
debug("%X",format); //TODO: set up the pixelFormat here
g_system->initFormat(format);
#endif
@@ -161,6 +161,15 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Gr
error("%s", message.c_str());
}
+#ifdef ENABLE_16BIT
+ if (gfxError & OSystem::kTransactionPixelFormatNotSupported) {
+ Common::String message = "Could not initialize color format.";
+
+ GUIErrorMessage(message);
+ error("%s", message.c_str());
+ }
+#endif
+
// Just show warnings then these occur:
if (gfxError & OSystem::kTransactionModeSwitchFailed) {
Common::String message = "Could not switch to video mode: '";
diff --git a/engines/engine.h b/engines/engine.h
index 8538cc779f..87ee70b1b9 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::ColorFormat> formatList);
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorMode> formatList);
#endif
void initGraphics(int width, int height, bool defaultTo1xScaler);
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index bc4a2e0d33..fcde07cbdf 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,21 +112,10 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
- if (_game.features & GF_16BIT_COLOR) {
- //HACK Had to make a second method to avoid many, many linker errors from other engines
- //this requires ENABLE_16BIT to be defined in the Scumm project, again, because I #ifdef'ed
- //the method's definition and declaration in cursorman.h
- CursorMan.replaceCursorReal(_grabbedCursor, _cursor.width, _cursor.height,
- _cursor.hotspotX, _cursor.hotspotY,
- (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1),
- 16);
- } else {
- CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
- _cursor.hotspotX, _cursor.hotspotY,
- (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1));
- }
+ CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
+ _cursor.hotspotX, _cursor.hotspotY,
+ (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+ (_game.heversion == 70 ? 2 : 1));
}
void ScummEngine_v6::grabCursor(int x, int y, int w, int h) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 3d0a2d0bc2..0ebf832a37 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1083,12 +1083,14 @@ 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));
+#ifdef ENABLE_16BIT
} 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);
+ 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);
+#endif
} else {
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
}