{"action":"created","comment":{"url":"https://api.github.com/repos/scummvm/scummvm/pulls/comments/29992150","id":29992150,"diff_hunk":"@@ -0,0 +1,764 @@\n+/* ScummVM - Graphic Adventure Engine\n+ *\n+ * ScummVM is the legal property of its developers, whose names\n+ * are too numerous to list here. Please refer to the COPYRIGHT\n+ * file distributed with this source distribution.\n+ *\n+ * This program is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License\n+ * as published by the Free Software Foundation; either version 2\n+ * of the License, or (at your option) any later version.\n+\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program; if not, write to the Free Software\n+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n+ *\n+ */\n+\n+#include \"sherlock/scalpel/scalpel.h\"\n+#include \"sherlock/sherlock.h\"\n+\n+namespace Sherlock {\n+\n+namespace Scalpel {\n+\n+#define NUM_PLACES 100\n+const int MAP_X[NUM_PLACES] = {\n+\t0, 368, 0, 219, 0, 282, 0, 43, 0, 0, 396, 408, 0, 0, 0, 568, 37, 325,\n+\t28, 0, 263, 36, 148, 469, 342, 143, 443, 229, 298, 0, 157, 260, 432,\n+\t174, 0, 351, 0, 528, 0, 136, 0, 0, 0, 555, 165, 0, 506, 0, 0, 344, 0, 0\n+};\n+const int MAP_Y[NUM_PLACES] = {\n+\t0, 147, 0, 166, 0, 109, 0, 61, 0, 0, 264, 70, 0, 0, 0, 266, 341, 30, 275,\n+\t0, 294, 146, 311, 230, 184, 268, 133, 94, 207, 0, 142, 142, 330, 255, 0,\n+\t37, 0, 70, 0, 116, 0, 0, 0, 50, 21, 0, 303, 0, 0, 229, 0, 0\n+};\n+\n+const int MAP_TRANSLATE[NUM_PLACES] = {\n+\t0, 0, 0, 1, 0, 2, 0, 3, 4, 0, 4, 6, 0, 0, 0, 8, 9, 10, 11, 0, 12, 13, 14, 7,\n+\t15, 16, 17, 18, 19, 0, 20, 21, 22, 23, 0, 24, 0, 25, 0, 26, 0, 0, 0, 27,\n+\t28, 0, 29, 0, 0, 30, 0\n+};\n+\n+const byte MAP_SEQUENCES[3][MAX_FRAME] = {\n+\t{ 1, 1, 2, 3, 4, 0 },     // Overview Still\n+\t{ 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 },\n+\t{ 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 }\n+};\n+\n+#define MAX_PEOPLE 66\n+\n+const byte STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {\n+\t{ 1, 0, 0 },\t// Sherlock Holmes\n+\t{ 6, 0, 0 },\t// Dr. Watson\n+\t{ 4, 0, 0 },\t// Inspector Lestrade\n+\t{ 2, 0, 0 },\t// Constable #1\n+\t{ 2, 0, 0 },\t// Constable #2\n+\t{ 2, 0, 0 },\t// Sheila Parker\n+\t{ 3, 0, 0 },\t// Henry Carruthers\n+\t{ 9, 0, 0 },\t// Lesly (flower girl)\n+\t{ 13, 0, 0 },\t// Usher #1\n+\t{ 2, 0, 0 },\t// Usher #2\n+\t{ 4, 0, 0 },\t// Fredrick Epstein\n+\t{ 9, 0, 0 },\t// Mrs.Worthington\n+\t{ 2, 0, 0 },\t// Coach\n+\t{ 8, 0, 0 },\t// Player\n+\t{ 13, 0, 0 },\t// Waterboy\n+\t{ 6, 0, 0 },\t// James Sanders\n+\t{ 1, 0, 0 },\t// Belle (perfumerie)\n+\t{ 20, 0, 0 },\t// Cleaning Girl (perfumerie)\n+\t{ 17, 0, 0 },\t// Epstien in the Opera Balcony\n+\t{ 3, 0, 0 },\t// Wiggins\n+\t{ 2, 0, 0 },\t// Paul (Brumwell/Carroway)\n+\t{ 1, 0, 0 },\t// Bartender\n+\t{ 1, 0, 0 },\t// Dirty Drunk\n+\t{ 1, 0, 0 },\t// Shouting Drunk\n+\t{ 1, 0, 0 },\t// Staggering Drunk\n+\t{ 1, 0, 0 },\t// Bouncer\n+\t{ 6, 0, 0 },\t// James Sanders - At Home\n+\t{ 6, 0, 0 },\t// The Coroner\n+\t{ 1, 0, 0 },\t// The Equestrian Shop Keeper\n+\t{ 1, 0, 0 },\t// George Blackwood\n+\t{ 7, 0, 0 },\t// Lars\n+\t{ 1, 0, 0 },\t// Sheila Parker\n+\t{ 8, 0, 0 },\t// Chemist\n+\t{ 6, 0, 0 },\t// Inspector Gregson\n+\t{ 1, 0, 0 },\t// Lawyer\n+\t{ 1, 0, 0 },\t// Mycroft\n+\t{ 7, 0, 0 },\t// Old Sherman\n+\t{ 1, 0, 0 },\t// Stock Boy in Chemist Shop\n+\t{ 1, 0, 0 },\t// Barman\n+\t{ 1, 0, 0 },\t// Dandy Player\n+\t{ 1, 0, 0 },\t// Rough-looking Player\n+\t{ 1, 0, 0 },\t// Spectator\n+\t{ 1, 0, 0 },\t// Robert Hunt\n+\t{ 3, 0, 0 },\t// Violet Secretary\n+\t{ 1, 0, 0 },\t// Pettigrew\n+\t{ 8, 0, 0 },\t// Augie (apple seller)\n+\t{ 16, 0, 0 },\t// Anna Carroway\n+\t{ 1, 0, 0 },\t// Guard\n+\t{ 8, 0, 0 },\t// Antonio Caruso\n+\t{ 1, 0, 0 },\t// Toby the Dog\n+\t{ 13, 0, 0 },\t// Simon Kingsley\n+\t{ 2, 0, 0 },\t// Alfred Tobacco Clerk\n+\t{ 1, 0, 0 },\t// Lady Brumwell\n+\t{ 1, 0, 0 },\t// Madame Rosa\n+\t{ 1, 0, 0 },\t// Lady Brumwell\n+\t{ 1, 0, 0 },\t// Joseph Moorehead\n+\t{ 5, 0, 0 },\t// Mrs. Beale\n+\t{ 1, 0, 0 },\t// Felix the Lion\n+\t{ 1, 0, 0 },\t// Hollingston\n+\t{ 1, 0, 0 },\t// Constable Callaghan\n+\t{ 2, 0, 0 },\t// Sergeant Jeremy Duncan\n+\t{ 1, 0, 0 },\t// Lord Brumwell\n+\t{ 1, 0, 0 },\t// Nigel Jameson\n+\t{ 1, 0, 0 },\t// Jonas (newspaper seller)\n+\t{ 1, 0, 0 },\t// Constable Dugan\n+\t{ 4, 0, 0 }\t\t// Inspector Lestrade (Yard)\n+};\n+\n+byte TALK_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {\n+\t{ 1, 0, 0 },\t\t\t\t\t// Sherlock Holmes\n+\t{ 5, 5, 6, 7, 8, 7, 8, 6, 0, 0 },\t// Dr. Watson\n+\t{ 2, 0, 0 },\t\t\t\t\t// Inspector Lestrade\n+\t{ 1, 0, 0 },\t\t\t\t\t// Constable #1\n+\t{ 1, 0, 0 },\t\t\t\t\t// Constable #2\n+\t{ 2, 3, 0, 0 },\t\t\t\t\t// Sheila Parker\n+\t{ 3, 0, 0 },\t\t\t\t\t// Henry Carruthers\n+\t{ 1, 2, 3, 2, 1, 2, 3, 0, 0 },\t// Lesly (flower girl)\n+\t{ 13, 14, 0, 0 },\t\t\t\t// Usher #1\n+\t{ 2, 0, 0 },\t\t\t\t\t// Usher #2\n+\t{ 1, 2, 3, 4, 3, 4, 3, 2, 0, 0 },\t// Fredrick Epstein\n+\t{ 8, 0, 0 },\t\t\t\t\t\t// Mrs.Worthington\n+\t{ 1, 2, 3, 4, 5, 4, 3, 2, 0, 0 },\t// Coach\n+\t{ 7, 8, 0, 0 },\t\t\t\t\t\t// Player\n+\t{ 12, 13, 0, 0 },\t\t\t\t\t// Waterboy\n+\t{ 3, 4, 0, 0 },\t\t\t\t\t\t// James Sanders\n+\t{ 4, 5, 0, 0 },\t\t\t\t\t\t// Belle (perfumerie)\n+\t{ 14, 15, 16, 17, 18, 19, 20, 20, 20, 0, 0 },\t// Cleaning Girl (perfumerie)\n+\t{ 16, 17, 18, 18, 18, 17, 17, 0, 0 },\t// Epstien in the Opera Balcony\n+\t{ 2, 3, 0, 0 },\t\t\t\t\t// Wiggins\n+\t{ 1, 2, 0, 0 },\t\t\t\t\t// Paul (Brumwell/Carroway)\n+\t{ 1, 0, 0 },\t\t\t\t\t// Bartender\n+\t{ 1, 0, 0 },\t\t\t\t\t// Dirty Drunk\n+\t{ 1, 0, 0 },\t\t\t\t\t// Shouting Drunk\n+\t{ 1, 0, 0 },\t\t\t\t\t// Staggering Drunk\n+\t{ 1, 0, 0 },\t\t\t\t\t// Bouncer\n+\t{ 5, 6, 0, 0 },\t\t\t\t\t// James Sanders - At Home\n+\t{ 4, 5, 0, 0 },\t\t\t\t\t// The Coroner\n+\t{ 1, 0, 0 },\t\t\t\t\t// The Equestrian Shop Keeper\n+\t{ 1, 0, 0 },\t\t\t\t\t// George Blackwood\n+\t{ 5, 6, 0, 0 },\t\t\t\t\t// Lars\n+\t{ 1, 0, 0 },\t\t\t\t\t// Sheila Parker\n+\t{ 8, 9, 0, 0 },\t\t\t\t\t// Chemist\n+\t{ 5, 6, 0, 0 },\t\t\t\t\t// Inspector Gregson\n+\t{ 1, 0, 0 },\t\t\t\t\t// Lawyer\n+\t{ 1, 0, 0 },\t\t\t\t\t// Mycroft\n+\t{ 7, 8, 0, 0 },\t\t\t\t\t// Old Sherman\n+\t{ 1, 0, 0 },\t\t\t\t\t// Stock Boy in Chemist Shop\n+\t{ 1, 0, 0 },\t\t\t\t\t// Barman\n+\t{ 1, 0, 0 },\t\t\t\t\t// Dandy Player\n+\t{ 1, 0, 0 },\t\t\t\t\t// Rough-looking Player\n+\t{ 1, 0, 0 },\t\t\t\t\t// Spectator\n+\t{ 1, 0, 0 },\t\t\t\t\t// Robert Hunt\n+\t{ 3, 4, 0, 0 },\t\t\t\t\t// Violet Secretary\n+\t{ 1, 0, 0 },\t\t\t\t\t// Pettigrew\n+\t{ 14, 15, 0, 0 },\t\t\t\t// Augie (apple seller)\n+\t{ 3, 4, 5, 6, 0, 0 },\t\t\t// Anna Carroway\n+\t{ 4, 5, 6, 0, 0 },\t\t\t\t// Guard\n+\t{ 7, 8, 0, 0 },\t\t\t\t\t// Antonio Caruso\n+\t{ 1, 0, 0 },\t\t\t\t\t// Toby the Dog\n+\t{ 13, 14, 0, 0 },\t\t\t\t// Simon Kingsley\n+\t{ 2, 3, 0, 0 },\t\t\t\t\t// Alfred Tobacco Clerk\n+\t{ 3, 4, 0, 0 },\t\t\t\t\t// Lady Brumwell\n+\t{ 1, 30, 0, 0 },\t\t\t\t// Madame Rosa\n+\t{ 3, 4, 0, 0 },\t\t\t\t\t// Lady Brumwell\n+\t{ 1, 0, 0 },\t\t\t\t\t// Joseph Moorehead\n+\t{ 14, 15, 16, 17, 18, 19, 20, 0, 0 },\t// Mrs. Beale\n+\t{ 1, 0, 0 },\t\t\t\t\t// Felix the Lion\n+\t{ 1, 0, 0 },\t\t\t\t\t// Hollingston\n+\t{ 1, 0, 0 },\t\t\t\t\t// Constable Callaghan\n+\t{ 1, 1, 2, 2, 0, 0 },\t\t\t// Sergeant Jeremy Duncan\n+\t{ 9, 10, 0, 0 },\t\t\t\t// Lord Brumwell\n+\t{ 1, 2, 0, 138, 3, 4, 0, 138, 0, 0 },\t// Nigel Jameson\n+\t{ 1, 8, 0, 0 },\t\t\t\t\t// Jonas (newspaper seller)\n+\t{ 1, 0, 0 },\t\t\t\t\t// Constable Dugan\n+\t{ 2, 0, 0 }\t\t\t\t\t\t// Inspector Lestrade (Yard)\n+};\n+\n+/*----------------------------------------------------------------*/\n+\n+ScalpelEngine::ScalpelEngine(OSystem *syst, const SherlockGameDescription *gameDesc) :\n+\t\tSherlockEngine(syst, gameDesc) {\n+\t_darts = nullptr;\n+\t_mapResult = 0;\n+}\n+\n+ScalpelEngine::~ScalpelEngine() {\n+\tdelete _darts;\n+}\n+\n+/**\n+ * Game initialization\n+ */\n+void ScalpelEngine::initialize() {\n+\tSherlockEngine::initialize();\n+\n+\t_darts = new Darts(this);\n+\n+\t_flags.resize(100 * 8);\n+\t_flags[3] = true;\t\t// Turn on Alley\n+\t_flags[39] = true;\t\t// Turn on Baker Street\n+\n+\t// Load the map co-ordinates for each scene and sequence data\n+\t_map->loadPoints(NUM_PLACES, &MAP_X[0], &MAP_Y[0], &MAP_TRANSLATE[0]);\n+\t_map->loadSequences(3, &MAP_SEQUENCES[0][0]);\n+\n+\t// Load the inventory\n+\tloadInventory();\n+\n+\t// Set up constants used by the talk system\n+\t_talk->setSequences(&TALK_SEQUENCES[0][0], &STILL_SEQUENCES[0][0], MAX_PEOPLE);\n+\n+\t// Starting scene\n+\t_scene->_goToScene = 4;\n+}\n+\n+/**\n+ * Show the opening sequence\n+ */\n+void ScalpelEngine::showOpening() {\n+\tif (!showCityCutscene())\n+\t\treturn;\n+\tif (!showAlleyCutscene())\n+\t\treturn;\n+\tif (!showStreetCutscene())\n+\t\treturn;\n+\tif (!showOfficeCutscene())\n+\t\treturn;\n+\n+\t_events->clearEvents();\n+\t_sound->stopMusic();\n+}\n+\n+/**\n+ * Show the starting city cutscene which shows the game title\n+ */\n+bool ScalpelEngine::showCityCutscene() {\n+\tbyte palette[PALETTE_SIZE];\n+\n+\t_sound->playMusic(\"prolog1.mus\");\n+\t_titleOverride = \"title.lib\";\n+\t_soundOverride = \"title.snd\";\n+\tbool finished = _animation->play(\"26open1\", 1, 255, true, 2);\n+\n+\tif (finished) {\n+\t\tImageFile titleImages(\"title2.vgs\", true);\n+\t\t_screen->_backBuffer1.copyFrom(*_screen);\n+\t\t_screen->_backBuffer2.copyFrom(*_screen);\n+\n+\t\t// London, England\n+\t\t_screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(10, 11));\n+\t\t_screen->randomTransition();\n+\t\tfinished = _events->delay(1000, true);\n+\n+\t\t// November, 1888\n+\t\tif (finished) {\n+\t\t\t_screen->_backBuffer1.transBlitFrom(titleImages[1], Common::Point(101, 102));\n+\t\t\t_screen->randomTransition();\n+\t\t\tfinished = _events->delay(5000, true);\n+\t\t}\n+\n+\t\t// Transition out the title\n+\t\t_screen->_backBuffer1.blitFrom(_screen->_backBuffer2);\n+\t\t_screen->randomTransition();\n+\t}\n+\n+\tif (finished)\n+\t\tfinished = _animation->play(\"26open2\", 1, 0, false, 2);\n+\n+\tif (finished) {\n+\t\tImageFile titleImages(\"title.vgs\", true);\n+\t\t_screen->_backBuffer1.copyFrom(*_screen);\n+\t\t_screen->_backBuffer2.copyFrom(*_screen);\n+\n+\t\t// The Lost Files of\n+\t\t_screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(75, 6));\n+\t\t// Sherlock Holmes\n+\t\t_screen->_backBuffer1.transBlitFrom(titleImages[1], Common::Point(34, 21));\n+\t\t// copyright\n+\t\t_screen->_backBuffer1.transBlitFrom(titleImages[2], Common::Point(4, 190));\n+\n+\t\t_screen->verticalTransition();\n+\t\tfinished = _events->delay(4000, true);\n+\n+\t\tif (finished) {\n+\t\t\t_screen->_backBuffer1.blitFrom(_screen->_backBuffer2);\n+\t\t\t_screen->randomTransition();\n+\t\t\tfinished = _events->delay(2000);\n+\t\t}\n+\n+\t\tif (finished) {\n+\t\t\t_screen->getPalette(palette);\n+\t\t\t_screen->fadeToBlack(2);\n+\t\t}\n+\n+\t\tif (finished) {\n+\t\t\t// In the alley...\n+\t\t\t_screen->transBlitFrom(titleImages[3], Common::Point(72, 51));\n+\t\t\t_screen->fadeIn(palette, 3);\n+\t\t\tfinished = _events->delay(3000, true);\n+\t\t}\n+\t}\n+\n+\t_titleOverride = \"\";\n+\t_soundOverride = \"\";\n+\treturn finished;\n+}\n+\n+/**\n+ * Show the back alley where the initial murder takes place\n+ */\n+bool ScalpelEngine::showAlleyCutscene() {\n+\tbyte palette[PALETTE_SIZE];\n+\t_sound->playMusic(\"prolog2.mus\");\n+\n+\t_titleOverride = \"TITLE.LIB\";\n+\t_soundOverride = \"TITLE.SND\";\n+\n+\tbool finished = _animation->play(\"27PRO1\", 1, 3, true, 2);\n+\tif (finished)\n+\t\tfinished = _animation->play(\"27PRO2\", 1, 0, false, 2);\n+\n+\tif (finished) {\n+\t\tshowLBV(\"scream.lbv\");\n+\t\tfinished = _events->delay(6000);\n+\t}\n+\n+\tif (finished)\n+\t\tfinished = _animation->play(\"27PRO3\", 1, 0, true, 2);\n+\n+\tif(finished) {\n+\t\t_screen->getPalette(palette);\n+\t\t_screen->fadeToBlack(2);\n+\t}\n+\n+\tif(finished) {\n+\t\tImageFile titleImages(\"title3.vgs\", true);\n+\t\t// \"Early the following morning on Baker Street...\"\n+\t\t_screen->_backBuffer1.transBlitFrom(titleImages[0], Common::Point(35, 51), false, 0);\n+\t\t_screen->fadeIn(palette, 3);\n+\t\tfinished = _events->delay(1000);\n+\t}\n+\n+\t_titleOverride = \"\";\n+\t_soundOverride = \"\";\n+\treturn finished;\n+}\n+\n+/**\n+ * Show the Baker Street outside cutscene\n+ */\n+bool ScalpelEngine::showStreetCutscene() {\n+\t_titleOverride = \"TITLE.LIB\";\n+\t_soundOverride = \"TITLE.SND\";\n+\n+\t_sound->playMusic(\"PROLOG3.MUS\");\n+\n+\tbool finished = _animation->play(\"14KICK\", 1, 3, true, 2);\n+\n+\tif (finished)\n+\t\tfinished = _animation->play(\"14NOTE\", 1, 0, false, 2);\n+\n+\t_titleOverride = \"\";\n+\t_soundOverride = \"\";\n+\treturn finished;\n+}\n+\n+/**\n+ * Show the game credits\n+ */\n+bool ScalpelEngine::scrollCredits() {\n+\t// Load the images for displaying credit text\n+\tCommon::SeekableReadStream *stream = _res->load(\"credits.vgs\", \"title.lib\");\n+\tImageFile creditsImages(*stream);\n+\t_screen->setPalette(creditsImages._palette);\n+\tdelete stream;\n+\n+\t// Save a copy of the screen background for use in drawing each credit frame\n+\t_screen->_backBuffer1.blitFrom(*_screen);\n+\n+\t// Loop for showing the credits\n+\tfor(int idx = 0; idx < 600 && !_events->kbHit() && !shouldQuit(); ++idx) {\n+\t\t// Copy the entire screen background before writing text\n+\t\t_screen->blitFrom(_screen->_backBuffer1);\n+\n+\t\t// Write the text appropriate for the next frame\n+\t\tif (idx < 400)\n+\t\t\t_screen->transBlitFrom(creditsImages[0], Common::Point(10, 200 - idx), false, 0);\n+\t\tif (idx > 200)\n+\t\t\t_screen->transBlitFrom(creditsImages[1], Common::Point(10, 400 - idx), false, 0);\n+\n+\t\t// Don't show credit text on the top and bottom ten rows of the screen\n+\t\t_screen->blitFrom(_screen->_backBuffer1, Common::Point(0, 0), Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, 10));\n+\t\t_screen->blitFrom(_screen->_backBuffer1, Common::Point(0, SHERLOCK_SCREEN_HEIGHT - 10),\n+\t\t\tCommon::Rect(0, SHERLOCK_SCREEN_HEIGHT - 10, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));\n+\n+\t\t_events->delay(100);\n+\t}\n+\n+\treturn true;\n+}\n+\n+/**\n+ * Show Holmes and Watson at the breakfast table, lestrade's note, and then the scrolling credits\n+ */\n+bool ScalpelEngine::showOfficeCutscene() {\n+\t_sound->playMusic(\"PROLOG4.MUS\");\n+\t_titleOverride = \"TITLE2.LIB\";\n+\t_soundOverride = \"TITLE.SND\";\n+\n+\tbool finished = _animation->play(\"COFF1\", 1, 3, true, 3);\n+\tif (finished)\n+\t\tfinished = _animation->play(\"COFF2\", 1, 0, false, 3);\n+\tif (finished) {\n+\t\tshowLBV(\"note.lbv\");\n+\n+\t\tif (_sound->_voices) {\n+\t\t\tfinished = _sound->playSound(\"NOTE1\", WAIT_KBD_OR_FINISH);\n+\t\t\tif (finished)\n+\t\t\t\tfinished = _sound->playSound(\"NOTE2\", WAIT_KBD_OR_FINISH);\n+\t\t\tif (finished)\n+\t\t\t\tfinished = _sound->playSound(\"NOTE3\", WAIT_KBD_OR_FINISH);\n+\t\t\tif (finished)\n+\t\t\t\tfinished = _sound->playSound(\"NOTE4\", WAIT_KBD_OR_FINISH);\n+\t\t} else\n+\t\t\tfinished = _events->delay(19000);\n+\n+\t\t_events->clearEvents();\n+\t\tfinished = _events->delay(500);\n+\t}\n+\n+\tif (finished)\n+\t\tfinished = _animation->play(\"COFF3\", 1, 0, true, 3);\n+\n+\tif (finished)\n+\t\tfinished = _animation->play(\"COFF4\", 1, 0, false, 3);\n+\n+\tif (finished)\n+\t\tfinished = scrollCredits();\n+\n+\tif (finished)\n+\t\t_screen->fadeToBlack(3);\n+\n+\t_titleOverride = \"\";\n+\t_soundOverride = \"\";\n+\treturn finished;\n+}\n+\n+/**\n+ * Load the default inventory for the game, which includes both the initial active inventory,\n+ * as well as special pending inventory items which can appear automatically in the player's\n+ * inventory once given required flags are set\n+ */\n+void ScalpelEngine::loadInventory() {\n+\tInventory &inv = *_inventory;\n+\n+\t// Initial inventory\n+\tinv._holdings = 2;","path":"engines/sherlock/scalpel/scalpel.cpp","position":473,"original_position":473,"commit_id":"f622d7471e7f04f92c728cab7de9dd0a109886c3","original_commit_id":"f622d7471e7f04f92c728cab7de9dd0a109886c3","user":{"login":"wjp","id":327756,"avatar_url":"https://avatars.githubusercontent.com/u/327756?v=3","gravatar_id":"","url":"https://api.github.com/users/wjp","html_url":"https://github.com/wjp","followers_url":"https://api.github.com/users/wjp/followers","following_url":"https://api.github.com/users/wjp/following{/other_user}","gists_url":"https://api.github.com/users/wjp/gists{/gist_id}","starred_url":"https://api.github.com/users/wjp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjp/subscriptions","organizations_url":"https://api.github.com/users/wjp/orgs","repos_url":"https://api.github.com/users/wjp/repos","events_url":"https://api.github.com/users/wjp/events{/privacy}","received_events_url":"https://api.github.com/users/wjp/received_events","type":"User","site_admin":false},"body":"It's rather ugly/dangerous that you're expecting ScalpelEngine to properly keep the state of Inventory consistent. (_holdings vs actual contents)","created_at":"2015-05-09T12:00:59Z","updated_at":"2015-05-09T12:00:59Z","html_url":"https://github.com/scummvm/scummvm/pull/595#discussion_r29992150","pull_request_url":"https://api.github.com/repos/scummvm/scummvm/pulls/595","_links":{"self":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/comments/29992150"},"html":{"href":"https://github.com/scummvm/scummvm/pull/595#discussion_r29992150"},"pull_request":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/595"}}},"pull_request":{"url":"https://api.github.com/repos/scummvm/scummvm/pulls/595","id":34967668,"html_url":"https://github.com/scummvm/scummvm/pull/595","diff_url":"https://github.com/scummvm/scummvm/pull/595.diff","patch_url":"https://github.com/scummvm/scummvm/pull/595.patch","issue_url":"https://api.github.com/repos/scummvm/scummvm/issues/595","number":595,"state":"open","locked":false,"title":"SHERLOCK: Support for The Lost Files of Sherlock Holmes - The Case of the Serrated Scalpel","user":{"login":"dreammaster","id":552828,"avatar_url":"https://avatars.githubusercontent.com/u/552828?v=3","gravatar_id":"","url":"https://api.github.com/users/dreammaster","html_url":"https://github.com/dreammaster","followers_url":"https://api.github.com/users/dreammaster/followers","following_url":"https://api.github.com/users/dreammaster/following{/other_user}","gists_url":"https://api.github.com/users/dreammaster/gists{/gist_id}","starred_url":"https://api.github.com/users/dreammaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreammaster/subscriptions","organizations_url":"https://api.github.com/users/dreammaster/orgs","repos_url":"https://api.github.com/users/dreammaster/repos","events_url":"https://api.github.com/users/dreammaster/events{/privacy}","received_events_url":"https://api.github.com/users/dreammaster/received_events","type":"User","site_admin":false},"body":"This is a pull request for the game  The Lost Files of Sherlock Holmes - The Case of the Serrated Scalpel. It was the first of two games using a custom-built engine developed by Mythos Software, and published by EA. The second game of which being the The Case of the Rose Tattoo. The game is completable, although I'm still actively testing the game. There are only a few things left to do:\r\n\r\n* Implement sound support. There's some in-progress work on this that hasn't yet been committed in.\r\n* The game has an infamous (at least here in the group) initial logo display that uses a separate executable just for that which is, of all things, using the TsAGE engine. :). This still needs to be disassembled at some point; but since it's just a logo display, and not even a cutscene, I don't think this should be considered an obstacle to merging or even announcing official support for the game. Rather, a nice to have for the future.\r\n\r\nOther than that, the code base is pretty solid. Apart from minor bugs that I'm still fixing as I identify them, the engine is fairly solid. Everything's broken up into clean classes, and I've kept the code I consider to be specific to Serrated Scalpel separate in it's own descendant class of the main \"SherlockEngine\" class. That way, it should be easier to add in support for the Rose Tattoo as well later on, without major refactoring","created_at":"2015-05-07T23:13:22Z","updated_at":"2015-05-09T12:00:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b193b50cb50739765247acdac4ef63de0d6965f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scummvm/scummvm/pulls/595/commits","review_comments_url":"https://api.github.com/repos/scummvm/scummvm/pulls/595/comments","review_comment_url":"https://api.github.com/repos/scummvm/scummvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scummvm/scummvm/issues/595/comments","statuses_url":"https://api.github.com/repos/scummvm/scummvm/statuses/f622d7471e7f04f92c728cab7de9dd0a109886c3","head":{"label":"dreammaster:sherlock","ref":"sherlock","sha":"f622d7471e7f04f92c728cab7de9dd0a109886c3","user":{"login":"dreammaster","id":552828,"avatar_url":"https://avatars.githubusercontent.com/u/552828?v=3","gravatar_id":"","url":"https://api.github.com/users/dreammaster","html_url":"https://github.com/dreammaster","followers_url":"https://api.github.com/users/dreammaster/followers","following_url":"https://api.github.com/users/dreammaster/following{/other_user}","gists_url":"https://api.github.com/users/dreammaster/gists{/gist_id}","starred_url":"https://api.github.com/users/dreammaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreammaster/subscriptions","organizations_url":"https://api.github.com/users/dreammaster/orgs","repos_url":"https://api.github.com/users/dreammaster/repos","events_url":"https://api.github.com/users/dreammaster/events{/privacy}","received_events_url":"https://api.github.com/users/dreammaster/received_events","type":"User","site_admin":false},"repo":{"id":1364360,"name":"scummvm","full_name":"dreammaster/scummvm","owner":{"login":"dreammaster","id":552828,"avatar_url":"https://avatars.githubusercontent.com/u/552828?v=3","gravatar_id":"","url":"https://api.github.com/users/dreammaster","html_url":"https://github.com/dreammaster","followers_url":"https://api.github.com/users/dreammaster/followers","following_url":"https://api.github.com/users/dreammaster/following{/other_user}","gists_url":"https://api.github.com/users/dreammaster/gists{/gist_id}","starred_url":"https://api.github.com/users/dreammaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreammaster/subscriptions","organizations_url":"https://api.github.com/users/dreammaster/orgs","repos_url":"https://api.github.com/users/dreammaster/repos","events_url":"https://api.github.com/users/dreammaster/events{/privacy}","received_events_url":"https://api.github.com/users/dreammaster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dreammaster/scummvm","description":"ScummVM main repository","fork":true,"url":"https://api.github.com/repos/dreammaster/scummvm","forks_url":"https://api.github.com/repos/dreammaster/scummvm/forks","keys_url":"https://api.github.com/repos/dreammaster/scummvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dreammaster/scummvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dreammaster/scummvm/teams","hooks_url":"https://api.github.com/repos/dreammaster/scummvm/hooks","issue_events_url":"https://api.github.com/repos/dreammaster/scummvm/issues/events{/number}","events_url":"https://api.github.com/repos/dreammaster/scummvm/events","assignees_url":"https://api.github.com/repos/dreammaster/scummvm/assignees{/user}","branches_url":"https://api.github.com/repos/dreammaster/scummvm/branches{/branch}","tags_url":"https://api.github.com/repos/dreammaster/scummvm/tags","blobs_url":"https://api.github.com/repos/dreammaster/scummvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dreammaster/scummvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dreammaster/scummvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/dreammaster/scummvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dreammaster/scummvm/statuses/{sha}","languages_url":"https://api.github.com/repos/dreammaster/scummvm/languages","stargazers_url":"https://api.github.com/repos/dreammaster/scummvm/stargazers","contributors_url":"https://api.github.com/repos/dreammaster/scummvm/contributors","subscribers_url":"https://api.github.com/repos/dreammaster/scummvm/subscribers","subscription_url":"https://api.github.com/repos/dreammaster/scummvm/subscription","commits_url":"https://api.github.com/repos/dreammaster/scummvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/dreammaster/scummvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/dreammaster/scummvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/dreammaster/scummvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/dreammaster/scummvm/contents/{+path}","compare_url":"https://api.github.com/repos/dreammaster/scummvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dreammaster/scummvm/merges","archive_url":"https://api.github.com/repos/dreammaster/scummvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dreammaster/scummvm/downloads","issues_url":"https://api.github.com/repos/dreammaster/scummvm/issues{/number}","pulls_url":"https://api.github.com/repos/dreammaster/scummvm/pulls{/number}","milestones_url":"https://api.github.com/repos/dreammaster/scummvm/milestones{/number}","notifications_url":"https://api.github.com/repos/dreammaster/scummvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dreammaster/scummvm/labels{/name}","releases_url":"https://api.github.com/repos/dreammaster/scummvm/releases{/id}","created_at":"2011-02-14T07:44:28Z","updated_at":"2015-02-20T01:58:11Z","pushed_at":"2015-05-09T11:10:19Z","git_url":"git://github.com/dreammaster/scummvm.git","ssh_url":"git@github.com:dreammaster/scummvm.git","clone_url":"https://github.com/dreammaster/scummvm.git","svn_url":"https://github.com/dreammaster/scummvm","homepage":"http://www.scummvm.org/","size":169570,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"scummvm:master","ref":"master","sha":"04931d040085d77d031290fda57ca2c5dc486f54","user":{"login":"scummvm","id":365181,"avatar_url":"https://avatars.githubusercontent.com/u/365181?v=3","gravatar_id":"","url":"https://api.github.com/users/scummvm","html_url":"https://github.com/scummvm","followers_url":"https://api.github.com/users/scummvm/followers","following_url":"https://api.github.com/users/scummvm/following{/other_user}","gists_url":"https://api.github.com/users/scummvm/gists{/gist_id}","starred_url":"https://api.github.com/users/scummvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scummvm/subscriptions","organizations_url":"https://api.github.com/users/scummvm/orgs","repos_url":"https://api.github.com/users/scummvm/repos","events_url":"https://api.github.com/users/scummvm/events{/privacy}","received_events_url":"https://api.github.com/users/scummvm/received_events","type":"Organization","site_admin":false},"repo":{"id":1358940,"name":"scummvm","full_name":"scummvm/scummvm","owner":{"login":"scummvm","id":365181,"avatar_url":"https://avatars.githubusercontent.com/u/365181?v=3","gravatar_id":"","url":"https://api.github.com/users/scummvm","html_url":"https://github.com/scummvm","followers_url":"https://api.github.com/users/scummvm/followers","following_url":"https://api.github.com/users/scummvm/following{/other_user}","gists_url":"https://api.github.com/users/scummvm/gists{/gist_id}","starred_url":"https://api.github.com/users/scummvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scummvm/subscriptions","organizations_url":"https://api.github.com/users/scummvm/orgs","repos_url":"https://api.github.com/users/scummvm/repos","events_url":"https://api.github.com/users/scummvm/events{/privacy}","received_events_url":"https://api.github.com/users/scummvm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scummvm/scummvm","description":"ScummVM main repository","fork":false,"url":"https://api.github.com/repos/scummvm/scummvm","forks_url":"https://api.github.com/repos/scummvm/scummvm/forks","keys_url":"https://api.github.com/repos/scummvm/scummvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scummvm/scummvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scummvm/scummvm/teams","hooks_url":"https://api.github.com/repos/scummvm/scummvm/hooks","issue_events_url":"https://api.github.com/repos/scummvm/scummvm/issues/events{/number}","events_url":"https://api.github.com/repos/scummvm/scummvm/events","assignees_url":"https://api.github.com/repos/scummvm/scummvm/assignees{/user}","branches_url":"https://api.github.com/repos/scummvm/scummvm/branches{/branch}","tags_url":"https://api.github.com/repos/scummvm/scummvm/tags","blobs_url":"https://api.github.com/repos/scummvm/scummvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scummvm/scummvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scummvm/scummvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/scummvm/scummvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scummvm/scummvm/statuses/{sha}","languages_url":"https://api.github.com/repos/scummvm/scummvm/languages","stargazers_url":"https://api.github.com/repos/scummvm/scummvm/stargazers","contributors_url":"https://api.github.com/repos/scummvm/scummvm/contributors","subscribers_url":"https://api.github.com/repos/scummvm/scummvm/subscribers","subscription_url":"https://api.github.com/repos/scummvm/scummvm/subscription","commits_url":"https://api.github.com/repos/scummvm/scummvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/scummvm/scummvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/scummvm/scummvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/scummvm/scummvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/scummvm/scummvm/contents/{+path}","compare_url":"https://api.github.com/repos/scummvm/scummvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scummvm/scummvm/merges","archive_url":"https://api.github.com/repos/scummvm/scummvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scummvm/scummvm/downloads","issues_url":"https://api.github.com/repos/scummvm/scummvm/issues{/number}","pulls_url":"https://api.github.com/repos/scummvm/scummvm/pulls{/number}","milestones_url":"https://api.github.com/repos/scummvm/scummvm/milestones{/number}","notifications_url":"https://api.github.com/repos/scummvm/scummvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scummvm/scummvm/labels{/name}","releases_url":"https://api.github.com/repos/scummvm/scummvm/releases{/id}","created_at":"2011-02-12T15:50:57Z","updated_at":"2015-05-07T20:30:55Z","pushed_at":"2015-05-09T11:10:20Z","git_url":"git://github.com/scummvm/scummvm.git","ssh_url":"git@github.com:scummvm/scummvm.git","clone_url":"https://github.com/scummvm/scummvm.git","svn_url":"https://github.com/scummvm/scummvm","homepage":"http://www.scummvm.org/","size":228975,"stargazers_count":502,"watchers_count":502,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":255,"mirror_url":null,"open_issues_count":26,"forks":255,"open_issues":26,"watchers":502,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/595"},"html":{"href":"https://github.com/scummvm/scummvm/pull/595"},"issue":{"href":"https://api.github.com/repos/scummvm/scummvm/issues/595"},"comments":{"href":"https://api.github.com/repos/scummvm/scummvm/issues/595/comments"},"review_comments":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/595/comments"},"review_comment":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/595/commits"},"statuses":{"href":"https://api.github.com/repos/scummvm/scummvm/statuses/f622d7471e7f04f92c728cab7de9dd0a109886c3"}}}}