diff options
author | Filippos Karapetis | 2008-06-02 22:41:58 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-06-02 22:41:58 +0000 |
commit | 5789bbc836d7b26d8d1bd52fbf2a26730ed66013 (patch) | |
tree | d13c7c183a05296b92aef36bf9037f3b961dfa8f /engines | |
parent | 6f09c5a9286f97a1fac6e85fa4092295bc779440 (diff) | |
download | scummvm-rg350-5789bbc836d7b26d8d1bd52fbf2a26730ed66013.tar.gz scummvm-rg350-5789bbc836d7b26d8d1bd52fbf2a26730ed66013.tar.bz2 scummvm-rg350-5789bbc836d7b26d8d1bd52fbf2a26730ed66013.zip |
elige_en_barra -> selectVerbFromBar
comprueba -> verify1
x_barra -> verbBarX
conta_vez -> startTime
diff_vez -> timeDiff
Some cleanup
svn-id: r32507
Diffstat (limited to 'engines')
-rw-r--r-- | engines/drascula/drascula.cpp | 41 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 10 | ||||
-rw-r--r-- | engines/drascula/staticdata.h | 2 |
3 files changed, 26 insertions, 27 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 4c3580caf1..c21ceebdb0 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -630,17 +630,17 @@ bool DrasculaEngine::escoba() { if (button_izq == 1 && menuBar == 1) { delay(100); - elige_en_barra(); + selectVerbFromBar(); if (currentChapter != 3) cont_sv = 0; } else if (button_izq == 1 && takeObject == 0) { delay(100); - if (comprueba1()) + if (verify1()) return true; if (currentChapter != 3) cont_sv = 0; } else if (button_izq == 1 && takeObject == 1) { - if (comprueba2()) + if (verify2()) return true; if (currentChapter != 3) cont_sv = 0; @@ -1153,20 +1153,19 @@ void DrasculaEngine::checkObjects() { hasName = 0; } -void DrasculaEngine::elige_en_barra() { - int n, num_verbo = -1; - - for (n = 0; n < 7; n++) - if (mouseX > x_barra[n] && mouseX < x_barra[n + 1]) - num_verbo = n; +void DrasculaEngine::selectVerbFromBar() { + for (int n = 0; n < 7; n++) { + if (mouseX > verbBarX[n] && mouseX < verbBarX[n + 1]) { + selectVerb(n); + return; + } + } - if (num_verbo < 1) - withoutVerb(); - else - selectVerb(num_verbo); + // no verb selected + withoutVerb(); } -bool DrasculaEngine::comprueba1() { +bool DrasculaEngine::verify1() { int l; if (menuScreen == 1) @@ -1209,7 +1208,7 @@ bool DrasculaEngine::comprueba1() { return false; } -bool DrasculaEngine::comprueba2() { +bool DrasculaEngine::verify2() { int l; if (menuScreen == 1) { @@ -2223,7 +2222,7 @@ void DrasculaEngine::startWalking() { else characterMoved = 0; } - conta_vez = getTime(); + startTime = getTime(); } void DrasculaEngine::pon_hare() { @@ -2394,9 +2393,9 @@ void DrasculaEngine::clearMenu() { int n, sobre_verbo = 1; for (n = 0; n < 7; n++) { - if (mouseX > x_barra[n] && mouseX < x_barra[n + 1]) + if (mouseX > verbBarX[n] && mouseX < verbBarX[n + 1]) sobre_verbo = 0; - copyRect(OBJWIDTH * n, OBJHEIGHT * sobre_verbo, x_barra[n], 2, + copyRect(OBJWIDTH * n, OBJHEIGHT * sobre_verbo, verbBarX[n], 2, OBJWIDTH, OBJHEIGHT, backSurface, screenSurface); sobre_verbo = 1; } @@ -3036,10 +3035,10 @@ void DrasculaEngine::saveGame(char gameName[]) { } void DrasculaEngine::increaseFrameNum() { - diff_vez = getTime() - conta_vez; + timeDiff = getTime() - startTime; - if (diff_vez >= 6) { - conta_vez = getTime(); + if (timeDiff >= 6) { + startTime = getTime(); num_frame++; if (num_frame == 6) num_frame = 0; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 3552bb1c0f..3d2306bbdb 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -270,7 +270,7 @@ public: int near, far; int sentido_final, walkToObject; int objExit; - int diff_vez, conta_vez; + int timeDiff, startTime; int hasAnswer; int conta_blind_vez; int changeColor; @@ -399,9 +399,9 @@ public: void lleva_al_hare(int, int); void moveCursor(); void checkObjects(); - void elige_en_barra(); - bool comprueba1(); - bool comprueba2(); + void selectVerbFromBar(); + bool verify1(); + bool verify2(); Common::KeyCode getScan(); void selectVerb(int); void mesa(); @@ -669,7 +669,7 @@ extern const char *_textd1[][11]; extern const ItemLocation itemLocations[]; extern int frame_x[20]; extern const int x_pol[44], y_pol[44]; -extern const int x_barra[]; +extern const int verbBarX[]; extern const int x1d_menu[], y1d_menu[]; extern const CharInfo charMap[]; diff --git a/engines/drascula/staticdata.h b/engines/drascula/staticdata.h index c5fb4c0679..acd9e308c6 100644 --- a/engines/drascula/staticdata.h +++ b/engines/drascula/staticdata.h @@ -116,7 +116,7 @@ const int y_pol[44] = {0, 1, 1, 1, 1, 1, 1, 1, 27, 27, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27, 1, 1}; -const int x_barra[] = {6, 51, 96, 141, 186, 232, 276, 321}; +const int verbBarX[] = {6, 51, 96, 141, 186, 232, 276, 321}; const int x1d_menu[] = {280, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0}; |