aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel/scalpel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock/scalpel/scalpel.cpp')
-rw-r--r--engines/sherlock/scalpel/scalpel.cpp306
1 files changed, 206 insertions, 100 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index eff589874d..ccc9c8abca 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -64,24 +64,25 @@ static const int TITLE_FRAMES[7][9] = {
};
#define NUM_PLACES 100
-const int MAP_X[NUM_PLACES] = {
+
+static const int MAP_X[NUM_PLACES] = {
0, 368, 0, 219, 0, 282, 0, 43, 0, 0, 396, 408, 0, 0, 0, 568, 37, 325,
28, 0, 263, 36, 148, 469, 342, 143, 443, 229, 298, 0, 157, 260, 432,
174, 0, 351, 0, 528, 0, 136, 0, 0, 0, 555, 165, 0, 506, 0, 0, 344, 0, 0
};
-const int MAP_Y[NUM_PLACES] = {
+static const int MAP_Y[NUM_PLACES] = {
0, 147, 0, 166, 0, 109, 0, 61, 0, 0, 264, 70, 0, 0, 0, 266, 341, 30, 275,
0, 294, 146, 311, 230, 184, 268, 133, 94, 207, 0, 142, 142, 330, 255, 0,
37, 0, 70, 0, 116, 0, 0, 0, 50, 21, 0, 303, 0, 0, 229, 0, 0
};
-const int MAP_TRANSLATE[NUM_PLACES] = {
+static const int MAP_TRANSLATE[NUM_PLACES] = {
0, 0, 0, 1, 0, 2, 0, 3, 4, 0, 4, 6, 0, 0, 0, 8, 9, 10, 11, 0, 12, 13, 14, 7,
15, 16, 17, 18, 19, 0, 20, 21, 22, 23, 0, 24, 0, 25, 0, 26, 0, 0, 0, 27,
28, 0, 29, 0, 0, 30, 0
};
-const byte MAP_SEQUENCES[3][MAX_FRAME] = {
+static const byte MAP_SEQUENCES[3][MAX_FRAME] = {
{ 1, 1, 2, 3, 4, 0 }, // Overview Still
{ 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 },
{ 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 }
@@ -89,7 +90,145 @@ const byte MAP_SEQUENCES[3][MAX_FRAME] = {
#define MAX_PEOPLE 66
-const byte STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
+const char PEOPLE_PORTRAITS[MAX_PEOPLE][5] = {
+ { "HOLM" }, // Sherlock Holmes
+ { "WATS" }, // Dr. Watson
+ { "LEST" }, // Inspector Lestrade
+ { "CON1" }, // Constable O'Brien
+ { "CON2" }, // Constable Lewis
+ { "SHEI" }, // Sheila Parker
+ { "HENR" }, // Henry Carruthers
+ { "LESL" }, // Lesley (flower girl)
+ { "USH1" }, // Usher #1
+ { "USH2" }, // Usher #2
+ { "FRED" }, // Fredrick Epstein
+ { "WORT" }, // Mrs. Worthington
+ { "COAC" }, // Coach
+ { "PLAY" }, // Player
+ { "WBOY" }, // Tim (Waterboy)
+ { "JAME" }, // James Sanders
+ { "BELL" }, // Belle (perfumerie)
+ { "GIRL" }, // Cleaning Girl (perfumerie)
+ { "EPST" }, // Epstien in the Opera Balcony
+ { "WIGG" }, // Wiggins
+ { "PAUL" }, // Paul (Brumwell / Carroway)
+ { "BART" }, // Bartender
+ { "DIRT" }, // Dirty Drunk
+ { "SHOU" }, // Shouting Drunk
+ { "STAG" }, // Staggering Drunk
+ { "BOUN" }, // Bouncer
+ { "SAND" }, // James Sanders - At Home
+ { "CORO" }, // The Coroner
+ { "EQUE" }, // The Equestrian Shop Keeper
+ { "GEOR" }, // George Blackwood
+ { "LARS" }, // Lars
+ { "PARK" }, // Sheila Parker (happy)
+ { "CHEM" }, // Chemist
+ { "GREG" }, // Inspector Gregson
+ { "LAWY" }, // Jacob Farthington Lawyer
+ { "MYCR" }, // Mycroft
+ { "SHER" }, // Old Sherman
+ { "CHMB" }, // Richard Chemist Stock boy
+ { "BARM" }, // Barman
+ { "DAND" }, // Dandy Player
+ { "ROUG" }, // Rough-looking Player
+ { "SPEC" }, // Spectator
+ { "HUNT" }, // Robert Hunt
+ { "VIOL" }, // Violet Secretary
+ { "PETT" }, // Pettigrew
+ { "APPL" }, // Augie (apple seller)
+ { "ANNA" }, // Anna Carroway
+ { "GUAR" }, // Guard
+ { "ANTO" }, // Antonio Caruso
+ { "TOBY" }, // Toby the Dog
+ { "KING" }, // Simon Kingsley
+ { "ALFR" }, // Alfred Tobacco Clerk
+ { "LADY" }, // Lady Brumwell
+ { "ROSA" }, // Madame Rosa
+ { "LADB" }, // Lady Brumwell
+ { "MOOR" }, // Joseph Moorehead
+ { "BEAL" }, // Mrs. Beale
+ { "LION" }, // Felix the Lion
+ { "HOLL" }, // Hollingston
+ { "CALL" }, // Constable Callaghan
+ { "JERE" }, // Sergeant Jeremy Duncan
+ { "LORD" }, // Lord Brumwell
+ { "NIGE" }, // Nigel Jameson
+ { "JONA" }, // Jonas (newspaper seller)
+ { "DUGA" }, // Constable Dugan
+ { "INSP" } // Inspector Lestrade (Scotland Yard)
+};
+
+const char *const PEOPLE_NAMES[MAX_PEOPLE] = {
+ "Sherlock Holmes",
+ "Dr. Watson",
+ "Inspector Lestrade",
+ "Constable O'Brien",
+ "Constable Lewis",
+ "Sheila Parker",
+ "Henry Carruthers",
+ "Lesley",
+ "An Usher",
+ "An Usher",
+ "Fredrick Epstein",
+ "Mrs. Worthington",
+ "The Coach",
+ "A Player",
+ "Tim",
+ "James Sanders",
+ "Belle",
+ "Cleaning Girl",
+ "Fredrick Epstein",
+ "Wiggins",
+ "Paul",
+ "The Bartender",
+ "A Dirty Drunk",
+ "A Shouting Drunk",
+ "A Staggering Drunk",
+ "The Bouncer",
+ "James Sanders",
+ "The Coroner",
+ "Reginald Snipes",
+ "George Blackwood",
+ "Lars",
+ "Sheila Parker",
+ "The Chemist",
+ "Inspector Gregson",
+ "Jacob Farthington",
+ "Mycroft",
+ "Old Sherman",
+ "Richard",
+ "The Barman",
+ "A Dandy Player",
+ "A Rough-looking Player",
+ "A Spectator",
+ "Robert Hunt",
+ "Violet",
+ "Pettigrew",
+ "Augie",
+ "Anna Carroway",
+ "A Guard",
+ "Antonio Caruso",
+ "Toby the Dog",
+ "Simon Kingsley",
+ "Alfred",
+ "Lady Brumwell",
+ "Madame Rosa",
+ "Lady Brumwell",
+ "Joseph Moorehead",
+ "Mrs. Beale",
+ "Felix",
+ "Hollingston",
+ "Constable Callaghan",
+ "Sergeant Duncan",
+ "Lord Brumwell",
+ "Nigel Jaimeson",
+ "Jonas",
+ "Constable Dugan",
+ "Inspector Lestrade"
+};
+
+static const byte PEOPLE_STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
{ 1, 0, 0 }, // Sherlock Holmes
{ 6, 0, 0 }, // Dr. Watson
{ 4, 0, 0 }, // Inspector Lestrade
@@ -158,7 +297,7 @@ const byte STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
{ 4, 0, 0 } // Inspector Lestrade (Yard)
};
-byte TALK_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
+static const byte PEOPLE_TALK_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
{ 1, 0, 0 }, // Sherlock Holmes
{ 5, 5, 6, 7, 8, 7, 8, 6, 0, 0 }, // Dr. Watson
{ 2, 0, 0 }, // Inspector Lestrade
@@ -239,9 +378,6 @@ ScalpelEngine::~ScalpelEngine() {
delete _darts;
}
-/**
- * Game initialization
- */
void ScalpelEngine::initialize() {
initGraphics(320, 200, false);
@@ -261,15 +397,20 @@ void ScalpelEngine::initialize() {
_res->addToCache("snd.snd");
_res->addToCache("title.snd");
- // Load the map co-ordinates for each scene and sequence data
- _map->loadPoints(NUM_PLACES, &MAP_X[0], &MAP_Y[0], &MAP_TRANSLATE[0]);
- _map->loadSequences(3, &MAP_SEQUENCES[0][0]);
+ if (!isDemo()) {
+ // Load the map co-ordinates for each scene and sequence data
+ _map->loadPoints(NUM_PLACES, &MAP_X[0], &MAP_Y[0], &MAP_TRANSLATE[0]);
+ _map->loadSequences(3, &MAP_SEQUENCES[0][0]);
+ _map->_oldCharPoint = BAKER_ST_EXTERIOR;
+ }
// Load the inventory
loadInventory();
- // Set up constants used by the talk system
- _talk->setSequences(&TALK_SEQUENCES[0][0], &STILL_SEQUENCES[0][0], MAX_PEOPLE);
+ // Set up list of people
+ for (int idx = 0; idx < MAX_PEOPLE; ++idx)
+ _people->_characters.push_back(PersonData(PEOPLE_NAMES[idx], PEOPLE_PORTRAITS[idx],
+ PEOPLE_STILL_SEQUENCES[idx], PEOPLE_TALK_SEQUENCES[idx]));
_animation->setPrologueNames(&PROLOGUE_NAMES[0], PROLOGUE_NAMES_COUNT);
_animation->setPrologueFrames(&PROLOGUE_FRAMES[0][0], 6, 9);
@@ -278,17 +419,14 @@ void ScalpelEngine::initialize() {
_animation->setTitleFrames(&TITLE_FRAMES[0][0], 7, 9);
// Starting scene
- if (getIsDemo())
+ if (isDemo() && _interactiveFl)
_scene->_goToScene = 3;
else
_scene->_goToScene = 4;
}
-/**
- * Show the opening sequence
- */
void ScalpelEngine::showOpening() {
- if (getIsDemo())
+ if (isDemo() && _interactiveFl)
return;
if (!showCityCutscene())
@@ -304,21 +442,18 @@ void ScalpelEngine::showOpening() {
_sound->stopMusic();
}
-/**
- * Show the starting city cutscene which shows the game title
- */
bool ScalpelEngine::showCityCutscene() {
byte palette[PALETTE_SIZE];
_sound->playMusic("prolog1.mus");
- _titleOverride = "title.lib";
- _soundOverride = "title.snd";
+ _animation->_gfxLibraryFilename = "title.lib";
+ _animation->_soundLibraryFilename = "title.snd";
bool finished = _animation->play("26open1", 1, 255, true, 2);
if (finished) {
ImageFile titleImages("title2.vgs", true);
- _screen->_backBuffer1.copyFrom(*_screen);
- _screen->_backBuffer2.copyFrom(*_screen);
+ _screen->_backBuffer1.blitFrom(*_screen);
+ _screen->_backBuffer2.blitFrom(*_screen);
// London, England
_screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(10, 11));
@@ -342,8 +477,8 @@ bool ScalpelEngine::showCityCutscene() {
if (finished) {
ImageFile titleImages("title.vgs", true);
- _screen->_backBuffer1.copyFrom(*_screen);
- _screen->_backBuffer2.copyFrom(*_screen);
+ _screen->_backBuffer1.blitFrom(*_screen);
+ _screen->_backBuffer2.blitFrom(*_screen);
// The Lost Files of
_screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(75, 6));
@@ -374,20 +509,17 @@ bool ScalpelEngine::showCityCutscene() {
}
}
- _titleOverride = "";
- _soundOverride = "";
+ _animation->_gfxLibraryFilename = "";
+ _animation->_soundLibraryFilename = "";
return finished;
}
-/**
- * Show the back alley where the initial murder takes place
- */
bool ScalpelEngine::showAlleyCutscene() {
byte palette[PALETTE_SIZE];
_sound->playMusic("prolog2.mus");
- _titleOverride = "TITLE.LIB";
- _soundOverride = "TITLE.SND";
+ _animation->_gfxLibraryFilename = "TITLE.LIB";
+ _animation->_soundLibraryFilename = "TITLE.SND";
bool finished = _animation->play("27PRO1", 1, 3, true, 2);
if (finished)
@@ -401,12 +533,12 @@ bool ScalpelEngine::showAlleyCutscene() {
if (finished)
finished = _animation->play("27PRO3", 1, 0, true, 2);
- if(finished) {
+ if (finished) {
_screen->getPalette(palette);
_screen->fadeToBlack(2);
}
- if(finished) {
+ if (finished) {
ImageFile titleImages("title3.vgs", true);
// "Early the following morning on Baker Street..."
_screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(35, 51), false, 0);
@@ -414,17 +546,14 @@ bool ScalpelEngine::showAlleyCutscene() {
finished = _events->delay(1000);
}
- _titleOverride = "";
- _soundOverride = "";
+ _animation->_gfxLibraryFilename = "";
+ _animation->_soundLibraryFilename = "";
return finished;
}
-/**
- * Show the Baker Street outside cutscene
- */
bool ScalpelEngine::showStreetCutscene() {
- _titleOverride = "TITLE.LIB";
- _soundOverride = "TITLE.SND";
+ _animation->_gfxLibraryFilename = "TITLE.LIB";
+ _animation->_soundLibraryFilename = "TITLE.SND";
_sound->playMusic("PROLOG3.MUS");
@@ -433,14 +562,12 @@ bool ScalpelEngine::showStreetCutscene() {
if (finished)
finished = _animation->play("14NOTE", 1, 0, false, 2);
- _titleOverride = "";
- _soundOverride = "";
+ _animation->_gfxLibraryFilename = "";
+ _animation->_soundLibraryFilename = "";
return finished;
}
-/**
- * Show the game credits
- */
+
bool ScalpelEngine::scrollCredits() {
// Load the images for displaying credit text
Common::SeekableReadStream *stream = _res->load("credits.vgs", "title.lib");
@@ -463,9 +590,9 @@ bool ScalpelEngine::scrollCredits() {
_screen->transBlitFrom(creditsImages[1], Common::Point(10, 400 - idx), false, 0);
// Don't show credit text on the top and bottom ten rows of the screen
- _screen->blitFrom(_screen->_backBuffer1, Common::Point(0, 0), Common::Rect(0, 0, _screen->w, 10));
- _screen->blitFrom(_screen->_backBuffer1, Common::Point(0, _screen->h - 10),
- Common::Rect(0, _screen->h - 10, _screen->w, _screen->h));
+ _screen->blitFrom(_screen->_backBuffer1, Common::Point(0, 0), Common::Rect(0, 0, _screen->w(), 10));
+ _screen->blitFrom(_screen->_backBuffer1, Common::Point(0, _screen->h() - 10),
+ Common::Rect(0, _screen->h() - 10, _screen->w(), _screen->h()));
_events->delay(100);
}
@@ -473,13 +600,10 @@ bool ScalpelEngine::scrollCredits() {
return true;
}
-/**
- * Show Holmes and Watson at the breakfast table, lestrade's note, and then the scrolling credits
- */
bool ScalpelEngine::showOfficeCutscene() {
_sound->playMusic("PROLOG4.MUS");
- _titleOverride = "TITLE2.LIB";
- _soundOverride = "TITLE.SND";
+ _animation->_gfxLibraryFilename = "TITLE2.LIB";
+ _animation->_soundLibraryFilename = "TITLE.SND";
bool finished = _animation->play("COFF1", 1, 3, true, 3);
if (finished)
@@ -498,8 +622,10 @@ bool ScalpelEngine::showOfficeCutscene() {
} else
finished = _events->delay(19000);
- _events->clearEvents();
- finished = _events->delay(500);
+ if (finished) {
+ _events->clearEvents();
+ finished = _events->delay(500);
+ }
}
if (finished)
@@ -514,16 +640,11 @@ bool ScalpelEngine::showOfficeCutscene() {
if (finished)
_screen->fadeToBlack(3);
- _titleOverride = "";
- _soundOverride = "";
+ _animation->_gfxLibraryFilename = "";
+ _animation->_soundLibraryFilename = "";
return finished;
}
-/**
- * Load the default inventory for the game, which includes both the initial active inventory,
- * as well as special pending inventory items which can appear automatically in the player's
- * inventory once given required flags are set
- */
void ScalpelEngine::loadInventory() {
Inventory &inv = *_inventory;
@@ -545,24 +666,18 @@ void ScalpelEngine::loadInventory() {
inv.push_back(InventoryItem(586, "Pawn ticket", "A pawn ticket", "_ITEM16A"));
}
-/**
- * Transition to show an image
- */
void ScalpelEngine::showLBV(const Common::String &filename) {
Common::SeekableReadStream *stream = _res->load(filename, "title.lib");
ImageFile images(*stream);
delete stream;
_screen->setPalette(images._palette);
- _screen->_backBuffer1.blitFrom(images[0]._frame);
+ _screen->_backBuffer1.blitFrom(images[0]);
_screen->verticalTransition();
}
-/**
- * Starting a scene within the game
- */
void ScalpelEngine::startScene() {
- if (_scene->_goToScene == 100 || _scene->_goToScene == 98) {
+ if (_scene->_goToScene == OVERHEAD_MAP || _scene->_goToScene == OVERHEAD_MAP2) {
// Show the map
if (_sound->_musicOn) {
if (_sound->loadSong(100)) {
@@ -585,17 +700,17 @@ void ScalpelEngine::startScene() {
// 55: Fade out and exit
// 70: Brumwell suicide
switch (_scene->_goToScene) {
- case 2:
- case 52:
- case 53:
- case 70:
+ case BLACKWOOD_CAPTURE:
+ case RESCUE_ANNA:
+ case MOOREHEAD_DEATH:
+ case BRUMWELL_SUICIDE:
if (_sound->_musicOn && _sound->loadSong(_scene->_goToScene)) {
if (_sound->_music)
_sound->startSong();
}
switch (_scene->_goToScene) {
- case 2:
+ case BLACKWOOD_CAPTURE:
// Blackwood's capture
_res->addToCache("final2.vda", "epilogue.lib");
_res->addToCache("final2.vdx", "epilogue.lib");
@@ -603,7 +718,7 @@ void ScalpelEngine::startScene() {
_animation->play("final2", 1, 0, false, 4);
break;
- case 52:
+ case RESCUE_ANNA:
// Rescuing Anna
_res->addToCache("finalr2.vda", "epilogue.lib");
_res->addToCache("finalr2.vdx", "epilogue.lib");
@@ -638,7 +753,7 @@ void ScalpelEngine::startScene() {
_useEpilogue2 = false;
break;
- case 53:
+ case MOOREHEAD_DEATH:
// Moorehead's death / subway train
_res->addToCache("SUBWAY2.vda", "epilogue.lib");
_res->addToCache("SUBWAY2.vdx", "epilogue.lib");
@@ -654,7 +769,7 @@ void ScalpelEngine::startScene() {
_screen->_fadeStyle = false;
break;
- case 70:
+ case BRUMWELL_SUICIDE:
// Brumwell suicide
_animation->play("suicid", 1, 3, true, 4);
break;
@@ -663,31 +778,31 @@ void ScalpelEngine::startScene() {
}
// Except for the Moorehead Murder scene, fade to black first
- if (_scene->_goToScene != 53) {
+ if (_scene->_goToScene != MOOREHEAD_DEATH) {
_events->wait(40);
_screen->fadeToBlack(3);
}
switch (_scene->_goToScene) {
case 52:
- _scene->_goToScene = 27; // Go to the Lawyer's Office
+ _scene->_goToScene = LAWYER_OFFICE; // Go to the Lawyer's Office
_map->_bigPos = Common::Point(0, 0); // Overland scroll position
_map->_overPos = Common::Point(22900 - 600, 9400 + 900); // Overland position
- _map->_oldCharPoint = 27;
+ _map->_oldCharPoint = LAWYER_OFFICE;
break;
case 53:
- _scene->_goToScene = 17; // Go to St. Pancras Station
+ _scene->_goToScene = STATION; // Go to St. Pancras Station
_map->_bigPos = Common::Point(0, 0); // Overland scroll position
_map->_overPos = Common::Point(32500 - 600, 3000 + 900); // Overland position
- _map->_oldCharPoint = 17;
+ _map->_oldCharPoint = STATION;
break;
default:
- _scene->_goToScene = 4; // Back to Baker st.
+ _scene->_goToScene = BAKER_STREET; // Back to Baker st.
_map->_bigPos = Common::Point(0, 0); // Overland scroll position
_map->_overPos = Common::Point(14500 - 600, 8400 + 900); // Overland position
- _map->_oldCharPoint = 4;
+ _map->_oldCharPoint = BAKER_STREET;
break;
}
@@ -695,7 +810,7 @@ void ScalpelEngine::startScene() {
_sound->freeSong();
break;
- case 55:
+ case EXIT_GAME:
// Exit game
_screen->fadeToBlack(3);
quitGame();
@@ -711,15 +826,12 @@ void ScalpelEngine::startScene() {
if (_scene->_goToScene == 99) {
// Darts Board minigame
_darts->playDarts();
- _mapResult = _scene->_goToScene = 19; // Go back to the bar
+ _mapResult = _scene->_goToScene = PUB_INTERIOR;
}
_mapResult = _scene->_goToScene;
}
-/**
- * Takes care of clearing the mirror in scene 12, in case anything drew over it
- */
void ScalpelEngine::eraseMirror12() {
Common::Point pt((*_people)[AL]._position.x / 100, (*_people)[AL]._position.y / 100);
@@ -730,9 +842,6 @@ void ScalpelEngine::eraseMirror12() {
}
}
-/**
- * Takes care of drawing Holme's reflection onto the mirror in scene 12
- */
void ScalpelEngine::doMirror12() {
People &people = *_people;
Common::Point pt((*_people)[AL]._position.x / 100, (*_people)[AL]._position.y / 100);
@@ -806,9 +915,6 @@ void ScalpelEngine::doMirror12() {
}
}
-/**
- * This clears the mirror in scene 12 in case anything messed draw over it
- */
void ScalpelEngine::flushMirror12() {
Common::Point pt((*_people)[AL]._position.x / 100, (*_people)[AL]._position.y / 100);