Skip to content

Commit

Permalink
SHERLOCK: RT: Set up new values for color constants
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 26, 2015
1 parent 6d35a54 commit 9bbeaa6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 29 deletions.
18 changes: 10 additions & 8 deletions engines/sherlock/journal.cpp
Expand Up @@ -21,8 +21,9 @@
*/

#include "sherlock/journal.h"
#include "sherlock/sherlock.h"
#include "sherlock/scalpel/scalpel.h"
#include "sherlock/scalpel/scalpel_journal.h"
#include "sherlock/tattoo/tattoo.h"
#include "sherlock/tattoo/tattoo_journal.h"

namespace Sherlock {
Expand Down Expand Up @@ -78,7 +79,7 @@ bool Journal::drawJournal(int direction, int howFar) {
if (direction)
drawFrame();

screen.gPrint(Common::Point(235, 21), PEN_COLOR, "Page %d", _page);
screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, "Page %d", _page);
return false;
}

Expand Down Expand Up @@ -198,7 +199,7 @@ bool Journal::drawJournal(int direction, int howFar) {

Common::String fixedText_Page = fixedText.getText(kFixedText_Journal_Page);

screen.gPrint(Common::Point(235, 21), PEN_COLOR, fixedText_Page.c_str(), _page);
screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, fixedText_Page.c_str(), _page);

temp = _sub;
savedIndex = _index;
Expand Down Expand Up @@ -228,26 +229,27 @@ bool Journal::drawJournal(int direction, int howFar) {
screen.gPrint(Common::Point(53, yp), 15, "%s", lineStart.c_str() + 1);
} else {
width = screen.stringWidth(lineStart.c_str());
screen.gPrint(Common::Point(53, yp), PEN_COLOR, "%s", lineStart.c_str());
screen.gPrint(Common::Point(53, yp), COL_PEN_COLOR, "%s", lineStart.c_str());
}

// Print out the found keyword
Common::String lineMatch(matchP, matchP + _find.size());
screen.gPrint(Common::Point(53 + width, yp), INV_FOREGROUND, "%s", lineMatch.c_str());
byte fgColor = IS_SERRATED_SCALPEL ? Scalpel::INV_FOREGROUND : Tattoo::INV_FOREGROUND;
screen.gPrint(Common::Point(53 + width, yp), fgColor, "%s", lineMatch.c_str());
width += screen.stringWidth(lineMatch.c_str());

// Print remainder of line
screen.gPrint(Common::Point(53 + width, yp), PEN_COLOR, "%s", matchP + _find.size());
screen.gPrint(Common::Point(53 + width, yp), COL_PEN_COLOR, "%s", matchP + _find.size());
} else if (_lines[temp].hasPrefix("@")) {
screen.gPrint(Common::Point(53, yp), 15, "%s", _lines[temp].c_str() + 1);
} else {
screen.gPrint(Common::Point(53, yp), PEN_COLOR, "%s", _lines[temp].c_str());
screen.gPrint(Common::Point(53, yp), COL_PEN_COLOR, "%s", _lines[temp].c_str());
}
} else {
if (_lines[temp].hasPrefix("@")) {
screen.gPrint(Common::Point(53, yp), 15, "%s", _lines[temp].c_str() + 1);
} else {
screen.gPrint(Common::Point(53, yp), PEN_COLOR, "%s", _lines[temp].c_str());
screen.gPrint(Common::Point(53, yp), COL_PEN_COLOR, "%s", _lines[temp].c_str());
}
}

Expand Down
11 changes: 6 additions & 5 deletions engines/sherlock/objects.cpp
Expand Up @@ -21,12 +21,13 @@
*/

#include "common/util.h"
#include "sherlock/sherlock.h"
#include "sherlock/objects.h"
#include "sherlock/people.h"
#include "sherlock/scene.h"
#include "sherlock/scalpel/scalpel.h"
#include "sherlock/scalpel/scalpel_map.h"
#include "sherlock/scalpel/scalpel_people.h"
#include "sherlock/tattoo/tattoo.h"

namespace Sherlock {

Expand Down Expand Up @@ -546,13 +547,13 @@ int BaseObject::checkNameForCodes(const Common::String &name, FixedTextActionId
ui._infoFlag = true;
ui.clearInfo();
Common::String errorMessage = fixedText.getActionMessage(fixedTextActionId, messageNum);
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", errorMessage.c_str());
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "%s", errorMessage.c_str());
ui._menuCounter = 25;
} else if (name.hasPrefix("@")) {
// Message attached to canimation
ui._infoFlag = true;
ui.clearInfo();
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", name.c_str() + 1);
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "%s", name.c_str() + 1);
printed = true;
ui._menuCounter = 25;
}
Expand Down Expand Up @@ -1321,7 +1322,7 @@ int Object::pickUpObject(FixedTextActionId fixedTextActionId) {
ui._infoFlag = true;
ui.clearInfo();
Common::String errorMessage = fixedText.getActionMessage(fixedTextActionId, message);
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", errorMessage.c_str());
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "%s", errorMessage.c_str());
ui._menuCounter = 30;
} else {
// Pick it up
Expand Down Expand Up @@ -1370,7 +1371,7 @@ int Object::pickUpObject(FixedTextActionId fixedTextActionId) {

Common::String itemName = _description;
itemName.setChar(tolower(itemName[0]), 0);
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "Picked up %s", itemName.c_str());
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "Picked up %s", itemName.c_str());
ui._menuCounter = 25;
}
}
Expand Down
10 changes: 9 additions & 1 deletion engines/sherlock/scalpel/scalpel.h
Expand Up @@ -31,9 +31,17 @@ namespace Sherlock {
namespace Scalpel {

enum {
BUTTON_TOP = 233,
BUTTON_MIDDLE = 244,
BUTTON_BOTTOM = 248,
COMMAND_FOREGROUND = 15,
COMMAND_HIGHLIGHTED = 10,
COMMAND_NULL = 248
COMMAND_NULL = 248,
INFO_FOREGROUND = 11,
INFO_BACKGROUND = 1,
INV_FOREGROUND = 14,
INV_BACKGROUND = 1,
PEN_COLOR = 250
};

class ScalpelEngine : public SherlockEngine {
Expand Down
10 changes: 1 addition & 9 deletions engines/sherlock/screen.h
Expand Up @@ -39,19 +39,11 @@ namespace Sherlock {
enum {
BLACK = 0,
INFO_BLACK = 1,
INFO_FOREGROUND = 11,
INFO_BACKGROUND = 1,
BORDER_COLOR = 237,
INV_FOREGROUND = 14,
INV_BACKGROUND = 1,
COMMAND_BACKGROUND = 4,
BUTTON_TOP = 233,
BUTTON_MIDDLE = 244,
BUTTON_BOTTOM = 248,
BUTTON_BACKGROUND = 235,
TALK_FOREGROUND = 12,
TALK_NULL = 16,
PEN_COLOR = 250
TALK_NULL = 16
};

class SherlockEngine;
Expand Down
4 changes: 3 additions & 1 deletion engines/sherlock/sherlock.h
Expand Up @@ -66,9 +66,11 @@ enum GameType {
#define SHERLOCK_SCREEN_WIDTH _vm->_screen->w()
#define SHERLOCK_SCREEN_HEIGHT _vm->_screen->h()
#define SHERLOCK_SCENE_HEIGHT (IS_SERRATED_SCALPEL ? 138 : 480)
// TODO: Is this the correct scene count for The Case of the Rose Tattoo?
#define SCENES_COUNT (IS_SERRATED_SCALPEL ? 63 : 101)

#define COL_INFO_FOREGROUND (IS_SERRATED_SCALPEL ? Scalpel::INFO_FOREGROUND : Tattoo::INFO_FOREGROUND)
#define COL_PEN_COLOR (IS_SERRATED_SCALPEL ? Scalpel::PEN_COLOR : Tattoo::PEN_COLOR)

struct SherlockGameDescription;

class Resource;
Expand Down
9 changes: 7 additions & 2 deletions engines/sherlock/tattoo/tattoo.h
Expand Up @@ -30,14 +30,19 @@ namespace Sherlock {
namespace Tattoo {

enum {
INV_FOREGROUND = 167,
INV_BACKGROUND = 1,
INFO_FOREGROUND = 233,
INFO_BACKGROUND = 239,
INFO_TOP = 185,
INFO_MIDDLE = 186,
INFO_BOTTOM = 188,
MENU_BACKGROUND = 225,
COMMAND_FOREGROUND = 15,
COMMAND_HIGHLIGHTED = 254,
COMMAND_NULL = 193

COMMAND_NULL = 193,
PEN_COLOR = 248,
PEN_HIGHLIGHT_COLOR = 129
};

class TattooEngine : public SherlockEngine {
Expand Down
7 changes: 4 additions & 3 deletions engines/sherlock/user_interface.cpp
Expand Up @@ -21,8 +21,9 @@
*/

#include "sherlock/user_interface.h"
#include "sherlock/sherlock.h"
#include "sherlock/scalpel/scalpel.h"
#include "sherlock/scalpel/scalpel_user_interface.h"
#include "sherlock/tattoo/tattoo.h"
#include "sherlock/tattoo/tattoo_user_interface.h"

namespace Sherlock {
Expand Down Expand Up @@ -72,7 +73,7 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
_infoFlag = true;
clearInfo();
Common::String errorMessage = fixedText.getActionMessage(fixedTextActionId, action._cAnimNum);
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "%s", errorMessage.c_str());
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "%s", errorMessage.c_str());
_infoFlag = true;

// Set how long to show the message
Expand Down Expand Up @@ -176,7 +177,7 @@ void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionI
if (scene._goToScene != 1 && !printed && !talk._talkToAbort) {
_infoFlag = true;
clearInfo();
screen.print(Common::Point(0, INFO_LINE + 1), INFO_FOREGROUND, "Done...");
screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "Done...");

// Set how long to show the message
_menuCounter = 30;
Expand Down

0 comments on commit 9bbeaa6

Please sign in to comment.