Skip to content

Commit

Permalink
SHERLOCK: More syntactic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 19, 2015
1 parent dac49dd commit fa35249
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions engines/sherlock/journal.cpp
Expand Up @@ -1121,8 +1121,8 @@ int Journal::getSearchString(bool printError) {
} else if (keyState.keycode == Common::KEYCODE_ESCAPE) {
screen.vgaBar(Common::Rect(xp, yp, xp + 8, yp + 9), BUTTON_MIDDLE);
done = -1;
} else if (keyState.ascii >= ' ' && keyState.keycode <= 'z' && keyState.keycode != Common::KEYCODE_AT &&
name.size() < JOURNAL_SEACRH_MAX_CHARS && (xp + screen.charWidth(keyState.keycode)) < JOURNAL_SEARCH_RIGHT) {
} else if (keyState.ascii >= ' ' && keyState.ascii <= 'z' && keyState.keycode != Common::KEYCODE_AT &&
name.size() < JOURNAL_SEACRH_MAX_CHARS && (xp + screen.charWidth(keyState.ascii)) < JOURNAL_SEARCH_RIGHT) {
char ch = toupper(keyState.ascii);
screen.vgaBar(Common::Rect(xp, yp, xp + 8, yp + 9), BUTTON_MIDDLE);
screen.print(Common::Point(xp, yp), TALK_FOREGROUND, "%c", ch);
Expand Down
6 changes: 3 additions & 3 deletions engines/sherlock/saveload.cpp
Expand Up @@ -385,7 +385,7 @@ bool SaveManager::checkGameOnScreen(int slot) {
return false;
}

bool SaveManager::getFilename(int slot) {
bool SaveManager::promptForFilename(int slot) {
Events &events = *_vm->_events;
Scene &scene = *_vm->_scene;
Screen &screen = *_vm->_screen;
Expand Down Expand Up @@ -455,8 +455,8 @@ bool SaveManager::getFilename(int slot) {
done = -1;
}

if (keyState.keycode >= ' ' && keyState.keycode <= 'z' && saveName.size() < 50
&& (xp + screen.charWidth(keyState.keycode)) < 308) {
if (keyState.ascii >= ' ' && keyState.ascii <= 'z' && saveName.size() < 50
&& (xp + screen.charWidth(keyState.ascii)) < 308) {
char c = (char)keyState.ascii;

screen.vgaBar(Common::Rect(xp, yp - 1, xp + 8, yp + 9), INV_BACKGROUND);
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/saveload.h
Expand Up @@ -133,7 +133,7 @@ class SaveManager {
/**
* Prompts the user to enter a filename in a given slot
*/
bool getFilename(int slot);
bool promptForFilename(int slot);
};

} // End of namespace Sherlock
Expand Down
17 changes: 9 additions & 8 deletions engines/sherlock/scalpel/scalpel.cpp
Expand Up @@ -63,32 +63,33 @@ 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 }
};

#define MAX_PEOPLE 66

const byte STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
static const byte STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
{ 1, 0, 0 }, // Sherlock Holmes
{ 6, 0, 0 }, // Dr. Watson
{ 4, 0, 0 }, // Inspector Lestrade
Expand Down Expand Up @@ -157,7 +158,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 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
Expand Down Expand Up @@ -381,12 +382,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);
Expand Down
4 changes: 2 additions & 2 deletions engines/sherlock/user_interface.cpp
Expand Up @@ -783,7 +783,7 @@ void UserInterface::doEnvControl() {
if (saves.checkGameOnScreen(_selector))
_oldSelector = _selector;

if (saves.getFilename(_selector)) {
if (saves.promptForFilename(_selector)) {
saves.saveGame(_selector + 1, saves._savegames[_selector]);

banishWindow(1);
Expand Down Expand Up @@ -954,7 +954,7 @@ void UserInterface::doEnvControl() {
if (saves.checkGameOnScreen(_selector))
_oldSelector = _selector;

if (saves.getFilename(_selector)) {
if (saves.promptForFilename(_selector)) {
saves.saveGame(_selector + 1, saves._savegames[_selector]);
banishWindow();
_windowBounds.top = CONTROLS_Y1;
Expand Down

0 comments on commit fa35249

Please sign in to comment.