diff options
-rw-r--r-- | engines/drascula/drascula.cpp | 45 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 1 | ||||
-rw-r--r-- | engines/drascula/rooms.cpp | 16 | ||||
-rw-r--r-- | engines/drascula/staticdata.h | 7 |
4 files changed, 25 insertions, 44 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 650f941b1f..6b561d4853 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -1420,13 +1420,12 @@ bool DrasculaEngine::saveLoadScreen() { void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { int textPos[8]; - int letterY = 0, letterX = 0, h, length; - length = strlen(said); + int letterY = 0, letterX = 0, c, i; - for (h = 0; h < length; h++) { - int c = toupper(said[h]); + for (uint h = 0; h < strlen(said); h++) { + c = toupper(said[h]); - for (int i = 0; i < CHARMAP_SIZE; i++) { + for (i = 0; i < CHARMAP_SIZE; i++) { if (c == charMap[i].inChar) { letterX = charMap[i].mappedChar; @@ -1464,10 +1463,9 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { void DrasculaEngine::print_abc_opc(const char *said, int screenX, int screenY, int game) { int textPos[6]; - int signY, letterY, letterX = 0, h, length; - length = strlen(said); + int signY, letterY, letterX = 0; - for (h = 0; h < length; h++) { + for (uint h = 0; h < strlen(said); h++) { if (game == 1) { letterY = 6; signY = 15; @@ -1780,7 +1778,6 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) { int cnt = 2; int dataSize = 0; - AuxBuffLast = (byte *)malloc(65000); AuxBuffDes = (byte *)malloc(65000); _arj.open(animationFile); @@ -1800,7 +1797,6 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) { _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); _system->updateScreen(); setPalette(cPal); - memcpy(AuxBuffLast, AuxBuffDes, 64000); WaitForNext(FPS); while (cnt < NFrames) { dataSize = _arj.readSint32LE(); @@ -1810,7 +1806,7 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) { loadPCX(AuxBuffOrg); free(AuxBuffOrg); for (j = 0;j < 64000; j++) { - VGA[j] = AuxBuffLast[j] = AuxBuffDes[j] ^ AuxBuffLast[j]; + VGA[j] = AuxBuffDes[j] ^ VGA[j]; } _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); _system->updateScreen(); @@ -1822,7 +1818,6 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) { if (key != 0) break; } - free(AuxBuffLast); free(AuxBuffDes); _arj.close(); @@ -2753,8 +2748,7 @@ void DrasculaEngine::Des_RLE(byte *BufferRLE, byte *MiVideoRLE) { } void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) { - int x; - for (x = 0; x < 64000; x++) + for (int x = 0; x < 64000; x++) OldScreen[x] ^= NewScreen[x]; } @@ -2770,9 +2764,7 @@ byte *DrasculaEngine::loadPCX(byte *NamePcc) { unsigned int X = 0; unsigned int fExit = 0; char ch, rep; - byte *AuxPun; - - AuxPun = AuxBuffDes; + byte *AuxPun = AuxBuffDes; while (!fExit) { ch = *NamePcc++; @@ -2825,10 +2817,10 @@ void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int w copyRectClip(pixelPos, dir_inicio, dir_fin); - pixelX = pixelX + totalX; + pixelX += totalX; } pixelX = xx1; - pixelY = pixelY + totalY; + pixelY += totalY; } } @@ -3008,7 +3000,7 @@ bool DrasculaEngine::checkMenuFlags() { void DrasculaEngine::converse(int index) { char fileName[20]; sprintf(fileName, "op_%d.cal", index); - int h; + uint h; int game1 = 1, game2 = 1, game3 = 1, game4 = 1; char phrase1[78]; char phrase2[78]; @@ -3018,7 +3010,6 @@ void DrasculaEngine::converse(int index) { char sound2[13]; char sound3[13]; char sound4[13]; - int length; int answer1; int answer2; int answer3; @@ -3070,23 +3061,19 @@ void DrasculaEngine::converse(int index) { answer3 = 15; } - length = strlen(phrase1); - for (h = 0; h < length; h++) + for (h = 0; h < strlen(phrase1); h++) if (phrase1[h] == (char)0xa7) phrase1[h] = ' '; - length = strlen(phrase2); - for (h = 0; h < length; h++) + for (h = 0; h < strlen(phrase2); h++) if (phrase2[h] == (char)0xa7) phrase2[h] = ' '; - length = strlen(phrase3); - for (h = 0; h < length; h++) + for (h = 0; h < strlen(phrase3); h++) if (phrase3[h] == (char)0xa7) phrase3[h] = ' '; - length = strlen(phrase4); - for (h = 0; h < length; h++) + for (h = 0; h < strlen(phrase4); h++) if (phrase4[h] == (char)0xa7) phrase4[h] = ' '; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index ffd9068575..d93a33a93d 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -464,7 +464,6 @@ public: int playFrameSSN(); byte *AuxBuffOrg; - byte *AuxBuffLast; byte *AuxBuffDes; byte *pointer; diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index 7c2930e642..008596baf3 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1494,9 +1494,7 @@ bool DrasculaEngine::checkAction(int fl) { chooseObject(21); removeObject(18); removeObject(19); - } else if ((pickedObject == 14 && fl == 19) || (pickedObject == 19 && fl == 14)) - talk(484); - else if (pickedObject == kVerbLook && fl == 9) { + } else if (pickedObject == kVerbLook && fl == 9) { talk(482); talk(483); } else if (pickedObject == kVerbLook && fl == 19) { @@ -1524,10 +1522,6 @@ bool DrasculaEngine::checkAction(int fl) { // Note: the original check was strcmp(num_room, "18.alg") if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18) talk(315); - else if (pickedObject == 13 && fl == 50) - talk(156); - else if (pickedObject == 20 && fl == 50) - talk(163); else hasAnswer = 0; } else if (currentChapter == 3) { @@ -1541,21 +1535,15 @@ bool DrasculaEngine::checkAction(int fl) { talk(178); else if (pickedObject == 8 && fl == 50 && flags[18] == 0) talk(481); - else if (pickedObject == 9 && fl == 50) - talk(484); else if (pickedObject == 12 && fl == 50 && flags[18] == 0) talk(487); - else if (pickedObject == 20 && fl == 50) - talk(487); else if (roomNumber == 21) { if (room(21, fl)) return true; } else hasAnswer = 0; } else if (currentChapter == 5) { - if (pickedObject == 20 && fl == 50) - talk(487); - else if (roomNumber == 56) { + if (roomNumber == 56) { if (room(56, fl)) return true; } else diff --git a/engines/drascula/staticdata.h b/engines/drascula/staticdata.h index c9350f251c..76dfcda3f0 100644 --- a/engines/drascula/staticdata.h +++ b/engines/drascula/staticdata.h @@ -574,6 +574,8 @@ RoomTalkAction roomActions[] = { { 200, 4, kVerbLook, 28, 328 }, { 200, 4, kVerbTalk, 15, 118 }, { 200, 4, kVerbOpen, 15, 119 }, + { 200, 4, 14, 19, 484 }, + { 200, 4, 19, 14, 484 }, // ---------------------------------- { 200, 5, kVerbLook, 7, 478 }, { 200, 5, kVerbLook, 8, 120 }, @@ -605,6 +607,8 @@ RoomTalkAction roomActions[] = { { 201, 2, kVerbMove, 50, 312 }, { 201, 2, kVerbPick, 50, 313 }, { 201, 2, kVerbTalk, 50, 314 }, + { 201, 2, 13, 50, 156 }, + { 201, 2, 20, 50, 163 }, // ---------------------------------- { 201, 3, kVerbLook, 50, 309 }, { 201, 3, kVerbOpen, 50, 310 }, @@ -619,6 +623,8 @@ RoomTalkAction roomActions[] = { { 201, 4, kVerbMove, 50, 312 }, { 201, 4, kVerbPick, 50, 313 }, { 201, 4, kVerbTalk, 50, 314 }, + { 201, 4, 9, 50, 484 }, + { 201, 4, 20, 50, 487 }, // ---------------------------------- { 201, 5, kVerbLook, 50, 309 }, // Originally these are with { 201, 5, kVerbOpen, 50, 310 }, // completely wrong voices @@ -626,6 +632,7 @@ RoomTalkAction roomActions[] = { { 201, 5, kVerbMove, 50, 312 }, { 201, 5, kVerbPick, 50, 313 }, { 201, 5, kVerbTalk, 50, 314 }, + { 201, 5, 20, 50, 487 }, // ---------------------------------- { 201, 6, kVerbOpen, 50, 310 }, { 201, 6, kVerbClose, 50, 311 }, |