/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $URL$ * $Id$ * */ #include "drascula/drascula.h" namespace Drascula { void DrasculaEngine::talk_igor_dch(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = { 56, 82, 108, 134, 160, 186, 212, 238 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); pon_igor(); pon_dr(); copyBackground(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, dir_dibujo1, dir_zona_pantalla); copyRect(x_talk[cara], 148, x_igor + 17, y_igor, 25, 24, dir_hare_frente, dir_zona_pantalla); updateRefresh(); if (con_voces == 0) centra_texto(dicho, x_igor + 26, y_igor); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); pon_igor(); pon_dr(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_dr_izq(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = { 1, 40, 79, 118, 157, 196, 235, 274 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(ROJO); 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: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); pon_igor(); pon_dr(); if (num_ejec == 6) pon_hare(); copyBackground(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla); if (num_ejec == 6) copyRect(x_talk[cara], 90, x_dr, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla); else copyRect(x_talk[cara], 90, x_dr, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla); updateRefresh(); if (con_voces == 0) centra_texto(dicho, x_dr + 19, y_dr); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); pon_igor(); pon_dr(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_dr_dch(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = { 1, 40, 79, 118, 157, 196, 235, 274 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(ROJO); 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: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); pon_igor(); pon_dr(); if (num_ejec == 6) pon_hare(); copyBackground(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla); if (num_ejec != 6) copyRect(x_talk[cara], 58, x_dr + 7, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla); else copyRect(x_talk[cara], 58, x_dr + 7, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla); updateRefresh(); if (con_voces == 0) centra_texto(dicho, x_dr + 19, y_dr); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } if (num_ejec == 6) updateRoom(); pon_igor(); pon_dr(); if (num_ejec == 6) pon_hare(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_solo(const char *dicho, const char *filename) { int tiempou; long tiempol; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); if (num_ejec == 1) color_abc(color_solo); else if (num_ejec == 4) color_abc(ROJO); 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); } if (num_ejec == 6) copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); bucless: if (con_voces == 0) { if (num_ejec == 1) centra_texto(dicho, 156, 90); else if (num_ejec == 6) centra_texto(dicho, 213, 72); else if (num_ejec == 5) centra_texto(dicho, 173, 92); } updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } if (num_ejec == 6) { copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } } void DrasculaEngine::talk_igor_frente(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = { 56, 86, 116, 146, 176, 206, 236, 266 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); if (num_ejec == 1 || num_ejec == 4) pon_igor(); if (num_ejec == 1) pon_dr(); if (num_ejec == 1 || num_ejec == 6) copyBackground(x_igor, y_igor, x_igor, y_igor, 29, 25, dir_dibujo1, dir_zona_pantalla); copyRect(x_talk[cara], 173, x_igor, y_igor, 29, 25, dir_hare_frente, dir_zona_pantalla); updateRefresh(); if (con_voces == 0) centra_texto(dicho, x_igor + 26, y_igor); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } if (num_ejec == 6) { updateRoom(); } if (num_ejec == 1) { copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); pon_igor(); pon_dr(); } updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_tabernero(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(MARRON); 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: if (num_ejec == 1) { if (music_status() == 0) playmusic(musica_room); } else if (num_ejec == 2) { if (music_status() == 0 && flags[11] == 0 && musica_room != 0) playmusic(musica_room); } cara = _rnd->getRandomNumber(8); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 2, 121, 44, 21, 24, dir_hare_dch, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 132, 45); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete(sku); ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_bj(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[5] = { 64, 92, 120, 148, 176 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: if (num_ejec != 5) { cara = _rnd->getRandomNumber(4); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_bj + 2, y_bj - 1, x_bj + 2, y_bj - 1, 27, 40, dir_dibujo1, dir_zona_pantalla); copyRect(x_talk[cara], 99, x_bj + 2, y_bj - 1, 27, 40, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, x_bj + 7, y_bj); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); } else { updateRoom(); if (con_voces == 0) centra_texto(dicho, 93, 80); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk(const char *dicho, const char *filename) { int tiempou; long tiempol; int suma_1_pixel = 0; if (num_ejec != 2) suma_1_pixel = 1; int y_mask_talk = 170; int x_talk_dch[6] = { 1, 25, 49, 73, 97, 121 }; int x_talk_izq[6] = { 145, 169, 193, 217, 241, 265 }; int cara; int longitud; longitud = strlen(dicho); if (num_ejec == 6) { if (flags[0] == 0 && (!strcmp(num_room, "102.alg"))) { talk_pen(dicho, filename); return; } if (flags[0] == 0 && (!strcmp(num_room, "58.alg"))) { talk_pen2(dicho, filename); return; } } tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); if (num_ejec != 2) { if (factor_red[hare_y + alto_hare] == 100) suma_1_pixel = 0; } if (num_ejec == 2) buffer_teclado(); if (num_ejec == 4) { if (strcmp(num_room, "24.alg") || flags[29] == 0) { color_abc(AMARILLO); } } else { color_abc(AMARILLO); } 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: cara = _rnd->getRandomNumber(5); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); if (num_ejec == 2) copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_talk - 1, dir_zona_pantalla, dir_dibujo3); else copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]), (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_zona_pantalla, dir_dibujo3); pon_hare(); if (num_ejec == 2) { if (!strcmp(fondo_y_menu, "99.alg") || !strcmp(fondo_y_menu, "994.alg")) copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_talk - 1, dir_dibujo3, dir_zona_pantalla); } else { copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]), (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_dibujo3, dir_zona_pantalla); } if (sentido_hare == 0) { if (num_ejec == 2) copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 8, hare_y - 1, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla); else reduce_hare_chico(x_talk_izq[cara], y_mask_talk, hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); updateRefresh(); } else if (sentido_hare == 1) { if (num_ejec == 2) copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla); else reduce_hare_chico(x_talk_dch[cara], y_mask_talk, hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); updateRefresh(); } else if (sentido_hare == 2) { if (num_ejec == 2) copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla); else reduce_hare_chico(x_talk_izq[cara], y_mask_talk, suma_1_pixel + hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla); updateRefresh(); } else if (sentido_hare == 3) { if (num_ejec == 2) copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 8, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla); else reduce_hare_chico(x_talk_dch[cara], y_mask_talk, suma_1_pixel + hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk,alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla); updateRefresh(); } if (con_voces == 0) centra_texto(dicho, hare_x, hare_y); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE) term_int = 1; if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); if (num_ejec == 1) { if (music_status() == 0 && flags[11] == 0 && corta_musica == 0) playmusic(musica_room); } } void DrasculaEngine::talk_pianista(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[4] = { 97, 145, 193, 241 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: cara = _rnd->getRandomNumber(3); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 221, 128); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_borracho(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = { 1, 21, 41, 61, 81, 101, 121, 141 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); if (num_ejec == 1) { loadPic("an11y13.alg"); decompressPic(dir_hare_frente, 1); } flags[13] = 1; bebiendo: if (flags[12] == 1) { updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); goto bebiendo; } buffer_teclado(); color_abc(VERDE_OSCURO); if (hay_sb == 1) { sku = new Common::File; sku->open(filename); if (!sku->isOpen()) { error("no puedo abrir archivo de voz\n"); } ctvd_init(2); ctvd_speaker(1); ctvd_output(sku); } bucless: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 29, 177, 50, 19, 19, dir_hare_frente, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 181, 54); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); byte key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); flags[13] = 0; if (num_ejec == 1) { loadPic("96.alg"); decompressPic(dir_hare_frente, 1); } if (num_ejec == 1) { if (music_status() == 0 && flags[11] == 0) playmusic(musica_room); } else if (num_ejec == 2) { if (music_status() == 0 && flags[11] == 0 && musica_room != 0) playmusic(musica_room); } } void DrasculaEngine::talk_vb(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[6] = {1, 27, 53, 79, 105, 131}; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(VON_BRAUN); 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); } copyBackground(vb_x + 5, 64, ANCHOBJ + 1, 0, 25, 27, dir_dibujo1, dir_dibujo3); bucless: if (sentido_vb == 1) { cara = _rnd->getRandomNumber(5); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); pon_hare(); pon_vb(); copyBackground(ANCHOBJ + 1, 0, vb_x + 5, 64, 25, 27, dir_dibujo3, dir_zona_pantalla); copyRect(x_talk[cara], 34, vb_x + 5, 64, 25, 27, dir_hare_frente, dir_zona_pantalla); updateRefresh(); } if (con_voces == 0) centra_texto(dicho, vb_x, 66); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); if (music_status() == 0 && flags[11] == 0 && musica_room != 0) playmusic(musica_room); } void DrasculaEngine::talk_vbpuerta(const char *dicho, const char *filename) { int tiempou; long tiempol; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(VON_BRAUN); 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: updateRoom(); if (con_voces == 0) centra_texto(dicho, 150, 80); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); if (music_status() == 0 && flags[11] == 0 && musica_room != 0) playmusic(musica_room); } void DrasculaEngine::talk_ciego(const char *dicho, const char *filename, const char *sincronia) { byte *num_cara; int p = 0; int pos_ciego[6]; int cara = 0; int longitud; longitud = strlen(dicho); buffer_teclado(); color_abc(VON_BRAUN); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); 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); } pos_ciego[1] = 2; pos_ciego[2] = 73; pos_ciego[3] = 1; pos_ciego[4] = 126; pos_ciego[5] = 149; bucless: copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); pos_ciego[5] = 149; char c = toupper(sincronia[p]); if (c == '0') cara = 0; if (c == '1') cara = 1; if (c == '2') cara = 2; if (c == '3') cara = 3; if (c == '4') cara = 4; if (c == '5') cara = 5; if (c == '6') cara = 6; if (c == '7') cara = 7; if (cara == 0 || cara == 2 || cara == 4 || cara == 6) pos_ciego[0] = 1; else pos_ciego[0] = 132; if (cara == 0) num_cara = dir_dibujo3; else if (cara == 1) num_cara = dir_dibujo3; else if (cara == 2) num_cara = dir_hare_dch; else if (cara == 3) num_cara = dir_hare_dch; else if (cara == 4) num_cara = dir_hare_fondo; else if (cara == 5) num_cara = dir_hare_fondo; else { num_cara = dir_hare_frente; pos_ciego[5] = 146; } copyRectClip( pos_ciego, num_cara, dir_zona_pantalla); if (con_voces == 0) centra_texto(dicho, 310, 71); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(2); p++; int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } } void DrasculaEngine::talk_hacker(const char *dicho, const char *filename) { int tiempou; long tiempol; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); color_abc(AMARILLO); 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: if (con_voces == 0) centra_texto(dicho, 156, 170); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); int key = getscan(); if (key != 0) ctvd_stop(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } key = 0; } void DrasculaEngine::talk_lobo(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[9] = {52, 79, 106, 133, 160, 187, 214, 241, 268}; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); color_abc(ROJO); 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: cara = _rnd->getRandomNumber(8); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 136, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 203, 78); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_mus(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = { 16, 35, 54, 73, 92, 111, 130, 149}; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 197, 64); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_pen(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[8] = {112, 138, 164, 190, 216, 242, 268, 294}; int cara; int longitud; longitud = strlen(dicho); flags[1] = 1; updateRoom(); copyRect(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(AMARILLO); 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: cara = _rnd->getRandomNumber(7); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyRect(x_talk[cara], 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 160, 105); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } flags[1] = 0; copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_pen2(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[5]={122, 148, 174, 200, 226}; int cara; int longitud; longitud = strlen(dicho); flags[1] = 1; tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(AMARILLO); 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: cara = _rnd->getRandomNumber(4); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 195, 107); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } flags[1] = 0; copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_taber2(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[6] = {1, 23, 45, 67, 89, 111}; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(MARRON); 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: cara = _rnd->getRandomNumber(5); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 130, 151, 43, 21, 24, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 132, 45); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_bj_cama(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[5] = {51, 101, 151, 201, 251}; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: cara = _rnd->getRandomNumber(4); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla); copyRect(x_talk[cara], 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 104, 102); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_htel(const char *dicho, const char *filename) { int tiempou; long tiempol; char *num_cara; int x_talk[3] = {1, 94, 187}; int cara, pantalla; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(AMARILLO); 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: cara = _rnd->getRandomNumber(2); pantalla = _rnd->getRandomNumber(2); if (cara == 0 && pantalla == 0) num_cara = (char *)dir_dibujo3; else if (pantalla == 1) num_cara = (char *)dir_hare_frente; else num_cara = (char *)dir_hare_fondo; copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); copyBackground(x_talk[cara], 1, 45, 24, 92, 108, (byte *)num_cara, dir_zona_pantalla); if (con_voces == 0) centra_texto(dicho, 90, 50); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_sinc(const char *dicho, const char *filename, const char *sincronia) { int suma_1_pixel = 1; int y_mask_talk = 170; int x_talk_dch[6] = {1, 25, 49, 73, 97, 121}; int x_talk_izq[6] = {145, 169, 193, 217, 241, 265}; int p, cara = 0; int longitud; longitud = strlen(dicho); buffer_teclado(); color_abc(AMARILLO); if (num_ejec == 1) { if (factor_red[hare_y + alto_hare] == 100) suma_1_pixel = 0; } p = 0; 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: if (sincronia[p] == '0') cara = 0; if (sincronia[p] == '1') cara = 1; if (sincronia[p] == '2') cara = 2; if (sincronia[p] == '3') cara = 3; if (sincronia[p] == '4') cara = 4; if (sincronia[p] == '5') cara = 5; if (sincronia[p] == '6') cara = 6; if (sincronia[p] == '7') cara = 7; copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); if (num_ejec == 2) copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_talk - 1, dir_zona_pantalla, dir_dibujo3); else copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]), (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_zona_pantalla, dir_dibujo3); pon_hare(); if (num_ejec == 2) { if (alto_hare != 56) copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_talk - 1, dir_dibujo3, dir_zona_pantalla); } else copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]), (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_dibujo3, dir_zona_pantalla); if (sentido_hare == 0) { if (num_ejec == 2) copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 8, hare_y - 1, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla); else reduce_hare_chico(x_talk_izq[cara], y_mask_talk, (int)(hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); updateRefresh(); } else if (sentido_hare == 1) { if (num_ejec == 2) copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla); else reduce_hare_chico(x_talk_dch[cara], y_mask_talk, (int)(hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); updateRefresh(); } else if (sentido_hare == 2) { if (num_ejec == 2) copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla); else reduce_hare_chico(x_talk_izq[cara], y_mask_talk, (int)(suma_1_pixel + hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla); updateRefresh(); } else if (sentido_hare == 3) { if (num_ejec == 2) copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 8, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla); else reduce_hare_chico(x_talk_dch[cara], y_mask_talk, (int)(suma_1_pixel + hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla); updateRefresh(); } if (con_voces == 0) centra_texto(dicho, hare_x, hare_y); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); p++; pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } if (num_ejec == 1 && music_status() == 0 && flags[11] == 0) playmusic(musica_room); if (num_ejec == 2 && music_status() == 0 && flags[11] == 0 && musica_room != 0) playmusic(musica_room); } void DrasculaEngine::talk_baul(const char *dicho, const char *filename) { int tiempou; long tiempol; int cara = 0, cara_antes; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); cara_antes = flags[19]; color_abc(MARRON); 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: if (cara == 1) cara = 0; else cara = 1; flags[19] = cara; updateRoom(); if (con_voces == 0) centra_texto(dicho, 263, 69); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(4); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } flags[19] = cara_antes; updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_igorpuerta(const char *dicho, const char *filename) { int tiempou; long tiempol; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: updateRoom(); if (con_voces == 0) centra_texto(dicho, 87, 66); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_igor_sentado(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[4] = { 80, 102, 124, 146 }; int cara; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: cara = _rnd->getRandomNumber(3); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 109, 207, 92, 21, 23, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 221, 102); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1) { if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } void DrasculaEngine::talk_igor_peluca(const char *dicho, const char *filename) { int tiempou; long tiempol; int x_talk[4] = {119, 158, 197, 236}; int cara = 0; int longitud; longitud = strlen(dicho); tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); buffer_teclado(); color_abc(BLANCO); 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: _rnd->getRandomNumber(3); copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); updateRefresh_pre(); copyBackground(x_talk[cara], 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla); pon_hare(); updateRefresh(); if (con_voces == 0) centra_texto(dicho, 221, 102); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pause(3); int key = getscan(); if (key != 0) ctvd_stop(); buffer_teclado(); if (hay_sb == 1){ if (LookForFree() != 0) goto bucless; delete sku; sku = NULL; ctvd_terminate(); } else { longitud = longitud - 2; if (longitud > 0) goto bucless; } updateRoom(); updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } } // End of namespace Drascula