aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-09-06 20:52:15 -0400
committerPaul Gilbert2015-09-06 20:52:15 -0400
commite0ad8a9ef56095df91273b1d27c6511d702546fd (patch)
tree53edcac9fb63d46196a9947052ae05ba66a82517
parent735bd2c3f7ddce6eefa4dacf396df1180e93373e (diff)
downloadscummvm-rg350-e0ad8a9ef56095df91273b1d27c6511d702546fd.tar.gz
scummvm-rg350-e0ad8a9ef56095df91273b1d27c6511d702546fd.tar.bz2
scummvm-rg350-e0ad8a9ef56095df91273b1d27c6511d702546fd.zip
SHERLOCK: 3DO: Set up RGB color constants for 3DO
-rw-r--r--engines/sherlock/scalpel/scalpel.cpp59
-rw-r--r--engines/sherlock/scalpel/scalpel.h30
-rw-r--r--engines/sherlock/scalpel/scalpel_screen.cpp2
-rw-r--r--engines/sherlock/scalpel/scalpel_screen.h2
-rw-r--r--engines/sherlock/screen.cpp6
-rw-r--r--engines/sherlock/screen.h20
-rw-r--r--engines/sherlock/surface.cpp6
-rw-r--r--engines/sherlock/surface.h6
8 files changed, 93 insertions, 38 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index c3915a1cf2..d1dad93b1a 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -174,12 +174,71 @@ const PeopleData PEOPLE_DATA[MAX_PEOPLE] = {
{ "INSP", "Inspector Lestrade", { 4, 0, 0 }, { 2, 0, 0 } }
};
+uint INFO_BLACK;
+uint BORDER_COLOR;
+uint COMMAND_BACKGROUND;
+uint BUTTON_BACKGROUND;
+uint TALK_FOREGROUND;
+uint TALK_NULL;
+uint BUTTON_TOP;
+uint BUTTON_MIDDLE;
+uint BUTTON_BOTTOM;
+uint COMMAND_FOREGROUND;
+uint COMMAND_HIGHLIGHTED;
+uint COMMAND_NULL;
+uint INFO_FOREGROUND;
+uint INFO_BACKGROUND;
+uint INV_FOREGROUND;
+uint INV_BACKGROUND;
+uint PEN_COLOR;
+
/*----------------------------------------------------------------*/
+#define FROM_RGB(r, g, b) pixelFormatRGB565.ARGBToColor(0, r, g, b)
+
ScalpelEngine::ScalpelEngine(OSystem *syst, const SherlockGameDescription *gameDesc) :
SherlockEngine(syst, gameDesc) {
_darts = nullptr;
_mapResult = 0;
+
+ if (getPlatform() == Common::kPlatform3DO) {
+ const Graphics::PixelFormat pixelFormatRGB565 = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+ INFO_BLACK = FROM_RGB(0, 0, 0x48);
+ BORDER_COLOR = FROM_RGB(0x6d, 0x38, 0x10);
+ COMMAND_BACKGROUND = FROM_RGB(0x38, 0x38, 0xce);
+ BUTTON_BACKGROUND = FROM_RGB(0x95, 0x5d, 0x24);
+ TALK_FOREGROUND = FROM_RGB(0xff, 0x55, 0x55);
+ TALK_NULL = FROM_RGB(0xce, 0xc6, 0xc2);
+ BUTTON_TOP = FROM_RGB(0xbe, 0x85, 0x3c);
+ BUTTON_MIDDLE = FROM_RGB(0x9d, 0x40, 0);
+ BUTTON_BOTTOM = FROM_RGB(0x69, 0x24, 0);
+ COMMAND_FOREGROUND = FROM_RGB(0xFF, 0xFF, 0xFF);
+ COMMAND_HIGHLIGHTED = FROM_RGB(0x55, 0xff, 0x55);
+ COMMAND_NULL = FROM_RGB(0x69, 0x24, 0);
+ INFO_FOREGROUND = FROM_RGB(0x55, 0xff, 0xff);
+ INFO_BACKGROUND = FROM_RGB(0, 0, 0x48);
+ INV_FOREGROUND = FROM_RGB(0xff, 0xff, 0x55);
+ INV_BACKGROUND = FROM_RGB(0, 0, 0x48);
+ PEN_COLOR = FROM_RGB(0x50, 0x18, 0);
+ } else {
+ INFO_BLACK = 1;
+ BORDER_COLOR = 237;
+ COMMAND_BACKGROUND = 4;
+ BUTTON_BACKGROUND = 235;
+ TALK_FOREGROUND = 12;
+ TALK_NULL = 16;
+ BUTTON_TOP = 233;
+ BUTTON_MIDDLE = 244;
+ BUTTON_BOTTOM = 248;
+ COMMAND_FOREGROUND = 15;
+ COMMAND_HIGHLIGHTED = 10;
+ COMMAND_NULL = 248;
+ INFO_FOREGROUND = 11;
+ INFO_BACKGROUND = 1;
+ INV_FOREGROUND = 14;
+ INV_BACKGROUND = 1;
+ PEN_COLOR = 250;
+ }
}
ScalpelEngine::~ScalpelEngine() {
diff --git a/engines/sherlock/scalpel/scalpel.h b/engines/sherlock/scalpel/scalpel.h
index cb1cb20492..6ae8563e61 100644
--- a/engines/sherlock/scalpel/scalpel.h
+++ b/engines/sherlock/scalpel/scalpel.h
@@ -30,19 +30,23 @@ namespace Sherlock {
namespace Scalpel {
-enum {
- BUTTON_TOP = 233,
- BUTTON_MIDDLE = 244,
- BUTTON_BOTTOM = 248,
- COMMAND_FOREGROUND = 15,
- COMMAND_HIGHLIGHTED = 10,
- COMMAND_NULL = 248,
- INFO_FOREGROUND = 11,
- INFO_BACKGROUND = 1,
- INV_FOREGROUND = 14,
- INV_BACKGROUND = 1,
- PEN_COLOR = 250
-};
+extern uint BUTTON_TOP;
+extern uint BUTTON_MIDDLE;
+extern uint BUTTON_BOTTOM;
+extern uint COMMAND_FOREGROUND;
+extern uint COMMAND_HIGHLIGHTED;
+extern uint COMMAND_NULL;
+extern uint INFO_FOREGROUND;
+extern uint INFO_BACKGROUND;
+extern uint INV_FOREGROUND;
+extern uint INV_BACKGROUND;
+extern uint PEN_COLOR;
+extern uint INFO_BLACK;
+extern uint BORDER_COLOR;
+extern uint COMMAND_BACKGROUND;
+extern uint BUTTON_BACKGROUND;
+extern uint TALK_FOREGROUND;
+extern uint TALK_NULL;
class ScalpelEngine : public SherlockEngine {
private:
diff --git a/engines/sherlock/scalpel/scalpel_screen.cpp b/engines/sherlock/scalpel/scalpel_screen.cpp
index 2096dabcdf..44113b2a5d 100644
--- a/engines/sherlock/scalpel/scalpel_screen.cpp
+++ b/engines/sherlock/scalpel/scalpel_screen.cpp
@@ -45,7 +45,7 @@ void ScalpelScreen::makeButton(const Common::Rect &bounds, int textX,
COMMAND_FOREGROUND, "%s", str.c_str() + 1);
}
-void ScalpelScreen::buttonPrint(const Common::Point &pt, byte color, bool slamIt,
+void ScalpelScreen::buttonPrint(const Common::Point &pt, uint color, bool slamIt,
const Common::String &str) {
int xStart = pt.x - stringWidth(str) / 2;
diff --git a/engines/sherlock/scalpel/scalpel_screen.h b/engines/sherlock/scalpel/scalpel_screen.h
index 472fe9e220..0277bcd16f 100644
--- a/engines/sherlock/scalpel/scalpel_screen.h
+++ b/engines/sherlock/scalpel/scalpel_screen.h
@@ -45,7 +45,7 @@ public:
* Prints an interface command with the first letter highlighted to indicate
* what keyboard shortcut is associated with it
*/
- void buttonPrint(const Common::Point &pt, byte color, bool slamIt, const Common::String &str);
+ void buttonPrint(const Common::Point &pt, uint color, bool slamIt, const Common::String &str);
/**
* Draw a panel in the back buffer with a raised area effect around the edges
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index 4233bca0cb..a5241524ef 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -460,7 +460,7 @@ void Screen::blockMove() {
blockMove(Common::Rect(0, 0, w(), h()));
}
-void Screen::print(const Common::Point &pt, byte color, const char *formatStr, ...) {
+void Screen::print(const Common::Point &pt, uint color, const char *formatStr, ...) {
// Create the string to display
va_list args;
va_start(args, formatStr);
@@ -488,7 +488,7 @@ void Screen::print(const Common::Point &pt, byte color, const char *formatStr, .
slamRect(textBounds);
}
-void Screen::gPrint(const Common::Point &pt, byte color, const char *formatStr, ...) {
+void Screen::gPrint(const Common::Point &pt, uint color, const char *formatStr, ...) {
// Create the string to display
va_list args;
va_start(args, formatStr);
@@ -499,7 +499,7 @@ void Screen::gPrint(const Common::Point &pt, byte color, const char *formatStr,
writeString(str, pt, color);
}
-void Screen::writeString(const Common::String &str, const Common::Point &pt, byte overrideColor) {
+void Screen::writeString(const Common::String &str, const Common::Point &pt, uint overrideColor) {
Fonts::writeString(_backBuffer, str, pt, overrideColor);
}
diff --git a/engines/sherlock/screen.h b/engines/sherlock/screen.h
index 2e0cef72ca..43e6ea883f 100644
--- a/engines/sherlock/screen.h
+++ b/engines/sherlock/screen.h
@@ -35,22 +35,12 @@ namespace Sherlock {
#define PALETTE_COUNT 256
#define VGA_COLOR_TRANS(x) ((x) * 255 / 63)
#define BG_GREYSCALE_RANGE_END 229
-
-enum {
- BLACK = 0,
- INFO_BLACK = 1,
- BORDER_COLOR = 237,
- COMMAND_BACKGROUND = 4,
- BUTTON_BACKGROUND = 235,
- TALK_FOREGROUND = 12,
- TALK_NULL = 16
-};
+#define BLACK 0
class SherlockEngine;
class Screen : public Surface {
private:
- SherlockEngine *_vm;
Common::List<Common::Rect> _dirtyRects;
uint32 _transitionSeed;
Surface _sceneSurface;
@@ -69,6 +59,8 @@ private:
*/
bool unionRectangle(Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2);
protected:
+ SherlockEngine *_vm;
+
/**
* Adds a rectangle to the list of modified areas of the screen during the
* current frame
@@ -144,12 +136,12 @@ public:
* Prints the text passed onto the back buffer at the given position and color.
* The string is then blitted to the screen
*/
- void print(const Common::Point &pt, byte color, const char *formatStr, ...) GCC_PRINTF(4, 5);
+ void print(const Common::Point &pt, uint color, const char *formatStr, ...) GCC_PRINTF(4, 5);
/**
* Print a strings onto the back buffer without blitting it to the screen
*/
- void gPrint(const Common::Point &pt, byte color, const char *formatStr, ...) GCC_PRINTF(4, 5);
+ void gPrint(const Common::Point &pt, uint color, const char *formatStr, ...) GCC_PRINTF(4, 5);
/**
* Copies a section of the second back buffer into the main back buffer
@@ -223,7 +215,7 @@ public:
/**
* Draws the given string into the back buffer using the images stored in _font
*/
- virtual void writeString(const Common::String &str, const Common::Point &pt, byte overrideColor);
+ virtual void writeString(const Common::String &str, const Common::Point &pt, uint overrideColor);
// Rose Tattoo specific methods
diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp
index b56692c704..b8ceae25cb 100644
--- a/engines/sherlock/surface.cpp
+++ b/engines/sherlock/surface.cpp
@@ -201,16 +201,16 @@ void Surface::transBlitFromUnscaled(const Graphics::Surface &src, const Common::
}
}
-void Surface::fillRect(int x1, int y1, int x2, int y2, byte color) {
+void Surface::fillRect(int x1, int y1, int x2, int y2, uint color) {
fillRect(Common::Rect(x1, y1, x2, y2), color);
}
-void Surface::fillRect(const Common::Rect &r, byte color) {
+void Surface::fillRect(const Common::Rect &r, uint color) {
_surface.fillRect(r, color);
addDirtyRect(r);
}
-void Surface::fill(uint16 color) {
+void Surface::fill(uint color) {
_surface.fillRect(Common::Rect(_surface.w, _surface.h), color);
}
diff --git a/engines/sherlock/surface.h b/engines/sherlock/surface.h
index 385fb1793e..97424a1ed4 100644
--- a/engines/sherlock/surface.h
+++ b/engines/sherlock/surface.h
@@ -133,14 +133,14 @@ public:
/**
* Fill a given area of the surface with a given color
*/
- void fillRect(int x1, int y1, int x2, int y2, byte color);
+ void fillRect(int x1, int y1, int x2, int y2, uint color);
/**
* Fill a given area of the surface with a given color
*/
- void fillRect(const Common::Rect &r, byte color);
+ void fillRect(const Common::Rect &r, uint color);
- void fill(uint16 color);
+ void fill(uint color);
/**
* Clear the surface