From 39544c1728524f3ebc729c8d90ca0f191078d3a4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 4 Jul 2015 10:39:03 -0400 Subject: SHERLOCK: RT: Additional constants for flags and characters --- engines/sherlock/tattoo/tattoo.h | 5 +++++ engines/sherlock/tattoo/tattoo_map.cpp | 4 ++-- engines/sherlock/tattoo/tattoo_people.cpp | 4 ++-- engines/sherlock/tattoo/tattoo_user_interface.cpp | 2 +- engines/sherlock/tattoo/widget_talk.cpp | 2 +- engines/sherlock/tattoo/widget_text.cpp | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/engines/sherlock/tattoo/tattoo.h b/engines/sherlock/tattoo/tattoo.h index 0b6a661a3f..57415c1c51 100644 --- a/engines/sherlock/tattoo/tattoo.h +++ b/engines/sherlock/tattoo/tattoo.h @@ -45,6 +45,11 @@ enum { PEN_HIGHLIGHT_COLOR = 129 }; +enum { + FLAG_PLAYER_IS_HOLMES = 76, + FLAG_ALT_MAP_MUSIC = 525 +}; + class TattooEngine : public SherlockEngine { private: /** diff --git a/engines/sherlock/tattoo/tattoo_map.cpp b/engines/sherlock/tattoo/tattoo_map.cpp index 365c14a79c..bc7dafdbb2 100644 --- a/engines/sherlock/tattoo/tattoo_map.cpp +++ b/engines/sherlock/tattoo/tattoo_map.cpp @@ -71,10 +71,10 @@ int TattooMap::show() { if (music._midiOption) { // See if Holmes or Watson is the active character Common::String song; - if (_vm->readFlags(76)) + if (_vm->readFlags(FLAG_PLAYER_IS_HOLMES)) // Player is Holmes song = "Cue9"; - else if (_vm->readFlags(525)) + else if (_vm->readFlags(FLAG_ALT_MAP_MUSIC)) song = "Cue8"; else song = "Cue7"; diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index 23366f17db..5956d98144 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -1153,9 +1153,9 @@ int TattooPeople::findSpeaker(int speaker) { // Fallback that Rose Tattoo uses if no speaker was found if (result == -1) { - bool flag = _vm->readFlags(76); + bool flag = _vm->readFlags(FLAG_PLAYER_IS_HOLMES); - if (_data[HOLMES]->_type == CHARACTER && ((speaker == 0 && flag) || (speaker == 1 && !flag))) + if (_data[HOLMES]->_type == CHARACTER && ((speaker == HOLMES && flag) || (speaker == WATSON && !flag))) return -1; for (uint idx = 1; idx < _data.size(); ++idx) { diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp index a7b73920e8..190e69a686 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.cpp +++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp @@ -380,7 +380,7 @@ void TattooUserInterface::doStandardControl() { case Common::KEYCODE_F1: // Display journal - if (vm.readFlags(76)) { + if (vm.readFlags(FLAG_PLAYER_IS_HOLMES)) { freeMenu(); doJournal(); diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp index 08982a557d..5c2d5a3360 100644 --- a/engines/sherlock/tattoo/widget_talk.cpp +++ b/engines/sherlock/tattoo/widget_talk.cpp @@ -354,7 +354,7 @@ void WidgetTalk::handleEvents() { journal.record(talk._converseNum, _selector); talk._talkHistory[talk._converseNum][_selector] = true; - talk._speaker = _vm->readFlags(76) ? HOLMES : WATSON; + talk._speaker = _vm->readFlags(FLAG_PLAYER_IS_HOLMES) ? HOLMES : WATSON; _scroll = false; const byte *msg = (const byte *)talk._statements[_selector]._statement.c_str(); talk.talkInterface(msg); diff --git a/engines/sherlock/tattoo/widget_text.cpp b/engines/sherlock/tattoo/widget_text.cpp index dd696b1a87..939ee08724 100644 --- a/engines/sherlock/tattoo/widget_text.cpp +++ b/engines/sherlock/tattoo/widget_text.cpp @@ -83,7 +83,7 @@ void WidgetText::centerWindowOnSpeaker(int speaker) { TattooScene &scene = *(TattooScene *)_vm->_scene; Common::Point pt; - bool flag = _vm->readFlags(76); + bool flag = _vm->readFlags(FLAG_PLAYER_IS_HOLMES); if (people[HOLMES]._type == CHARACTER && ((speaker == HOLMES && flag) || (speaker == WATSON && !flag))) { // Place the window centered above the player pt.x = people[HOLMES]._position.x / FIXED_INT_MULTIPLIER - _bounds.width() / 2; -- cgit v1.2.3