diff options
| -rw-r--r-- | engines/drascula/animation.cpp | 60 | ||||
| -rw-r--r-- | engines/drascula/drascula.h | 3 | ||||
| -rw-r--r-- | engines/drascula/talk.cpp | 96 |
3 files changed, 51 insertions, 108 deletions
diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index c0a6eeaf10..b4be383e49 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -27,9 +27,6 @@ namespace Drascula { -static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 }; -static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 }; - void DrasculaEngine::updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delay) { int x = 0; @@ -401,63 +398,6 @@ void DrasculaEngine::animation_1_1() { decompressPic(backSurface, 1); } -void DrasculaEngine::talk_dr_grande(const char *said, const char *filename) { - int x_talk[4] = {47, 93, 139, 185}; - int face; - int l = 0; - int length = strlen(said); - - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - - color_abc(kColorRed); - - if (hay_sb == 1) { - sku = new Common::File; - sku->open(filename); - if (!sku->isOpen()) { - error("no puedo abrir archivo de voz"); - } - ctvd_init(2); - ctvd_speaker(1); - ctvd_output(sku); - } - -bucless: - - face = _rnd->getRandomNumber(3); - copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); - copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, drawSurface2, screenSurface); - copyBackground(x_talk[face], 1, 171, 68, 45, 48, drawSurface2, screenSurface); - l++; - if (l == 7) - l = 0; - - if (withVoices == 0) - centerText(said, 191, 69); - - updateScreen(0, 0, 0, 0, 320, 200, screenSurface); - - pause(3); - - byte key = getScan(); - if (key == Common::KEYCODE_ESCAPE) - term_int = 1; - - if (key != 0) - ctvd_stop(); - if (hay_sb == 1) { - if (LookForFree() != 0) - goto bucless; - delete sku; - sku = NULL; - ctvd_terminate(); - } else { - length -= 2; - if (length > 0) - goto bucless; - } -} - void DrasculaEngine::animation_2_1() { int l; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index a6e0f598b1..5a43d5702e 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -211,6 +211,9 @@ struct RoomTalkAction; #define COMPLETE_PAL 256 #define HALF_PAL 128 +static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 }; +static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 }; + class DrasculaEngine : public ::Engine { int _gameId; Common::KeyState _keyPressed; diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 0502ca44e6..c4e208b7df 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -28,6 +28,8 @@ namespace Drascula { void DrasculaEngine::talkInit(const char *filename) { + _rnd->setSeed((unsigned int)_system->getMillis() / 2); + if (hay_sb == 1) { sku = new Common::File; sku->open(filename); @@ -51,8 +53,6 @@ void DrasculaEngine::talk_igor_dch(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -113,8 +113,6 @@ void DrasculaEngine::talk_dr_izq(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorRed); talkInit(filename); @@ -181,8 +179,6 @@ void DrasculaEngine::talk_dr_dch(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorRed); talkInit(filename); @@ -244,8 +240,6 @@ bucless: void DrasculaEngine::talk_solo(const char *said, const char *filename) { int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - if (num_ejec == 1) color_abc(color_solo); else if (num_ejec == 4) @@ -295,8 +289,6 @@ void DrasculaEngine::talk_igor_front(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -366,8 +358,6 @@ void DrasculaEngine::talk_tabernero(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorMaroon); talkInit(filename); @@ -428,8 +418,6 @@ void DrasculaEngine::talk_bj(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -514,8 +502,6 @@ void DrasculaEngine::talk(const char *said, const char *filename) { } } - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - if (num_ejec != 2) { if (factor_red[hare_y + alto_hare] == 100) suma_1_pixel = 0; @@ -634,8 +620,6 @@ void DrasculaEngine::talk_pianista(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -684,8 +668,6 @@ void DrasculaEngine::talk_drunk(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - if (num_ejec == 1) { loadPic("an11y13.alg"); decompressPic(frontSurface, 1); @@ -768,8 +750,6 @@ void DrasculaEngine::talk_vb(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorBrown); talkInit(filename); @@ -827,8 +807,6 @@ void DrasculaEngine::talk_vbpuerta(int index) { void DrasculaEngine::talk_vbpuerta(const char *said, const char *filename) { int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorBrown); talkInit(filename); @@ -935,8 +913,6 @@ bucless: void DrasculaEngine::talk_hacker(const char *said, const char *filename) { int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); updateScreen(0, 0, 0, 0, 320, 200, screenSurface); @@ -972,8 +948,6 @@ void DrasculaEngine::talk_wolf(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorRed); talkInit(filename); @@ -1021,8 +995,6 @@ void DrasculaEngine::talk_mus(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -1076,8 +1048,6 @@ void DrasculaEngine::talk_pen(const char *said, const char *filename) { copyRect(44, 145, 145, 105, 25, 29, drawSurface3, screenSurface); updateScreen(0, 0, 0, 0, 320, 200, screenSurface); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorYellow); talkInit(filename); @@ -1129,8 +1099,6 @@ void DrasculaEngine::talk_pen2(const char *said, const char *filename) { flags[1] = 1; - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorYellow); talkInit(filename); @@ -1186,8 +1154,6 @@ void DrasculaEngine::talk_taber2(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorMaroon); talkInit(filename); @@ -1241,8 +1207,6 @@ void DrasculaEngine::talk_bj_bed(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -1291,8 +1255,6 @@ void DrasculaEngine::talk_htel(const char *said, const char *filename) { int face, pantalla; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorYellow); talkInit(filename); @@ -1442,8 +1404,6 @@ void DrasculaEngine::talk_baul(const char *said, const char *filename) { int face = 0, cara_antes; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - cara_antes = flags[19]; color_abc(kColorMaroon); @@ -1490,8 +1450,6 @@ bucless: void DrasculaEngine::talk_igor_door(const char *said, const char *filename) { int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -1527,8 +1485,6 @@ void DrasculaEngine::talk_igor_seated(const char *said, const char *filename) { int face; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -1576,8 +1532,6 @@ void DrasculaEngine::talk_igor_wig(const char *said, const char *filename) { int face = 0; int length = strlen(said); - _rnd->setSeed((unsigned int)_system->getMillis() / 2); - color_abc(kColorWhite); talkInit(filename); @@ -1620,4 +1574,50 @@ bucless: updateScreen(0, 0, 0, 0, 320, 200, screenSurface); } +void DrasculaEngine::talk_dr_grande(const char *said, const char *filename) { + int x_talk[4] = {47, 93, 139, 185}; + int face; + int l = 0; + int length = strlen(said); + + color_abc(kColorRed); + + talkInit(filename); + +bucless: + + face = _rnd->getRandomNumber(3); + copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); + copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, drawSurface2, screenSurface); + copyBackground(x_talk[face], 1, 171, 68, 45, 48, drawSurface2, screenSurface); + l++; + if (l == 7) + l = 0; + + if (withVoices == 0) + centerText(said, 191, 69); + + updateScreen(0, 0, 0, 0, 320, 200, screenSurface); + + pause(3); + + byte key = getScan(); + if (key == Common::KEYCODE_ESCAPE) + term_int = 1; + + if (key != 0) + ctvd_stop(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + sku = NULL; + ctvd_terminate(); + } else { + length -= 2; + if (length > 0) + goto bucless; + } +} + } // End of namespace Drascula |
