2007-07-17 21:35:01 +00:00
|
|
|
|
/* 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.
|
|
|
|
|
*
|
2007-07-27 05:15:24 +00:00
|
|
|
|
* $URL$
|
2007-07-17 21:35:01 +00:00
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "common/stdafx.h"
|
|
|
|
|
|
|
|
|
|
#include "common/events.h"
|
2007-07-28 19:43:26 +00:00
|
|
|
|
#include "common/keyboard.h"
|
2007-07-17 21:35:01 +00:00
|
|
|
|
#include "common/file.h"
|
|
|
|
|
#include "common/savefile.h"
|
|
|
|
|
#include "common/config-manager.h"
|
|
|
|
|
|
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
#include "base/version.h"
|
|
|
|
|
|
|
|
|
|
#include "sound/mixer.h"
|
|
|
|
|
|
|
|
|
|
#include "drascula/drascula.h"
|
2007-07-26 19:52:18 +00:00
|
|
|
|
#include "drascula/texts.h"
|
2007-07-17 21:35:01 +00:00
|
|
|
|
|
|
|
|
|
namespace Drascula {
|
|
|
|
|
|
|
|
|
|
struct GameSettings {
|
|
|
|
|
const char *gameid;
|
|
|
|
|
const char *description;
|
|
|
|
|
byte id;
|
|
|
|
|
uint32 features;
|
|
|
|
|
const char *detectname;
|
|
|
|
|
};
|
|
|
|
|
|
2007-07-17 22:29:09 +00:00
|
|
|
|
static const GameSettings drasculaSettings[] = {
|
2007-07-17 21:35:01 +00:00
|
|
|
|
{"drascula", "Drascula game", 0, 0, 0},
|
|
|
|
|
|
|
|
|
|
{NULL, NULL, 0, 0, NULL}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DrasculaEngine::DrasculaEngine(OSystem *syst) : Engine(syst) {
|
|
|
|
|
|
|
|
|
|
// Setup mixer
|
|
|
|
|
if (!_mixer->isReady()) {
|
|
|
|
|
warning("Sound initialization failed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
|
|
|
|
|
|
|
|
|
const GameSettings *g;
|
|
|
|
|
|
|
|
|
|
const char *gameid = ConfMan.get("gameid").c_str();
|
2007-07-17 22:29:09 +00:00
|
|
|
|
for (g = drasculaSettings; g->gameid; ++g)
|
2007-07-17 21:35:01 +00:00
|
|
|
|
if (!scumm_stricmp(g->gameid, gameid))
|
|
|
|
|
_gameId = g->id;
|
|
|
|
|
|
|
|
|
|
_rnd = new Common::RandomSource();
|
2007-08-01 20:11:32 +00:00
|
|
|
|
|
|
|
|
|
int cd_num = ConfMan.getInt("cdrom");
|
|
|
|
|
if (cd_num >= 0)
|
|
|
|
|
_system->openCD(cd_num);
|
2007-07-17 21:35:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrasculaEngine::~DrasculaEngine() {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
salir_al_dos(0);
|
|
|
|
|
|
|
|
|
|
free(VGA);
|
|
|
|
|
|
2007-07-17 21:35:01 +00:00
|
|
|
|
delete _rnd;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
static int x_obj[44] = {0, X_OBJ1, X_OBJ2, X_OBJ3, X_OBJ4, X_OBJ5, X_OBJ6, X_OBJ7, X_OBJ8, X_OBJ9, X_OBJ10,
|
|
|
|
|
X_OBJ11, X_OBJ12, X_OBJ13, X_OBJ14, X_OBJ15, X_OBJ16, X_OBJ17, X_OBJ18, X_OBJ19, X_OBJ20,
|
|
|
|
|
X_OBJ21, X_OBJ22, X_OBJ23, X_OBJ24, X_OBJ25, X_OBJ26, X_OBJ27, X_OBJ28, X_OBJ29, X_OBJ30,
|
|
|
|
|
X_OBJ31, X_OBJ32, X_OBJ33, X_OBJ34, X_OBJ35, X_OBJ36, X_OBJ37, X_OBJ38, X_OBJ39, X_OBJ40,
|
|
|
|
|
X_OBJ41, X_OBJ42, X_OBJ43};
|
|
|
|
|
static int y_obj[44] = {0, Y_OBJ1, Y_OBJ2, Y_OBJ3, Y_OBJ4, Y_OBJ5, Y_OBJ6, Y_OBJ7, Y_OBJ8, Y_OBJ9, Y_OBJ10,
|
|
|
|
|
Y_OBJ11, Y_OBJ12, Y_OBJ13, Y_OBJ14, Y_OBJ15, Y_OBJ16, Y_OBJ17, Y_OBJ18, Y_OBJ19, Y_OBJ20,
|
|
|
|
|
Y_OBJ21, Y_OBJ22, Y_OBJ23, Y_OBJ24, Y_OBJ25, Y_OBJ26, Y_OBJ27, Y_OBJ28, Y_OBJ29, Y_OBJ30,
|
|
|
|
|
Y_OBJ31, Y_OBJ32, Y_OBJ33, Y_OBJ34, Y_OBJ35, Y_OBJ36, Y_OBJ37, Y_OBJ38, Y_OBJ39, Y_OBJ40,
|
|
|
|
|
Y_OBJ41, Y_OBJ42, Y_OBJ43};
|
|
|
|
|
static int x_pol[44] = {0, 1, 42, 83, 124, 165, 206, 247, 83, 1, 206,
|
|
|
|
|
1, 42, 83, 124, 165, 206, 247, 83, 1, 206,
|
|
|
|
|
247, 83, 165, 1, 206, 42, 124, 83, 1, 247,
|
|
|
|
|
83, 165, 1, 206, 42, 124, 83, 1, 247, 42,
|
|
|
|
|
1, 165, 206};
|
|
|
|
|
static int y_pol[44] = {0, 1, 1, 1, 1, 1, 1, 1, 27, 27, 1,
|
2007-07-28 09:45:05 +00:00
|
|
|
|
27, 27, 27, 27, 27, 27, 27, 1, 1, 27,
|
2007-07-26 19:52:18 +00:00
|
|
|
|
1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
|
|
|
|
|
1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
|
|
|
|
|
27, 1, 1};
|
|
|
|
|
static int x_barra[] = {6, 51, 96, 141, 186, 232, 276, 321};
|
|
|
|
|
static 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};
|
|
|
|
|
static int y1d_menu[] = {0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25,
|
|
|
|
|
50, 50, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 75, 75, 100};
|
|
|
|
|
static int frame_x[6] = {43, 87, 130, 173, 216, 259};
|
|
|
|
|
static int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
|
|
|
|
|
static int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
|
|
|
|
|
|
2007-07-17 21:35:01 +00:00
|
|
|
|
int DrasculaEngine::init() {
|
|
|
|
|
// Detect game
|
|
|
|
|
if (!initGame()) {
|
|
|
|
|
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initialize backend
|
|
|
|
|
_system->beginGFXTransaction();
|
|
|
|
|
initCommonGFX(false);
|
|
|
|
|
_system->initSize(320, 200);
|
|
|
|
|
_system->endGFXTransaction();
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
VGA = (byte *)malloc(320 * 200);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
memset(VGA, 0, 64000);
|
|
|
|
|
|
|
|
|
|
lleva_objeto = 0;
|
|
|
|
|
menu_bar = 0; menu_scr = 0; hay_nombre = 0;
|
|
|
|
|
frame_y = 0;
|
|
|
|
|
hare_x = -1; hare_se_mueve = 0; sentido_hare = 3; num_frame = 0; hare_se_ve = 1;
|
|
|
|
|
comprueba_flags = 1;
|
|
|
|
|
rompo = 0; rompo2 = 0;
|
|
|
|
|
anda_a_objeto = 0;
|
|
|
|
|
paso_x = PASO_HARE_X; paso_y = PASO_HARE_Y;
|
|
|
|
|
alto_hare = ALTO_PERSONAJE; ancho_hare = ANCHO_PERSONAJE; alto_pies = PIES_HARE;
|
|
|
|
|
alto_habla = ALTO_HABLA_HARE; ancho_habla = ANCHO_HABLA_HARE;
|
|
|
|
|
hay_respuesta = 0;
|
|
|
|
|
conta_ciego_vez = 0;
|
|
|
|
|
cambio_de_color = 0;
|
|
|
|
|
rompo_y_salgo = 0;
|
|
|
|
|
vb_x = 120; sentido_vb = 1; vb_se_mueve = 0; frame_vb = 1;
|
|
|
|
|
frame_piano = 0;
|
|
|
|
|
frame_borracho = 0;
|
|
|
|
|
frame_velas = 0;
|
|
|
|
|
cont_sv = 0;
|
|
|
|
|
term_int = 0;
|
|
|
|
|
num_ejec = 1;
|
|
|
|
|
cual_ejec = 0; hay_que_load = 0;
|
|
|
|
|
corta_musica = 0;
|
|
|
|
|
hay_seleccion = 0;
|
|
|
|
|
Leng = 0;
|
|
|
|
|
UsingMem = 0;
|
|
|
|
|
GlobalSpeed = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
asigna_memoria();
|
|
|
|
|
carga_info();
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 21:35:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-17 21:35:01 +00:00
|
|
|
|
int DrasculaEngine::go() {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("95.alg");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
descomprime_dibujo(dir_mesa, 1);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
lee_dibujos("96.alg");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
descomprime_dibujo(dir_hare_frente, COMPLETA);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("99.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
lee_dibujos("97.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
|
|
|
|
|
|
|
|
|
strcpy(nombre_icono[1], "look");
|
|
|
|
|
strcpy(nombre_icono[2], "take");
|
|
|
|
|
strcpy(nombre_icono[3], "open");
|
|
|
|
|
strcpy(nombre_icono[4], "close");
|
|
|
|
|
strcpy(nombre_icono[5], "talk");
|
|
|
|
|
strcpy(nombre_icono[6], "push");
|
|
|
|
|
|
|
|
|
|
paleta_hare();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
escoba();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::salir_al_dos(int r) {
|
|
|
|
|
if (hay_sb == 1)
|
|
|
|
|
ctvd_end();
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
Negro();
|
|
|
|
|
MusicFadeout();
|
|
|
|
|
stopmusic();
|
|
|
|
|
libera_memoria();
|
|
|
|
|
if (r == 2)
|
|
|
|
|
error("Game reach next segment");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::asigna_memoria() {
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_zona_pantalla = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_zona_pantalla);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_dibujo1 = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_dibujo1);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_hare_fondo = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_hare_fondo);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_dibujo3 = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_dibujo3);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_dibujo2 = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_dibujo2);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_mesa = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_mesa);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_hare_dch = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_hare_dch);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
dir_hare_frente = (byte *)malloc(64000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
assert(dir_hare_frente);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::libera_memoria() {
|
|
|
|
|
free(dir_zona_pantalla);
|
|
|
|
|
free(dir_dibujo1);
|
|
|
|
|
free(dir_hare_fondo);
|
|
|
|
|
free(dir_dibujo2);
|
|
|
|
|
free(dir_mesa);
|
|
|
|
|
free(dir_dibujo3);
|
|
|
|
|
free(dir_hare_dch);
|
|
|
|
|
free(dir_hare_frente);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::carga_info() {
|
|
|
|
|
hay_sb = 1;
|
|
|
|
|
con_voces = 0;
|
|
|
|
|
hay_que_load = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::lee_dibujos(const char *NamePcc) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
unsigned int con, x = 0;
|
|
|
|
|
unsigned int fExit = 0;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
byte ch, rep;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Common::File file;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
byte *auxPun;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
file.open(NamePcc);
|
|
|
|
|
if (!file.isOpen())
|
|
|
|
|
error("missing game data %s %c", NamePcc, 7);
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
Buffer_pcx = (byte *)malloc(65000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
auxPun = Buffer_pcx;
|
|
|
|
|
file.seek(128);
|
|
|
|
|
while (!fExit) {
|
|
|
|
|
ch = file.readByte();
|
|
|
|
|
rep = 1;
|
|
|
|
|
if ((ch & 192) == 192) {
|
|
|
|
|
rep = (ch & 63);
|
|
|
|
|
ch = file.readByte();
|
|
|
|
|
}
|
|
|
|
|
for (con = 0; con < rep; con++) {
|
|
|
|
|
*auxPun++ = ch;
|
|
|
|
|
x++;
|
|
|
|
|
if (x > 64000)
|
|
|
|
|
fExit = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file.read(cPal, 768);
|
|
|
|
|
file.close();
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 15:18:21 +00:00
|
|
|
|
void DrasculaEngine::descomprime_dibujo(byte *dir_escritura, int plt) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
memcpy(dir_escritura, Buffer_pcx, 64000);
|
|
|
|
|
free(Buffer_pcx);
|
2007-07-28 15:18:21 +00:00
|
|
|
|
asigna_rgb((byte *)cPal, plt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (plt > 1)
|
|
|
|
|
funde_rgb(plt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::paleta_hare() {
|
|
|
|
|
int color, componente;
|
|
|
|
|
|
|
|
|
|
for (color = 235; color < 253; color++)
|
2007-07-28 14:45:26 +00:00
|
|
|
|
for (componente = 0; componente < 3; componente++)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
palHare[color][componente] = palJuego[color][componente];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 15:18:21 +00:00
|
|
|
|
void DrasculaEngine::asigna_rgb(byte *dir_lectura, int plt) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int x, cnt = 0;
|
|
|
|
|
|
|
|
|
|
for (x = 0; x < plt; x++) {
|
2007-07-28 21:36:46 +00:00
|
|
|
|
palJuego[x][0] = dir_lectura[cnt++] / 4;
|
|
|
|
|
palJuego[x][1] = dir_lectura[cnt++] / 4;
|
|
|
|
|
palJuego[x][2] = dir_lectura[cnt++] / 4;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
ActualizaPaleta();
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
void DrasculaEngine::funde_rgb(int plt) {}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
void DrasculaEngine::Negro() {
|
|
|
|
|
int color, componente;
|
|
|
|
|
DacPalette256 palNegra;
|
|
|
|
|
|
|
|
|
|
for (color = 0; color < 256; color++)
|
2007-07-28 14:45:26 +00:00
|
|
|
|
for (componente = 0; componente < 3; componente++)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
palNegra[color][componente] = 0;
|
|
|
|
|
|
2007-07-28 14:51:32 +00:00
|
|
|
|
palNegra[254][0] = 0x3F;
|
|
|
|
|
palNegra[254][1] = 0x3F;
|
|
|
|
|
palNegra[254][2] = 0x15;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
setvgapalette256((byte *)&palNegra);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::ActualizaPaleta() {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
setvgapalette256((byte *)&palJuego);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::setvgapalette256(byte *PalBuf) {
|
|
|
|
|
byte pal[256 * 4];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 256; i++) {
|
|
|
|
|
pal[i * 4 + 0] = PalBuf[i * 3 + 0] * 4;
|
|
|
|
|
pal[i * 4 + 1] = PalBuf[i * 3 + 1] * 4;
|
|
|
|
|
pal[i * 4 + 2] = PalBuf[i * 3 + 2] * 4;
|
|
|
|
|
pal[i * 4 + 3] = 0;
|
|
|
|
|
}
|
|
|
|
|
_system->setPalette(pal, 0, 256);
|
|
|
|
|
_system->updateScreen();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho,
|
2007-07-28 15:18:21 +00:00
|
|
|
|
int Alto, byte *Origen, byte *Destino) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int x;
|
|
|
|
|
Destino += xdes + ydes * 320;
|
|
|
|
|
Origen += xorg + yorg * 320;
|
|
|
|
|
for (x = 0; x < Alto; x++) {
|
|
|
|
|
memcpy(Destino, Origen, Ancho);
|
|
|
|
|
Destino += 320;
|
|
|
|
|
Origen += 320;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho,
|
2007-07-28 15:18:21 +00:00
|
|
|
|
int Alto, byte *Origen, byte *Destino) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int y, x;
|
|
|
|
|
|
|
|
|
|
Destino += xdes + ydes * 320;
|
|
|
|
|
Origen += xorg + yorg * 320;
|
|
|
|
|
|
|
|
|
|
for (y = 0; y < Alto; y++)
|
|
|
|
|
for (x = 0; x < Ancho; x++)
|
|
|
|
|
if (Origen[x + y * 320] != 255)
|
|
|
|
|
Destino[x + y * 320] = Origen[x + y * 320];
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 15:18:21 +00:00
|
|
|
|
void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int y, x;
|
|
|
|
|
int xorg = Array[0];
|
|
|
|
|
int yorg = Array[1];
|
|
|
|
|
int xdes = Array[2];
|
|
|
|
|
int ydes = Array[3];
|
|
|
|
|
int Ancho = Array[4];
|
|
|
|
|
int Alto = Array[5];
|
|
|
|
|
|
|
|
|
|
if (ydes < 0) {
|
|
|
|
|
yorg += -ydes;
|
|
|
|
|
Alto += ydes;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
ydes = 0;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
if (xdes < 0) {
|
|
|
|
|
xorg += -xdes;
|
|
|
|
|
Ancho += xdes;
|
|
|
|
|
xdes = 0;
|
|
|
|
|
}
|
|
|
|
|
if ((xdes + Ancho) > 319)
|
|
|
|
|
Ancho -= (xdes + Ancho) - 320;
|
|
|
|
|
if ((ydes + Alto) > 199)
|
|
|
|
|
Alto -= (ydes + Alto) - 200;
|
|
|
|
|
|
|
|
|
|
Destino += xdes + ydes * 320;
|
|
|
|
|
Origen += xorg + yorg * 320;
|
|
|
|
|
|
|
|
|
|
for (y = 0; y < Alto; y++)
|
|
|
|
|
for (x = 0; x < Ancho; x++)
|
|
|
|
|
if (Origen[x + y * 320] != 255)
|
|
|
|
|
Destino[x + y * 320] = Origen[x + y * 320];
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 15:18:21 +00:00
|
|
|
|
void DrasculaEngine::VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int x;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
byte *ptr = VGA;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
ptr += xdes + ydes * 320;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Buffer += xorg + yorg * 320;
|
|
|
|
|
for (x = 0; x < Alto; x++) {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
memcpy(ptr, Buffer, Ancho);
|
|
|
|
|
ptr += 320;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Buffer += 320;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
|
|
|
|
_system->updateScreen();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
void DrasculaEngine::escoba() {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int soc, l, n;
|
|
|
|
|
|
|
|
|
|
dir_texto = dir_mesa;
|
|
|
|
|
|
|
|
|
|
musica_antes = -1;
|
|
|
|
|
|
|
|
|
|
soc = 0;
|
|
|
|
|
for (l = 0; l < 6; l++) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
soc = soc + ANCHO_PERSONAJE;
|
|
|
|
|
frame_x[l] = soc;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (n = 1; n < 43; n++)
|
|
|
|
|
objetos_que_tengo[n] = 0;
|
|
|
|
|
|
|
|
|
|
for (n = 0; n < NUM_BANDERAS; n++)
|
|
|
|
|
flags[n] = 0;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
for (n = 1; n < 7; n++)
|
|
|
|
|
objetos_que_tengo[n] = n;
|
|
|
|
|
|
|
|
|
|
agarra_objeto(28);
|
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
if (hay_que_load == 0)
|
|
|
|
|
animacion_1();
|
|
|
|
|
|
|
|
|
|
sin_verbo();
|
|
|
|
|
lee_dibujos("2aux62.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo2, 1);
|
|
|
|
|
sentido_hare = 1;
|
|
|
|
|
obj_saliendo = 104;
|
|
|
|
|
if (hay_que_load != 0)
|
|
|
|
|
para_cargar(nom_partida);
|
|
|
|
|
else {
|
|
|
|
|
carga_escoba("62.ald");
|
|
|
|
|
hare_x = -20;
|
|
|
|
|
hare_y = 56;
|
|
|
|
|
lleva_al_hare(65, 145);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucles:
|
|
|
|
|
if (hare_se_mueve == 0) {
|
2007-07-28 15:18:21 +00:00
|
|
|
|
paso_x = PASO_HARE_X;
|
|
|
|
|
paso_y = PASO_HARE_Y;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-08-01 20:13:58 +00:00
|
|
|
|
if (hare_se_mueve == 0 && anda_a_objeto == 1) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
sentido_hare = sentido_final;
|
|
|
|
|
anda_a_objeto = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mueve_cursor();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
if (music_status() == 0)
|
|
|
|
|
playmusic(musica_room);
|
|
|
|
|
|
|
|
|
|
MirarRaton();
|
|
|
|
|
|
|
|
|
|
if (menu_scr == 0 && lleva_objeto == 1)
|
|
|
|
|
comprueba_objetos();
|
|
|
|
|
|
|
|
|
|
if (boton_dch == 1 && menu_scr == 1) {
|
|
|
|
|
lee_dibujos("99.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
setvgapalette256((byte *)&palJuego);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
menu_scr = 0;
|
|
|
|
|
espera_soltar();
|
|
|
|
|
cont_sv = 0;
|
|
|
|
|
}
|
|
|
|
|
if (boton_dch == 1 && menu_scr == 0) {
|
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
if (sentido_hare == 2)
|
|
|
|
|
sentido_hare = 1;
|
|
|
|
|
lee_dibujos("icons.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
menu_scr = 1;
|
|
|
|
|
espera_soltar();
|
|
|
|
|
sin_verbo();
|
|
|
|
|
cont_sv = 0;
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (boton_izq == 1 && menu_bar == 1) {
|
|
|
|
|
elige_en_barra();
|
|
|
|
|
cont_sv = 0;
|
|
|
|
|
} else if (boton_izq == 1 && lleva_objeto == 0) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
comprueba1();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
cont_sv = 0;
|
|
|
|
|
} else if (boton_izq == 1 && lleva_objeto == 1) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
comprueba2();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
cont_sv = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (y_raton < 24 && menu_scr == 0)
|
|
|
|
|
menu_bar = 1;
|
|
|
|
|
else
|
|
|
|
|
menu_bar = 0;
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_F1 && menu_scr == 0) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
elige_verbo(1);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F2 && menu_scr == 0) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
elige_verbo(2);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F3 && menu_scr == 0) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
elige_verbo(3);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F4 && menu_scr == 0) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
elige_verbo(4);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F5 && menu_scr == 0) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
elige_verbo(5);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F6 && menu_scr == 0) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
elige_verbo(6);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F9) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
mesa();
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F10) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
saves();
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_F8) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
sin_verbo();
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_v) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
con_voces = 1;
|
|
|
|
|
print_abc(SYS2, 96, 86);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
delay(1410);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_t) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
con_voces = 0;
|
|
|
|
|
print_abc(SYS3, 94, 86);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
delay(1460);
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_DELETE) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
confirma_go();
|
|
|
|
|
cont_sv = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_ESCAPE) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
confirma_salir();
|
|
|
|
|
cont_sv = 0;
|
|
|
|
|
} else if (cont_sv == 1500) {
|
|
|
|
|
salva_pantallas();
|
|
|
|
|
cont_sv = 0;
|
2007-07-28 22:18:43 +00:00
|
|
|
|
} else
|
|
|
|
|
cont_sv++;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
goto bucles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::agarra_objeto(int objeto) {
|
|
|
|
|
lee_dibujos("icons.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
elige_objeto(objeto);
|
|
|
|
|
lee_dibujos("99.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::elige_objeto(int objeto) {
|
|
|
|
|
if (lleva_objeto == 1 && menu_scr == 0)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
suma_objeto(objeto_que_lleva);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
DIBUJA_FONDO(x1d_menu[objeto], y1d_menu[objeto], 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
|
|
|
|
|
lleva_objeto = 1;
|
|
|
|
|
objeto_que_lleva = objeto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int DrasculaEngine::resta_objeto(int osj) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
int h, q = 0;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
for (h = 1; h < 43; h++) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (objetos_que_tengo[h] == osj) {
|
|
|
|
|
objetos_que_tengo[h] = 0;
|
|
|
|
|
q = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
|
|
|
|
if (q == 1)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
return 0;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
else
|
2007-07-26 19:52:18 +00:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::animacion_1() {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
int l, l2, p;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int pos_pixel[6];
|
|
|
|
|
|
|
|
|
|
while (term_int == 0) {
|
|
|
|
|
playmusic(29);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
fliplay("logoddm.bin", 9);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
delay(600);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
delay(340);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
playmusic(26);
|
|
|
|
|
delay(500);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
fliplay("logoalc.bin", 8);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos("cielo.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, 256);
|
|
|
|
|
Negro();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
FundeDelNegro(2);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
delay(900);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
color_abc(ROJO);
|
|
|
|
|
centra_texto("Transilvanya, 1993 d.c.", 160, 100);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
delay(1000);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
delay(1200);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
fliplay("scrollb.bin", 9);
|
|
|
|
|
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
comienza_sound("s5.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("scr2.bin", 17);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
fin_sound_corte();
|
|
|
|
|
anima("scr3.bin", 17);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
lee_dibujos("cielo2.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, 256);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
FundeAlNegro(1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
|
|
|
|
|
lee_dibujos("96.alg");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
descomprime_dibujo(dir_hare_frente, COMPLETA);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("103.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
lee_dibujos("104.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo3, 1);
|
|
|
|
|
lee_dibujos("aux104.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo2, 1);
|
|
|
|
|
|
|
|
|
|
playmusic(4);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
delay(400);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
for (l2 = 0; l2 < 3; l2++)
|
|
|
|
|
for (l = 0; l < 7; l++) {
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(interf_x[l], interf_y[l], 156, 45, 63, 31, dir_dibujo2, dir_zona_pantalla);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (getscan() == Common::KEYCODE_ESCAPE) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
pausa(3);
|
|
|
|
|
}
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
l2 = 0; p = 0;
|
|
|
|
|
pos_pixel[3] = 45;
|
|
|
|
|
pos_pixel[4] = 63;
|
|
|
|
|
pos_pixel[5] = 31;
|
|
|
|
|
|
|
|
|
|
for (l = 0; l < 180; l++) {
|
|
|
|
|
DIBUJA_FONDO(0, 0, 320 - l, 0, l, 200, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(l, 0, 0, 0, 320 - l, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pos_pixel[0] = interf_x[l2];
|
|
|
|
|
pos_pixel[1] = interf_y[l2];
|
|
|
|
|
pos_pixel[2] = 156 - l;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_pixel, dir_dibujo2, dir_zona_pantalla);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
p++;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (p == 6) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
p = 0;
|
|
|
|
|
l2++;
|
|
|
|
|
}
|
|
|
|
|
if (l2 == 7)
|
|
|
|
|
l2 = 0;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (getscan() == Common::KEYCODE_ESCAPE) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
|
|
|
|
|
|
|
|
|
|
habla_dr_grande(TEXTD1, "D1.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
|
|
|
|
|
lee_dibujos("100.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
lee_dibujos("auxigor.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_frente, 1);
|
|
|
|
|
lee_dibujos("auxdr.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
sentido_dr = 0;
|
|
|
|
|
x_dr = 129;
|
|
|
|
|
y_dr = 95;
|
|
|
|
|
sentido_igor = 1;
|
|
|
|
|
x_igor = 66;
|
|
|
|
|
y_igor = 97;
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_igor_dch(TEXTI8, "I8.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
2007-08-02 06:47:04 +00:00
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_dr_izq(TEXTD2, "d2.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_dr_izq(TEXTD3, "d3.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("lib.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("lib2.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
color_solo = ROJO;
|
|
|
|
|
lee_dibujos("plan1.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, MEDIA);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(10);
|
|
|
|
|
habla_solo(TEXTD4,"d4.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
lee_dibujos("plan1.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, MEDIA);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_solo(TEXTD5, "d5.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("lib2.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos("plan2.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, MEDIA);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(20);
|
|
|
|
|
habla_solo(TEXTD6, "d6.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("lib2.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos("plan3.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, MEDIA);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(20);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_solo(TEXTD7, "d7.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
lee_dibujos("plan3.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, MEDIA);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_solo(TEXTD8, "d8.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos("100.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
MusicFadeout();
|
|
|
|
|
stopmusic();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_igor_dch(TEXTI9, "I9.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_dr_izq(TEXTD9, "d9.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_igor_dch(TEXTI10, "I10.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
playmusic(11);
|
|
|
|
|
habla_dr_izq(TEXTD10, "d10.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("rayo1.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
comienza_sound("s5.als");
|
|
|
|
|
anima("rayo2.bin", 15);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("frel2.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("frel.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("frel.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
fin_sound_corte();
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
Negro();
|
|
|
|
|
playmusic(23);
|
|
|
|
|
FundeDelNegro(0);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_dr = 1;
|
|
|
|
|
habla_igor_dch(TEXTI1, "I1.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_dr_dch(TEXTD11, "d11.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_dr = 3;
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(1);
|
|
|
|
|
sentido_dr = 0;
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_dr_izq(TEXTD12, "d12.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_dr = 3;
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(1);
|
|
|
|
|
sentido_dr = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_igor_dch(TEXTI2, "I2.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
pausa(13);
|
|
|
|
|
habla_dr_dch(TEXTD13,"d13.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_dr = 3;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(1);
|
|
|
|
|
sentido_dr = 0;
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
habla_dr_izq(TEXTD14, "d14.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_igor_dch(TEXTI3, "I3.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_dr_izq(TEXTD15, "d15.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_igor_dch(TEXTI4, "I4.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_dr_izq(TEXTD16, "d16.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_igor_dch(TEXTI5, "I5.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_igor = 3;
|
|
|
|
|
habla_dr_izq(TEXTD17, "d17.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
pausa(18);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_igor_frente(TEXTI6, "I6.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
FundeAlNegro(0);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
|
|
|
|
|
playmusic(2);
|
|
|
|
|
pausa(5);
|
|
|
|
|
fliplay("intro.bin", 12);
|
2007-07-28 21:15:35 +00:00
|
|
|
|
term_int = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos("96.alg");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
descomprime_dibujo(dir_hare_frente, COMPLETA);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("99.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::animacion_2() {
|
|
|
|
|
int l;
|
|
|
|
|
|
|
|
|
|
lleva_al_hare(231, 91);
|
|
|
|
|
hare_se_ve = 0;
|
|
|
|
|
|
|
|
|
|
term_int = 0;
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
anima("ag.bin", 14);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
lee_dibujos("an11y13.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
2007-07-17 21:35:01 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
habla_tabernero(TEXTT22, "T22.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
2007-07-17 21:35:01 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("97.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
pausa(4);
|
|
|
|
|
comienza_sound("s1.als");
|
|
|
|
|
hipo(18);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
fin_sound();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
stopmusic();
|
|
|
|
|
corta_musica = 1;
|
|
|
|
|
memset(dir_zona_pantalla, 0, 64000);
|
|
|
|
|
color_solo = BLANCO;
|
|
|
|
|
pausa(80);
|
|
|
|
|
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_solo(TEXTBJ1, "BJ1.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos("bj.alg");
|
|
|
|
|
descomprime_dibujo(dir_zona_pantalla, MEDIA);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
Negro();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
FundeDelNegro(1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
color_solo = AMARILLO;
|
|
|
|
|
habla_solo(TEXT214, "214.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
|
|
|
|
|
lee_dibujos("16.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
lee_dibujos("auxbj.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo3, 1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
strcpy(num_room,"16.alg");
|
|
|
|
|
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
for (l = 0; l < 200; l++)
|
|
|
|
|
factor_red[l] = 99;
|
|
|
|
|
x_bj = 170;
|
|
|
|
|
y_bj = 90;
|
|
|
|
|
sentido_bj = 0;
|
|
|
|
|
hare_x = 91;
|
|
|
|
|
hare_y = 95;
|
|
|
|
|
sentido_hare = 1;
|
|
|
|
|
hare_se_ve = 1;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
lee_dibujos("97g.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
anima("lev.bin", 15);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
lleva_al_hare(100 + ancho_hare / 2, 99 + alto_hare);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_hare = 1;
|
|
|
|
|
hare_x = 100;
|
|
|
|
|
hare_y = 95;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
habla_bj(TEXTBJ2, "BJ2.als");
|
|
|
|
|
hablar(TEXT215, "215.als");
|
|
|
|
|
habla_bj(TEXTBJ3, "BJ3.als");
|
|
|
|
|
hablar(TEXT216, "216.als");
|
|
|
|
|
habla_bj(TEXTBJ4, "BJ4.als");
|
|
|
|
|
habla_bj(TEXTBJ5, "BJ5.als");
|
|
|
|
|
habla_bj(TEXTBJ6, "BJ6.als");
|
|
|
|
|
hablar(TEXT217, "217.als");
|
|
|
|
|
habla_bj(TEXTBJ7, "BJ7.als");
|
|
|
|
|
hablar(TEXT218, "218.als");
|
|
|
|
|
habla_bj(TEXTBJ8, "BJ8.als");
|
|
|
|
|
hablar(TEXT219, "219.als");
|
|
|
|
|
habla_bj(TEXTBJ9, "BJ9.als");
|
|
|
|
|
hablar(TEXT220, "220.als");
|
|
|
|
|
hablar(TEXT221, "221.als");
|
|
|
|
|
habla_bj(TEXTBJ10, "BJ10.als");
|
|
|
|
|
hablar(TEXT222, "222.als");
|
|
|
|
|
anima("gaf.bin", 15);
|
|
|
|
|
anima("bjb.bin", 14);
|
|
|
|
|
playmusic(9);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
lee_dibujos("97.alg");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
pausa(120);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_solo(TEXT223, "223.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
color_solo = BLANCO;
|
|
|
|
|
refresca_pantalla();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(110);
|
|
|
|
|
habla_solo(TEXTBJ11, "BJ11.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
refresca_pantalla();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
pausa(118);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
lleva_al_hare(132, 97 + alto_hare);
|
|
|
|
|
pausa(60);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
hablar(TEXT224, "224.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
habla_bj(TEXTBJ12, "BJ12.als");
|
|
|
|
|
lleva_al_hare(157, 98 + alto_hare);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
anima("bes.bin", 16);
|
|
|
|
|
playmusic(11);
|
|
|
|
|
anima("rap.bin", 16);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_hare = 3;
|
|
|
|
|
strcpy(num_room, "no_bj.alg");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
pausa(8);
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
hablar(TEXT225, "225.als");
|
|
|
|
|
pausa(76);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
sentido_hare = 1;
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
hablar(TEXT226, "226.als");
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
pausa(30);
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
hablar(TEXT227,"227.als");
|
|
|
|
|
FundeAlNegro(0);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
salir_al_dos(2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::sin_verbo() {
|
|
|
|
|
int c = 171;
|
|
|
|
|
if (menu_scr == 1)
|
|
|
|
|
c = 0;
|
2007-07-28 21:15:35 +00:00
|
|
|
|
if (lleva_objeto == 1)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
suma_objeto(objeto_que_lleva);
|
|
|
|
|
DIBUJA_FONDO(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
|
|
|
|
|
|
|
|
|
|
lleva_objeto = 0;
|
|
|
|
|
hay_nombre = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::para_cargar(char nom_game[]) {
|
|
|
|
|
musica_antes = musica_room;
|
|
|
|
|
menu_scr = 0;
|
|
|
|
|
carga_partida(nom_game);
|
|
|
|
|
carga_escoba(datos_actuales);
|
|
|
|
|
sin_verbo();
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
static char *getLine(Common::File *fp, char *buf, int len) {
|
|
|
|
|
int c;
|
|
|
|
|
char *b;
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
b = buf;
|
|
|
|
|
while (!fp->eos()) {
|
|
|
|
|
c = fp->readByte() ^ 0xff;
|
|
|
|
|
if (c == '\r')
|
|
|
|
|
continue;
|
|
|
|
|
if (c == '\n')
|
|
|
|
|
break;
|
|
|
|
|
if (b - buf >= (len - 1))
|
|
|
|
|
break;
|
|
|
|
|
*b++ = c;
|
|
|
|
|
}
|
|
|
|
|
*b = '\0';
|
|
|
|
|
if (fp->eos() && b == buf)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (b != buf)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return buf;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::carga_escoba(const char *nom_fich) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
int l, obj_salir;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
float chiquez, pequegnez = 0;
|
|
|
|
|
char para_codificar[13];
|
2007-07-28 19:43:26 +00:00
|
|
|
|
char buffer[256];
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
hay_nombre = 0;
|
|
|
|
|
|
|
|
|
|
strcpy(para_codificar, nom_fich);
|
|
|
|
|
canal_p(para_codificar);
|
|
|
|
|
strcpy(datos_actuales, nom_fich);
|
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
ald = new Common::File;
|
|
|
|
|
ald->open(nom_fich);
|
|
|
|
|
if (!ald->isOpen()) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
error("missing data file");
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-07-28 14:45:26 +00:00
|
|
|
|
int size = ald->size();
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", num_room);
|
2007-07-29 11:21:12 +00:00
|
|
|
|
strcat(num_room, ".alg");
|
2007-07-28 19:43:26 +00:00
|
|
|
|
|
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &musica_room);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", pantalla_disco);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &nivel_osc);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &objs_room);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
for (l = 0; l < objs_room;l++) {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &num_obj[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", nombre_obj[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &x1[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &y1[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &x2[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &y2[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &sitiobj_x[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &sitiobj_y[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &sentidobj[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &visible[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &espuerta[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (espuerta[l] != 0) {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", alapantallakeva[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &x_alakeva[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &y_alakeva[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &sentido_alkeva[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &alapuertakeva[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
puertas_cerradas(l);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &suelo_x1);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &suelo_y1);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &suelo_x2);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &suelo_y2);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &lejos);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &cerca);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
delete ald;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
canal_p(para_codificar);
|
|
|
|
|
|
|
|
|
|
for (l = 0; l < objs_room; l++) {
|
|
|
|
|
if (num_obj[l] == obj_saliendo)
|
|
|
|
|
obj_salir = l;
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos(pantalla_disco);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
descomprime_dibujo(dir_dibujo3, 1);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
lee_dibujos(num_room);
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
|
|
|
|
|
|
|
|
|
|
color_hare();
|
|
|
|
|
if (nivel_osc != 0)
|
|
|
|
|
funde_hare(nivel_osc);
|
|
|
|
|
paleta_hare_claro();
|
|
|
|
|
color_hare();
|
|
|
|
|
funde_hare(nivel_osc + 2);
|
|
|
|
|
paleta_hare_oscuro();
|
|
|
|
|
|
|
|
|
|
hare_claro();
|
|
|
|
|
cambio_de_color = -1;
|
|
|
|
|
|
|
|
|
|
for (l = 0; l <= suelo_y1; l++)
|
|
|
|
|
factor_red[l] = lejos;
|
|
|
|
|
for (l = suelo_y1; l <= 201; l++)
|
|
|
|
|
factor_red[l] = cerca;
|
|
|
|
|
|
|
|
|
|
chiquez = (float)(cerca-lejos) / (float)(suelo_y2 - suelo_y1);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
for (l = suelo_y1; l <= suelo_y2; l++) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
factor_red[l] = (int)(lejos + pequegnez);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pequegnez = pequegnez + chiquez;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hare_x == -1) {
|
|
|
|
|
hare_x = x_alakeva[obj_salir];
|
|
|
|
|
hare_y = y_alakeva[obj_salir];
|
|
|
|
|
alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100;
|
|
|
|
|
ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100;
|
|
|
|
|
hare_y = hare_y - alto_hare;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
} else {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100;
|
|
|
|
|
ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100;
|
|
|
|
|
}
|
2007-07-28 21:15:35 +00:00
|
|
|
|
hare_se_mueve = 0;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
actualiza_datos();
|
|
|
|
|
|
|
|
|
|
espuerta[7] = 0;
|
|
|
|
|
|
|
|
|
|
if (musica_antes != musica_room)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
playmusic(musica_room);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
refresca_pantalla();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::borra_pantalla() {
|
|
|
|
|
memset(VGA, 0, 64000);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
|
|
|
|
_system->updateScreen();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) {
|
2007-07-28 21:15:35 +00:00
|
|
|
|
sitio_x = punto_x;
|
|
|
|
|
sitio_y = punto_y;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
empieza_andar();
|
|
|
|
|
|
|
|
|
|
for(;;) {
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
if (hare_se_mueve == 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (anda_a_objeto == 1) {
|
|
|
|
|
anda_a_objeto = 0;
|
|
|
|
|
sentido_hare = sentido_final;
|
|
|
|
|
}
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::mueve_cursor() {
|
|
|
|
|
int pos_cursor[8];
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
pon_hare();
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (_color != ROJO && menu_scr == 0)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(ROJO);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
} else if (menu_scr == 0 && _color != VERDE_CLARO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(VERDE_CLARO);
|
|
|
|
|
if (hay_nombre == 1 && menu_scr == 0)
|
|
|
|
|
centra_texto(texto_nombre, x_raton, y_raton);
|
|
|
|
|
if (menu_scr == 1)
|
|
|
|
|
menu_sin_volcar();
|
|
|
|
|
else if (menu_bar == 1)
|
|
|
|
|
barra_menu();
|
|
|
|
|
|
|
|
|
|
pos_cursor[0] = 0;
|
|
|
|
|
pos_cursor[1] = 0;
|
|
|
|
|
pos_cursor[2] = x_raton - 20;
|
|
|
|
|
pos_cursor[3] = y_raton - 17;
|
|
|
|
|
pos_cursor[4] = ANCHOBJ;
|
|
|
|
|
pos_cursor[5] = ALTOBJ;
|
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_cursor, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::comprueba_objetos() {
|
|
|
|
|
int l, veo = 0;
|
|
|
|
|
|
|
|
|
|
for (l = 0; l < objs_room; l++) {
|
|
|
|
|
if (x_raton > x1[l] && y_raton > y1[l]
|
|
|
|
|
&& x_raton < x2[l] && y_raton < y2[l]
|
|
|
|
|
&& visible[l] == 1 && espuerta[l] == 0) {
|
|
|
|
|
strcpy(texto_nombre, nombre_obj[l]);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
hay_nombre = 1;
|
|
|
|
|
veo = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (x_raton > hare_x + 2 && y_raton > hare_y + 2
|
|
|
|
|
&& x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2 && veo == 0) {
|
|
|
|
|
strcpy(texto_nombre, "hacker");
|
2007-07-28 19:43:26 +00:00
|
|
|
|
hay_nombre = 1;
|
|
|
|
|
veo = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (veo == 0)
|
|
|
|
|
hay_nombre = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::espera_soltar() {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
update_events();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::MirarRaton() {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
update_events();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::elige_en_barra() {
|
|
|
|
|
int n, num_verbo = -1;
|
|
|
|
|
|
|
|
|
|
for (n = 0; n < 7; n++)
|
|
|
|
|
if (x_raton > x_barra[n] && x_raton < x_barra[n + 1])
|
|
|
|
|
num_verbo = n;
|
|
|
|
|
|
|
|
|
|
if (num_verbo < 1)
|
|
|
|
|
sin_verbo();
|
|
|
|
|
else
|
|
|
|
|
elige_verbo(num_verbo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::comprueba1() {
|
|
|
|
|
int l;
|
|
|
|
|
|
|
|
|
|
if (menu_scr == 1)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
saca_objeto();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else {
|
|
|
|
|
for (l = 0; l < objs_room; l++) {
|
|
|
|
|
if (x_raton >= x1[l] && y_raton >= y1[l]
|
|
|
|
|
&& x_raton <= x2[l] && y_raton <= y2[l] && rompo == 0) {
|
|
|
|
|
sal_de_la_habitacion(l);
|
|
|
|
|
if (rompo == 1)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (x_raton > hare_x && y_raton > hare_y
|
2007-07-28 09:45:05 +00:00
|
|
|
|
&& x_raton < hare_x + ancho_hare && y_raton < hare_y + alto_hare)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
rompo = 1;
|
|
|
|
|
|
|
|
|
|
for (l = 0; l < objs_room; l++) {
|
|
|
|
|
if (x_raton > x1[l] && y_raton > y1[l]
|
|
|
|
|
&& x_raton < x2[l] && y_raton < y2[l] && rompo == 0) {
|
|
|
|
|
sitio_x = sitiobj_x[l];
|
|
|
|
|
sitio_y = sitiobj_y[l];
|
|
|
|
|
sentido_final = sentidobj[l];
|
|
|
|
|
rompo = 1;
|
|
|
|
|
anda_a_objeto = 1;
|
|
|
|
|
empieza_andar();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (rompo == 0) {
|
|
|
|
|
sitio_x = x_raton;
|
|
|
|
|
sitio_y = y_raton;
|
|
|
|
|
|
|
|
|
|
if (sitio_x < suelo_x1)
|
|
|
|
|
sitio_x = suelo_x1;
|
|
|
|
|
if (sitio_x > suelo_x2)
|
|
|
|
|
sitio_x = suelo_x2;
|
|
|
|
|
if (sitio_y < suelo_y1 + alto_pies)
|
|
|
|
|
sitio_y = suelo_y1 + alto_pies;
|
|
|
|
|
if (sitio_y > suelo_y2)
|
|
|
|
|
sitio_y = suelo_y2;
|
|
|
|
|
|
|
|
|
|
empieza_andar();
|
|
|
|
|
}
|
|
|
|
|
rompo = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::comprueba2() {
|
|
|
|
|
int l;
|
|
|
|
|
|
|
|
|
|
if (menu_scr == 1)
|
|
|
|
|
coge_objeto();
|
|
|
|
|
else {
|
|
|
|
|
if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1)
|
|
|
|
|
banderas(50);
|
|
|
|
|
else
|
|
|
|
|
for (l = 0; l < objs_room; l++) {
|
|
|
|
|
if (x_raton > x1[l] && y_raton > y1[l]
|
|
|
|
|
&& x_raton < x2[l] && y_raton < y2[l] && visible[l] == 1) {
|
|
|
|
|
sentido_final = sentidobj[l];
|
2007-07-28 09:45:05 +00:00
|
|
|
|
anda_a_objeto = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
|
|
|
|
|
banderas(num_obj[l]);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
byte DrasculaEngine::getscan() {
|
|
|
|
|
update_events();
|
|
|
|
|
|
2007-08-01 22:11:04 +00:00
|
|
|
|
return _keyPressed.keycode;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::update_events() {
|
|
|
|
|
Common::Event event;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
Common::EventManager *eventMan = _system->getEventManager();
|
2007-07-28 14:45:26 +00:00
|
|
|
|
|
2007-08-01 20:11:32 +00:00
|
|
|
|
AudioCD.updateCD();
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
while (eventMan->pollEvent(event)) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
switch (event.type) {
|
|
|
|
|
case Common::EVENT_KEYDOWN:
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_keyPressed = event.kbd;
|
|
|
|
|
break;
|
|
|
|
|
case Common::EVENT_KEYUP:
|
2007-08-01 22:11:04 +00:00
|
|
|
|
_keyPressed.keycode = Common::KEYCODE_INVALID;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
case Common::EVENT_MOUSEMOVE:
|
|
|
|
|
x_raton = event.mouse.x;
|
|
|
|
|
y_raton = event.mouse.y;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
|
|
|
|
case Common::EVENT_LBUTTONDOWN:
|
2007-07-28 19:43:26 +00:00
|
|
|
|
boton_izq = 1;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
|
|
|
|
case Common::EVENT_LBUTTONUP:
|
2007-07-28 19:43:26 +00:00
|
|
|
|
boton_izq = 0;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
case Common::EVENT_RBUTTONDOWN:
|
|
|
|
|
boton_dch = 1;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
case Common::EVENT_RBUTTONUP:
|
|
|
|
|
boton_dch = 0;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
|
|
|
|
case Common::EVENT_QUIT:
|
2007-07-28 22:18:43 +00:00
|
|
|
|
// TODO
|
|
|
|
|
salir_al_dos(0);
|
|
|
|
|
exit(0);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
2007-07-28 22:10:30 +00:00
|
|
|
|
default:
|
2007-07-28 14:45:26 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
void DrasculaEngine::elige_verbo(int verbo) {
|
|
|
|
|
int c = 171;
|
|
|
|
|
|
|
|
|
|
if (menu_scr == 1)
|
|
|
|
|
c = 0;
|
|
|
|
|
if (lleva_objeto == 1)
|
|
|
|
|
suma_objeto(objeto_que_lleva);
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(ANCHOBJ * verbo, c, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
|
|
|
|
|
|
|
|
|
|
lleva_objeto = 1;
|
|
|
|
|
objeto_que_lleva = verbo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::mesa() {
|
|
|
|
|
int nivel_master, nivel_voc, nivel_cd;
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
|
|
|
|
|
VUELCA_PANTALLA(73, 63, 73, 63, 177, 97, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
nivel_master = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
|
|
|
|
|
nivel_voc = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
|
|
|
|
|
nivel_cd = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
DIBUJA_FONDO(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
cursor_mesa();
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
MirarRaton();
|
|
|
|
|
|
|
|
|
|
if (boton_dch == 1)
|
|
|
|
|
break;
|
|
|
|
|
if (boton_izq == 1) {
|
|
|
|
|
if (x_raton > 80 && x_raton < 121) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16;
|
|
|
|
|
if (y_raton < nivel_master && vol < 15)
|
|
|
|
|
vol++;
|
|
|
|
|
if (y_raton > nivel_master && vol > 0)
|
|
|
|
|
vol--;
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol * 16);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (x_raton > 136 && x_raton < 178) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16;
|
|
|
|
|
if (y_raton < nivel_voc && vol < 15)
|
|
|
|
|
vol++;
|
|
|
|
|
if (y_raton > nivel_voc && vol > 0)
|
|
|
|
|
vol--;
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol * 16);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (x_raton > 192 && x_raton < 233) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
|
|
|
|
|
if (y_raton < nivel_cd && vol < 15)
|
|
|
|
|
vol++;
|
|
|
|
|
if (y_raton > nivel_cd && vol > 0)
|
|
|
|
|
vol--;
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol * 16);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
espera_soltar();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::saves() {
|
|
|
|
|
char nombres[10][23];
|
|
|
|
|
char fichero[13];
|
|
|
|
|
int n, n2, num_sav, y = 27;
|
2007-08-01 19:31:36 +00:00
|
|
|
|
Common::InSaveFile *sav;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
if (!(sav = _saveFileMan->openForLoading("saves.epa"))) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("Can't open saves.epa file.");
|
|
|
|
|
}
|
|
|
|
|
for (n = 0; n < NUM_SAVES; n++)
|
2007-08-01 19:31:36 +00:00
|
|
|
|
sav->read(nombres[n], 23);
|
|
|
|
|
delete sav;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
lee_dibujos("savescr.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
|
|
|
|
|
color_abc(VERDE_CLARO);
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
y = 27;
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
for (n = 0; n < NUM_SAVES; n++) {
|
|
|
|
|
print_abc(nombres[n], 116, y);
|
|
|
|
|
y = y + 9;
|
|
|
|
|
}
|
|
|
|
|
print_abc(select, 117, 15);
|
|
|
|
|
cursor_mesa();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
y = 27;
|
|
|
|
|
|
|
|
|
|
MirarRaton();
|
|
|
|
|
|
|
|
|
|
if (boton_izq == 1) {
|
|
|
|
|
for (n = 0; n < NUM_SAVES; n++) {
|
|
|
|
|
if (x_raton > 115 && y_raton > y + (9 * n) && x_raton < 115 + 175 && y_raton < y + 10 + (9 * n)) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
strcpy(select, nombres[n]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (strcmp(select, "*"))
|
|
|
|
|
hay_seleccion = 1;
|
|
|
|
|
else {
|
|
|
|
|
introduce_nombre();
|
|
|
|
|
strcpy(nombres[n], select);
|
|
|
|
|
if (hay_seleccion == 1) {
|
|
|
|
|
if (n == 0)
|
|
|
|
|
strcpy(fichero, "gsave01");
|
|
|
|
|
if (n == 1)
|
|
|
|
|
strcpy(fichero, "gsave02");
|
|
|
|
|
if (n == 2)
|
|
|
|
|
strcpy(fichero, "gsave03");
|
|
|
|
|
if (n == 3)
|
|
|
|
|
strcpy(fichero, "gsave04");
|
|
|
|
|
if (n == 4)
|
|
|
|
|
strcpy(fichero, "gsave05");
|
|
|
|
|
if (n == 5)
|
|
|
|
|
strcpy(fichero, "gsave06");
|
|
|
|
|
if (n == 6)
|
|
|
|
|
strcpy(fichero, "gsave07");
|
|
|
|
|
if (n == 7)
|
|
|
|
|
strcpy(fichero, "gsave08");
|
|
|
|
|
if (n == 8)
|
|
|
|
|
strcpy(fichero, "gsave09");
|
|
|
|
|
if (n == 9)
|
|
|
|
|
strcpy(fichero, "gsave10");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
para_grabar(fichero);
|
2007-08-01 19:31:36 +00:00
|
|
|
|
Common::OutSaveFile *tsav;
|
|
|
|
|
if (!(tsav = _saveFileMan->openForSaving("saves.epa"))) {
|
|
|
|
|
error("Can't open saves.epa file.");
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
for (n = 0; n < NUM_SAVES; n++)
|
2007-08-01 19:31:36 +00:00
|
|
|
|
tsav->write(nombres[n], 23);
|
|
|
|
|
tsav->finalize();
|
|
|
|
|
delete tsav;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print_abc(select, 117, 15);
|
|
|
|
|
y = 27;
|
|
|
|
|
for (n2 = 0; n2 < NUM_SAVES; n2++) {
|
|
|
|
|
print_abc(nombres[n2], 116, y);
|
|
|
|
|
y = y + 9;
|
|
|
|
|
}
|
|
|
|
|
if (hay_seleccion == 1) {
|
|
|
|
|
if (n == 0)
|
|
|
|
|
strcpy(fichero, "gsave01");
|
|
|
|
|
if (n == 1)
|
|
|
|
|
strcpy(fichero, "gsave02");
|
|
|
|
|
if (n == 2)
|
|
|
|
|
strcpy(fichero, "gsave03");
|
|
|
|
|
if (n == 3)
|
|
|
|
|
strcpy(fichero, "gsave04");
|
|
|
|
|
if (n == 4)
|
|
|
|
|
strcpy(fichero, "gsave05");
|
|
|
|
|
if (n == 5)
|
|
|
|
|
strcpy(fichero, "gsave06");
|
|
|
|
|
if (n == 6)
|
|
|
|
|
strcpy(fichero, "gsave07");
|
|
|
|
|
if (n == 7)
|
|
|
|
|
strcpy(fichero, "gsave08");
|
|
|
|
|
if (n == 8)
|
|
|
|
|
strcpy(fichero, "gsave09");
|
|
|
|
|
if (n == 9)
|
|
|
|
|
strcpy(fichero, "gsave10");}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
num_sav = n;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (x_raton > 117 && y_raton > 15 && x_raton < 295 && y_raton < 24 && hay_seleccion == 1) {
|
|
|
|
|
introduce_nombre();
|
|
|
|
|
strcpy(nombres[num_sav], select);
|
|
|
|
|
print_abc(select, 117, 15);
|
|
|
|
|
y = 27;
|
|
|
|
|
for (n2 = 0; n2 < NUM_SAVES; n2++) {
|
|
|
|
|
print_abc(nombres[n2], 116, y);
|
|
|
|
|
y = y + 9;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (x_raton > 125 && y_raton > 123 && x_raton < 199 && y_raton < 149 && hay_seleccion == 1) {
|
|
|
|
|
para_cargar(fichero);
|
|
|
|
|
break;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
} else if (x_raton > 208 && y_raton > 123 && x_raton < 282 && y_raton < 149 && hay_seleccion == 1) {
|
|
|
|
|
para_grabar(fichero);
|
2007-08-01 19:31:36 +00:00
|
|
|
|
Common::OutSaveFile *tsav;
|
|
|
|
|
if (!(tsav = _saveFileMan->openForSaving("saves.epa"))) {
|
|
|
|
|
error("Can't open saves.epa file.");
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
for (n = 0; n < NUM_SAVES; n++)
|
2007-08-01 19:31:36 +00:00
|
|
|
|
tsav->write(nombres[n], 23);
|
|
|
|
|
tsav->finalize();
|
|
|
|
|
delete tsav;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else if (x_raton > 168 && y_raton > 154 && x_raton < 242 && y_raton < 180)
|
|
|
|
|
break;
|
|
|
|
|
else if (hay_seleccion == 0) {
|
|
|
|
|
print_abc("elige una partida",117,15);
|
|
|
|
|
}
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
delay(400);
|
|
|
|
|
}
|
|
|
|
|
y = 26;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
lee_dibujos(num_room);
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
hay_seleccion = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::print_abc(const char *dicho, int x_pantalla, int y_pantalla) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int pos_texto[8];
|
2007-07-29 17:48:25 +00:00
|
|
|
|
int y_de_letra = 0, x_de_letra = 0, h, longitud;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
|
|
|
|
for (h = 0; h < longitud; h++) {
|
|
|
|
|
y_de_letra = Y_ABC;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
char c = toupper(dicho[h]);
|
|
|
|
|
if (c == 'A')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_A;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'B')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_B;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'C')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_C;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'D')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_D;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'E')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_E;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'F')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_F;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'G')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_G;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'H')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_H;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'I')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_I;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'J')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_J;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'K')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_K;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'L')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_L;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'M')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_M;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'N')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
//TODO else if (c == '<27>')
|
|
|
|
|
// x_de_letra = X_GN;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
|
|
|
|
x_de_letra = X_GN;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'O')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_O;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'P')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_P;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'Q')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_Q;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'R')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_R;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'S')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_S;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'T')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_T;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'U')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_U;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'V')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_V;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'W')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_W;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'X')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_X;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'Y')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_Y;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == 'Z')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_Z;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (/*c == 0xa7 ||*/ c == ' ')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = ESPACIO;
|
|
|
|
|
else {
|
|
|
|
|
y_de_letra = Y_SIGNOS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
if (c == '.')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_PUNTO;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == ',')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_COMA;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '-')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_GUION;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '?')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_CIERRA_INTERROGACION;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
//TODO else if (c == '<27>')
|
|
|
|
|
// x_de_letra = X_ABRE_INTERROGACION;
|
|
|
|
|
else if (c == '"')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_COMILLAS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '!')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_CIERRA_EXCLAMACION;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
//TODO else if (c == '<27>')
|
|
|
|
|
// x_de_letra = X_ABRE_EXCLAMACION;
|
|
|
|
|
else if (c == ';')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_PUNTO_Y_COMA;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_MAYOR_QUE;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_MENOR_QUE;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '$')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_DOLAR;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '%')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_POR_CIENTO;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == ':')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_DOS_PUNTOS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '&')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_AND;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '/')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_BARRA;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '(')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_ABRE_PARENTESIS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == ')')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_CIERRA_PARENTESIS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '*')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_ASTERISCO;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '+')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_MAS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '1')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N1;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '2')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N2;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '3')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N3;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '4')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N4;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '5')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N5;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '6')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N6;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '7')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N7;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '8')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N8;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '9')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N9;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '0')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N0;
|
|
|
|
|
else
|
|
|
|
|
y_de_letra = Y_ACENTOS;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
/*
|
|
|
|
|
if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_A;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_B;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_C;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_D;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_E;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_F;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_G;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_H;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_I;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_J;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_K;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_L;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_M;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_GN;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '\'')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_O;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_P;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_P;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_A;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_B;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_C;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_D;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_E;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_F;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_G;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_H;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_I;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_J;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_K;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_L;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_M;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_GN;
|
2007-07-28 22:00:21 +00:00
|
|
|
|
*/ }
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pos_texto[0] = x_de_letra;
|
|
|
|
|
pos_texto[1] = y_de_letra;
|
|
|
|
|
pos_texto[2] = x_pantalla;
|
|
|
|
|
pos_texto[3] = y_pantalla;
|
|
|
|
|
pos_texto[4] = ANCHO_LETRAS;
|
|
|
|
|
pos_texto[5] = ALTO_LETRAS;
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_texto, dir_texto, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
x_pantalla = x_pantalla + ANCHO_LETRAS;
|
|
|
|
|
if (x_pantalla > 317) {
|
|
|
|
|
x_pantalla = 0;
|
|
|
|
|
y_pantalla = y_pantalla + ALTO_LETRAS + 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-07-17 21:35:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
void DrasculaEngine::delay(int ms) {
|
2007-07-29 07:12:24 +00:00
|
|
|
|
_system->delayMillis(ms * 2); // originaly was 1
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::confirma_go() {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key;
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(ROJO);
|
|
|
|
|
refresca_pantalla();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
centra_texto(SYS0, 160, 87);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
key = getscan();
|
|
|
|
|
if (key != 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_DELETE) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
stopmusic();
|
|
|
|
|
carga_partida("gsave00");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::confirma_salir() {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key;
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(ROJO);
|
|
|
|
|
refresca_pantalla();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
centra_texto(SYS1, 160, 87);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
key = getscan();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (key != 0)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
stopmusic();
|
|
|
|
|
salir_al_dos(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::salva_pantallas() {
|
|
|
|
|
int xr, yr;
|
|
|
|
|
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
|
|
|
|
|
lee_dibujos("sv.alg");
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
//TODO inicio_ghost();
|
|
|
|
|
//TODO carga_ghost();
|
|
|
|
|
|
|
|
|
|
MirarRaton();
|
|
|
|
|
xr = x_raton;
|
|
|
|
|
yr = y_raton;
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
|
//TODO efecto(dir_dibujo1);
|
|
|
|
|
MirarRaton();
|
|
|
|
|
if (boton_dch == 1 || boton_izq == 1)
|
|
|
|
|
break;
|
|
|
|
|
if (x_raton != xr)
|
|
|
|
|
break;
|
|
|
|
|
if (y_raton != yr)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
//TODO fin_ghost();
|
|
|
|
|
lee_dibujos(num_room);
|
|
|
|
|
descomprime_dibujo(dir_dibujo1, MEDIA);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::fliplay(const char *filefli, int vel) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
OpenSSN(filefli, vel);
|
|
|
|
|
while (PlayFrameSSN() && (!term_int)) {
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (getscan() == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
}
|
|
|
|
|
EndSSN();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::FundeDelNegro(int VelocidadDeFundido) {
|
|
|
|
|
char fundido;
|
|
|
|
|
unsigned int color, componente;
|
|
|
|
|
|
|
|
|
|
DacPalette256 palFundido;
|
|
|
|
|
|
|
|
|
|
for (fundido = 0; fundido < 64; fundido++) {
|
|
|
|
|
for (color = 0; color < 256; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++) {
|
|
|
|
|
palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pausa(VelocidadDeFundido);
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
setvgapalette256((byte *)&palFundido);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::color_abc(int cl) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_color = cl;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (cl == 0) {
|
|
|
|
|
palJuego[254][0] = 0;
|
|
|
|
|
palJuego[254][1] = 0;
|
|
|
|
|
palJuego[254][2] = 0;
|
|
|
|
|
} else if (cl == 1) {
|
|
|
|
|
palJuego[254][0] = 0x10;
|
|
|
|
|
palJuego[254][1] = 0x3E;
|
|
|
|
|
palJuego[254][2] = 0x28;
|
|
|
|
|
} else if (cl == 3) {
|
|
|
|
|
palJuego[254][0] = 0x16;
|
|
|
|
|
palJuego[254][1] = 0x3F;
|
|
|
|
|
palJuego[254][2] = 0x16;
|
|
|
|
|
} else if (cl == 4) {
|
|
|
|
|
palJuego[254][0] = 0x9;
|
|
|
|
|
palJuego[254][1] = 0x3F;
|
|
|
|
|
palJuego[254][2] = 0x12;
|
|
|
|
|
} else if (cl == 5) {
|
|
|
|
|
palJuego[254][0] = 0x3F;
|
|
|
|
|
palJuego[254][1] = 0x3F;
|
|
|
|
|
palJuego[254][2] = 0x15;
|
|
|
|
|
} else if (cl == 7) {
|
|
|
|
|
palJuego[254][0] = 0x38;
|
2007-07-27 04:23:22 +00:00
|
|
|
|
palJuego[254][1] = 0;
|
|
|
|
|
palJuego[254][2] = 0;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else if (cl == 8) {
|
|
|
|
|
palJuego[254][0] = 0x3F;
|
|
|
|
|
palJuego[254][1] = 0x27;
|
|
|
|
|
palJuego[254][2] = 0x0B;
|
|
|
|
|
} else if (cl == 9) {
|
|
|
|
|
palJuego[254][0] = 0x2A;
|
|
|
|
|
palJuego[254][1] = 0;
|
|
|
|
|
palJuego[254][2] = 0x2A;
|
|
|
|
|
} else if (cl == 10) {
|
|
|
|
|
palJuego[254][0] = 0x30;
|
|
|
|
|
palJuego[254][1] = 0x30;
|
|
|
|
|
palJuego[254][2] = 0x30;
|
|
|
|
|
} else if (cl == 11) {
|
|
|
|
|
palJuego[254][0] = 98;
|
|
|
|
|
palJuego[254][1] = 91;
|
|
|
|
|
palJuego[254][2] = 100;
|
|
|
|
|
};
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
setvgapalette256((byte *)&palJuego);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-29 06:37:45 +00:00
|
|
|
|
char DrasculaEngine::LimitaVGA(char valor) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
return (valor & 0x3F) * (valor > 0);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::centra_texto(const char *mensaje, int x_texto, int y_texto) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
char bb[190], m2[190], m1[190], mb[10][40];
|
2007-07-26 19:52:18 +00:00
|
|
|
|
char m3[190];
|
|
|
|
|
int h, fil, x_texto3, x_texto2, x_texto1, conta_f = 0, ya = 0;
|
|
|
|
|
|
|
|
|
|
strcpy(m1, " ");
|
|
|
|
|
strcpy(m2, " ");
|
|
|
|
|
strcpy(m3, " ");
|
|
|
|
|
strcpy(bb, " ");
|
|
|
|
|
|
|
|
|
|
for (h = 0; h < 10; h++)
|
|
|
|
|
strcpy(mb[h], " ");
|
|
|
|
|
|
|
|
|
|
if (x_texto > 160)
|
|
|
|
|
ya = 1;
|
|
|
|
|
|
|
|
|
|
strcpy(m1, mensaje);
|
|
|
|
|
if (x_texto < 60)
|
2007-07-28 21:15:35 +00:00
|
|
|
|
x_texto = 60;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (x_texto > 255)
|
2007-07-28 21:15:35 +00:00
|
|
|
|
x_texto = 255;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
x_texto1 = x_texto;
|
|
|
|
|
|
|
|
|
|
if (ya == 1)
|
|
|
|
|
x_texto1 = 315 - x_texto;
|
|
|
|
|
|
|
|
|
|
x_texto2 = (strlen(m1) / 2) * ANCHO_LETRAS;
|
|
|
|
|
|
|
|
|
|
tut:
|
|
|
|
|
strcpy(bb, m1);
|
2007-07-27 04:23:22 +00:00
|
|
|
|
scumm_strrev(bb);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (x_texto1 < x_texto2) {
|
|
|
|
|
strcpy(m3, strrchr(m1, ' '));
|
|
|
|
|
strcpy(m1, strstr(bb, " "));
|
2007-07-27 04:23:22 +00:00
|
|
|
|
scumm_strrev(m1);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
m1[strlen(m1) - 1] = '\0';
|
|
|
|
|
strcat(m3, m2);
|
|
|
|
|
strcpy(m2, m3);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
x_texto2 = (strlen(m1) / 2) * ANCHO_LETRAS;
|
|
|
|
|
if (x_texto1 < x_texto2)
|
|
|
|
|
goto tut;
|
|
|
|
|
strcpy(mb[conta_f], m1);
|
|
|
|
|
|
|
|
|
|
if (!strcmp(m2, ""))
|
|
|
|
|
goto imprimir;
|
2007-07-27 04:23:22 +00:00
|
|
|
|
scumm_strrev(m2);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
m2[strlen(m2) - 1] = '\0';
|
2007-07-27 04:23:22 +00:00
|
|
|
|
scumm_strrev(m2);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
strcpy(m1, m2);
|
|
|
|
|
strcpy(m2, "");
|
|
|
|
|
conta_f++;
|
|
|
|
|
|
|
|
|
|
goto tut;
|
|
|
|
|
|
|
|
|
|
imprimir:
|
|
|
|
|
|
|
|
|
|
fil = y_texto - (((conta_f + 3) * ALTO_LETRAS));
|
|
|
|
|
|
|
|
|
|
for (h = 0; h < conta_f + 1; h++) {
|
|
|
|
|
x_texto3 = strlen(mb[h]) / 2;
|
|
|
|
|
print_abc(mb[h], ((x_texto) - x_texto3 * ANCHO_LETRAS) - 1, fil);
|
|
|
|
|
fil = fil + ALTO_LETRAS + 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::comienza_sound(const char *fichero) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(fichero);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::anima(const char *animacion, int FPS) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Common::File FileIn;
|
2007-07-29 17:48:25 +00:00
|
|
|
|
unsigned j;
|
|
|
|
|
int NFrames = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int cnt = 2;
|
|
|
|
|
|
2007-07-28 15:18:21 +00:00
|
|
|
|
AuxBuffLast = (byte *)malloc(65000);
|
|
|
|
|
AuxBuffDes = (byte *)malloc(65000);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
FileIn.open(animacion);
|
|
|
|
|
|
|
|
|
|
if (!FileIn.isOpen()) {
|
|
|
|
|
error("No encuentro un fichero de animacion.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FileIn.read(&NFrames, sizeof(NFrames));
|
|
|
|
|
FileIn.read(&Leng, sizeof(Leng));
|
2007-07-28 15:18:21 +00:00
|
|
|
|
AuxBuffOrg = (byte *)malloc(Leng);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
FileIn.read(AuxBuffOrg, Leng);
|
|
|
|
|
FileIn.read(cPal, 768);
|
|
|
|
|
carga_pcx(AuxBuffOrg);
|
|
|
|
|
free(AuxBuffOrg);
|
|
|
|
|
memcpy(VGA, AuxBuffDes, 64000);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
|
|
|
|
_system->updateScreen();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
set_dac(cPal);
|
|
|
|
|
memcpy(AuxBuffLast, AuxBuffDes, 64000);
|
2007-08-01 19:31:36 +00:00
|
|
|
|
WaitForNext(FPS);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
while (cnt < NFrames) {
|
|
|
|
|
FileIn.read(&Leng, sizeof(Leng));
|
2007-07-28 15:18:21 +00:00
|
|
|
|
AuxBuffOrg = (byte *)malloc(Leng);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
FileIn.read(AuxBuffOrg, Leng);
|
|
|
|
|
FileIn.read(cPal, 768);
|
|
|
|
|
carga_pcx(AuxBuffOrg);
|
|
|
|
|
free(AuxBuffOrg);
|
|
|
|
|
for (j = 0;j < 64000; j++) {
|
|
|
|
|
VGA[j] = AuxBuffLast[j] = AuxBuffDes[j] ^ AuxBuffLast[j];
|
|
|
|
|
}
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
|
|
|
|
_system->updateScreen();
|
2007-08-01 19:31:36 +00:00
|
|
|
|
WaitForNext(FPS);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
cnt++;
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
2007-07-28 21:15:35 +00:00
|
|
|
|
if (key != 0)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
free(AuxBuffLast);
|
|
|
|
|
free(AuxBuffDes);
|
|
|
|
|
FileIn.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::animafin_sound_corte() {
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
ctvd_stop();
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::FundeAlNegro(int VelocidadDeFundido) {
|
|
|
|
|
char fundido;
|
|
|
|
|
unsigned int color, componente;
|
|
|
|
|
|
|
|
|
|
DacPalette256 palFundido;
|
|
|
|
|
|
|
|
|
|
for (fundido = 63; fundido >= 0; fundido--) {
|
|
|
|
|
for (color = 0; color < 256; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++) {
|
|
|
|
|
palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pausa(VelocidadDeFundido);
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
setvgapalette256((byte *)&palFundido);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pausa(int cuanto) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
_system->delayMillis(cuanto * 30); // was originaly 2
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_dr_grande(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
int x_habla[4] = {47, 93, 139, 185};
|
|
|
|
|
int cara;
|
|
|
|
|
int l = 0;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(ROJO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(3);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
DIBUJA_FONDO(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, dir_dibujo2, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(x_habla[cara], 1, 171, 68, 45, 48, dir_dibujo2, dir_zona_pantalla);
|
|
|
|
|
l++;
|
|
|
|
|
if (l == 7)
|
2007-07-29 07:12:24 +00:00
|
|
|
|
l = 0;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, 191, 69);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pon_igor() {
|
|
|
|
|
int pos_igor[6];
|
|
|
|
|
|
|
|
|
|
pos_igor[0] = 1;
|
|
|
|
|
if (sentido_igor == 3)
|
|
|
|
|
pos_igor[1] = 138;
|
|
|
|
|
else if (sentido_igor == 1)
|
|
|
|
|
pos_igor[1] = 76;
|
|
|
|
|
pos_igor[2] = x_igor;
|
|
|
|
|
pos_igor[3] = y_igor;
|
|
|
|
|
pos_igor[4] = 54;
|
|
|
|
|
pos_igor[5] = 61;
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_igor, dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pon_dr() {
|
|
|
|
|
int pos_dr[6];
|
|
|
|
|
|
|
|
|
|
if (sentido_dr == 1)
|
|
|
|
|
pos_dr[0] = 47;
|
|
|
|
|
else if (sentido_dr == 0)
|
|
|
|
|
pos_dr[0] = 1;
|
|
|
|
|
else if (sentido_dr == 3)
|
|
|
|
|
pos_dr[0] = 93;
|
|
|
|
|
pos_dr[1] = 122;
|
|
|
|
|
pos_dr[2] = x_dr;
|
|
|
|
|
pos_dr[3] = y_dr;
|
|
|
|
|
pos_dr[4] = 45;
|
|
|
|
|
pos_dr[5] = 77;
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_dr, dir_hare_fondo, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pon_bj() {
|
|
|
|
|
int pos_bj[6];
|
|
|
|
|
|
|
|
|
|
if (sentido_bj == 3)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pos_bj[0] = 10;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (sentido_bj == 0)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pos_bj[0] = 37;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pos_bj[1] = 99;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pos_bj[2] = x_bj;
|
|
|
|
|
pos_bj[3] = y_bj;
|
|
|
|
|
pos_bj[4] = 26;
|
|
|
|
|
pos_bj[5] = 76;
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_bj, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_igor_dch(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[8] = { 56, 82, 108, 134, 160, 186, 212, 238};
|
|
|
|
|
int cara;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
|
|
|
|
tiempol = time (NULL);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(BLANCO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(7);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
DIBUJA_FONDO(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24,
|
|
|
|
|
dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE(x_habla[cara], 148, x_igor + 17, y_igor, 25, 24,
|
|
|
|
|
dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, x_igor + 26, y_igor);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_dr_izq(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
|
|
|
|
|
int cara;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-08-01 19:31:36 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(ROJO);
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(7);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_BLOQUE(x_habla[cara], 90, x_dr, y_dr, 38, 31,
|
2007-07-28 09:45:05 +00:00
|
|
|
|
dir_hare_fondo, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, x_dr + 19, y_dr);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_dr_dch(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
|
|
|
|
|
int cara;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(ROJO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(7);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_BLOQUE(x_habla[cara], 58, x_dr + 7, y_dr, 38, 31,
|
|
|
|
|
dir_hare_fondo, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, x_dr + 19, y_dr);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_solo(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
color_abc(color_solo);
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
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, 90);
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_igor_frente(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[8] = { 56, 86, 116, 146, 176, 206, 236, 266};
|
|
|
|
|
int cara;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(BLANCO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(7);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
DIBUJA_FONDO(x_igor, y_igor, x_igor, y_igor, 29, 25,
|
|
|
|
|
dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_BLOQUE(x_habla[cara], 173, x_igor, y_igor, 29, 25,
|
|
|
|
|
dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, x_igor + 26, y_igor);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0,0, 0,0, 320,200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
pon_igor();
|
|
|
|
|
pon_dr();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::habla_tabernero(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177};
|
|
|
|
|
int cara;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(MARRON);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
|
|
|
|
if (music_status() == 0)
|
|
|
|
|
playmusic(musica_room);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(8);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(x_habla[cara], 2, 121, 44, 21, 24, dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
pon_hare();
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, 132, 45);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete(sku);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::hipo(int contador) {
|
|
|
|
|
int y = 0, sentido = 0;
|
|
|
|
|
|
|
|
|
|
contador = contador;
|
|
|
|
|
|
|
|
|
|
comienza:
|
|
|
|
|
contador--;
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
refresca_pantalla();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (sentido == 0)
|
|
|
|
|
y++;
|
|
|
|
|
else
|
|
|
|
|
y--;
|
|
|
|
|
if (y == 2)
|
|
|
|
|
sentido = 1;
|
|
|
|
|
if (y == 0)
|
|
|
|
|
sentido = 0;
|
|
|
|
|
if (contador > 0)
|
|
|
|
|
goto comienza;
|
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::fin_sound() {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
delay(1);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
while (LookForFree() != 0);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::habla_bj(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[5] = { 64, 92, 120, 148, 176};
|
|
|
|
|
int cara;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(BLANCO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(4);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(x_bj + 2, y_bj - 1, x_bj + 2, y_bj - 1, 27, 40,
|
|
|
|
|
dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE(x_habla[cara], 99, x_bj + 2, y_bj - 1, 27, 40,
|
|
|
|
|
dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
pon_hare();
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, x_bj + 7, y_bj);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::hablar(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int suma_1_pixel = 1;
|
|
|
|
|
|
|
|
|
|
int y_mask_habla = 170;
|
|
|
|
|
int x_habla_dch[6] = { 1, 25, 49, 73, 97, 121 };
|
|
|
|
|
int x_habla_izq[6] = { 145, 169, 193, 217, 241, 265 };
|
|
|
|
|
int cara;
|
|
|
|
|
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (factor_red[hare_y + alto_hare] == 100)
|
|
|
|
|
suma_1_pixel = 0;
|
|
|
|
|
|
|
|
|
|
color_abc(AMARILLO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(5);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ+1, 0,
|
2007-07-29 17:48:25 +00:00
|
|
|
|
ancho_hare * factor_red[hare_y + alto_hare] / 100,
|
|
|
|
|
(alto_habla - 1) * factor_red[hare_y + alto_hare] / 100,
|
2007-07-28 09:45:05 +00:00
|
|
|
|
dir_zona_pantalla, dir_dibujo3);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pon_hare();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y,
|
2007-07-29 17:48:25 +00:00
|
|
|
|
ancho_hare * factor_red[hare_y + alto_hare] / 100,
|
|
|
|
|
(alto_habla - 1) * factor_red[hare_y + alto_hare] / 100,
|
2007-07-26 19:52:18 +00:00
|
|
|
|
dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (sentido_hare == 0) {
|
|
|
|
|
reduce_hare_chico(x_habla_izq[cara], y_mask_habla,
|
2007-07-29 17:48:25 +00:00
|
|
|
|
hare_x + 8 * factor_red[hare_y + alto_hare] / 100,
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
} else if (sentido_hare == 1) {
|
|
|
|
|
reduce_hare_chico(x_habla_dch[cara], y_mask_habla,
|
2007-07-29 17:48:25 +00:00
|
|
|
|
hare_x + 12 * factor_red[hare_y + alto_hare] / 100,
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
} else if (sentido_hare == 2) {
|
|
|
|
|
reduce_hare_chico(x_habla_izq[cara], y_mask_habla,
|
2007-07-29 17:48:25 +00:00
|
|
|
|
suma_1_pixel + hare_x + 12 * factor_red[hare_y + alto_hare] / 100,
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
} else if (sentido_hare == 3) {
|
|
|
|
|
reduce_hare_chico(x_habla_dch[cara], y_mask_habla,
|
2007-07-29 17:48:25 +00:00
|
|
|
|
suma_1_pixel + hare_x + 8 * factor_red[hare_y + alto_hare] / 100,
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, hare_x, hare_y);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_ESCAPE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
term_int = 1;
|
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (music_status() == 0 && flags[11] == 0 && corta_musica == 0)
|
|
|
|
|
playmusic(musica_room);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::playmusic(int p) {
|
2007-08-01 20:11:32 +00:00
|
|
|
|
AudioCD.stop();
|
|
|
|
|
AudioCD.play(p - 1, 1, 0, 0);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
void DrasculaEngine::stopmusic() {
|
2007-08-01 20:11:32 +00:00
|
|
|
|
AudioCD.stop();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int DrasculaEngine::music_status() {
|
2007-08-01 20:12:45 +00:00
|
|
|
|
return AudioCD.isPlaying();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::refresca_pantalla() {
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
pon_hare();
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::carga_partida(const char *nom_game) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int l, n_ejec2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
char buffer[256];
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
canal_p(nom_game);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(nom_game);
|
|
|
|
|
if (!ald->isOpen()) {
|
|
|
|
|
error("missing data file");
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-07-28 14:45:26 +00:00
|
|
|
|
int size = sku->size();
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &n_ejec2);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (n_ejec2 != num_ejec) {
|
|
|
|
|
canal_p(nom_game);
|
|
|
|
|
strcpy(nom_partida, nom_game);
|
|
|
|
|
salir_al_dos(n_ejec2);
|
|
|
|
|
}
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", datos_actuales);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &hare_x);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &hare_y);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &sentido_hare);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
for (l = 1; l < 43; l++) {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &objetos_que_tengo[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (l = 0; l < NUM_BANDERAS; l++) {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &flags[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &lleva_objeto);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &objeto_que_lleva);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
delete ald;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
canal_p(nom_game);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::canal_p(const char *fich){
|
2007-08-01 19:31:36 +00:00
|
|
|
|
return;
|
|
|
|
|
// TODO
|
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Common::File ald2, ald3;
|
|
|
|
|
|
|
|
|
|
char fich2[13];
|
|
|
|
|
char car;
|
|
|
|
|
|
|
|
|
|
strcpy(fich2, "top");
|
|
|
|
|
|
|
|
|
|
ald3.open(fich);
|
|
|
|
|
if (!ald3.isOpen()) {
|
|
|
|
|
error("no puedo abrir el archivo codificado");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ald2.open(fich2, Common::File::kFileWriteMode);
|
|
|
|
|
if (!ald2.isOpen()) {
|
|
|
|
|
error("no puedo abrir el archivo destino");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
car = ald3.readByte();
|
|
|
|
|
while (!ald3.eos()) {
|
|
|
|
|
ald2.writeByte(codifica(car));
|
|
|
|
|
car = ald3.readByte();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ald2.close();
|
|
|
|
|
ald3.close();
|
|
|
|
|
remove(fich);
|
|
|
|
|
rename(fich2, fich);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::puertas_cerradas (int l) {}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::color_hare() {
|
|
|
|
|
int color, componente;
|
|
|
|
|
|
|
|
|
|
for (color = 235; color < 253; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++) {
|
|
|
|
|
palJuego[color][componente] = palHare[color][componente];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ActualizaPaleta();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::funde_hare(int oscuridad) {
|
|
|
|
|
char fundido;
|
|
|
|
|
unsigned int color, componente;
|
|
|
|
|
|
|
|
|
|
for (fundido = oscuridad; fundido >= 0; fundido--) {
|
|
|
|
|
for (color = 235; color < 253; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++)
|
2007-07-28 21:36:46 +00:00
|
|
|
|
palJuego[color][componente] = LimitaVGA(palJuego[color][componente] - 8 + fundido);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ActualizaPaleta();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::paleta_hare_claro() {
|
|
|
|
|
int color, componente;
|
|
|
|
|
|
|
|
|
|
for (color = 235; color < 253; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++)
|
|
|
|
|
palHareClaro[color][componente] = palJuego[color][componente];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::paleta_hare_oscuro() {
|
|
|
|
|
int color, componente;
|
|
|
|
|
|
|
|
|
|
for (color = 235; color < 253; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++)
|
|
|
|
|
palHareOscuro[color][componente] = palJuego[color][componente];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::hare_claro() {
|
|
|
|
|
int color, componente;
|
|
|
|
|
|
|
|
|
|
for (color = 235; color < 253; color++) {
|
|
|
|
|
for (componente = 0; componente < 3; componente++)
|
|
|
|
|
palJuego[color][componente] = palHareClaro[color][componente];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ActualizaPaleta();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::empieza_andar() {
|
|
|
|
|
hare_se_mueve = 1;
|
|
|
|
|
|
|
|
|
|
paso_x = PASO_HARE_X;
|
|
|
|
|
paso_y = PASO_HARE_Y;
|
|
|
|
|
|
|
|
|
|
if ((sitio_x < hare_x + ancho_hare / 2 ) && (sitio_y <= (hare_y + alto_hare)))
|
2007-07-28 09:45:05 +00:00
|
|
|
|
cuadrante_1();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if ((sitio_x < hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare)))
|
2007-07-28 09:45:05 +00:00
|
|
|
|
cuadrante_3();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y <= (hare_y + alto_hare)))
|
2007-07-28 09:45:05 +00:00
|
|
|
|
cuadrante_2();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare)))
|
2007-07-28 09:45:05 +00:00
|
|
|
|
cuadrante_4();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else
|
|
|
|
|
hare_se_mueve=0;
|
|
|
|
|
|
|
|
|
|
conta_vez = vez();
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
void DrasculaEngine::actualiza_refresco() {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (!strcmp(num_room, "63.alg"))
|
|
|
|
|
refresca_63();
|
|
|
|
|
else if (!strcmp(num_room, "62.alg"))
|
|
|
|
|
refresca_62();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::actualiza_refresco_antes() {
|
|
|
|
|
if (!strcmp(num_room, "62.alg"))
|
|
|
|
|
refresca_62_antes();
|
|
|
|
|
else if (!strcmp(num_room, "16.alg"))
|
|
|
|
|
pon_bj();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pon_hare() {
|
|
|
|
|
int pos_hare[6];
|
|
|
|
|
int r;
|
|
|
|
|
|
|
|
|
|
if (hare_se_mueve == 1 && paso_x == PASO_HARE_X) {
|
|
|
|
|
for (r = 0; r < paso_x; r++) {
|
|
|
|
|
if (sentido_hare == 0 && sitio_x - r == hare_x + ancho_hare / 2) {
|
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
paso_x = PASO_HARE_X;
|
|
|
|
|
paso_y = PASO_HARE_Y;
|
|
|
|
|
}
|
|
|
|
|
if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare / 2) {
|
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
paso_x = PASO_HARE_X;
|
|
|
|
|
paso_y = PASO_HARE_Y;
|
|
|
|
|
hare_x = sitio_x - ancho_hare / 2;
|
|
|
|
|
hare_y = sitio_y - alto_hare;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (hare_se_mueve == 1 && paso_y == PASO_HARE_Y) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
for (r = 0; r < paso_y; r++) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (sentido_hare == 2 && sitio_y - r == hare_y + alto_hare) {
|
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
paso_x = PASO_HARE_X;
|
|
|
|
|
paso_y = PASO_HARE_Y;
|
|
|
|
|
}
|
|
|
|
|
if (sentido_hare == 3 && sitio_y + r == hare_y + alto_hare) {
|
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
paso_x = PASO_HARE_X;
|
|
|
|
|
paso_y = PASO_HARE_Y;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hare_se_ve == 0)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
goto no_vuelco;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (hare_se_mueve == 0) {
|
|
|
|
|
pos_hare[0] = 0;
|
|
|
|
|
pos_hare[1] = DIF_MASK_HARE;
|
|
|
|
|
pos_hare[2] = hare_x;
|
|
|
|
|
pos_hare[3] = hare_y;
|
|
|
|
|
pos_hare[4] = ANCHO_PERSONAJE;
|
|
|
|
|
pos_hare[5] = ALTO_PERSONAJE;
|
|
|
|
|
|
|
|
|
|
if (sentido_hare == 0) {
|
|
|
|
|
pos_hare[1] = 0;
|
|
|
|
|
reduce_hare_chico(pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
} else if (sentido_hare == 1)
|
|
|
|
|
reduce_hare_chico(pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
else if (sentido_hare == 2)
|
|
|
|
|
reduce_hare_chico( pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_fondo, dir_zona_pantalla);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
else
|
2007-07-26 19:52:18 +00:00
|
|
|
|
reduce_hare_chico( pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
} else if (hare_se_mueve == 1) {
|
|
|
|
|
pos_hare[0] = frame_x[num_frame];
|
|
|
|
|
pos_hare[1] = frame_y + DIF_MASK_HARE;
|
|
|
|
|
pos_hare[2] = hare_x;
|
|
|
|
|
pos_hare[3] = hare_y;
|
|
|
|
|
pos_hare[4] = ANCHO_PERSONAJE;
|
|
|
|
|
pos_hare[5] = ALTO_PERSONAJE;
|
|
|
|
|
if (sentido_hare == 0) {
|
|
|
|
|
pos_hare[1] = 0;
|
|
|
|
|
reduce_hare_chico(pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
} else if (sentido_hare == 1)
|
|
|
|
|
reduce_hare_chico(pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
else if (sentido_hare == 2)
|
|
|
|
|
reduce_hare_chico(pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_fondo, dir_zona_pantalla);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
else
|
2007-07-26 19:52:18 +00:00
|
|
|
|
reduce_hare_chico(pos_hare[0], pos_hare[1],
|
|
|
|
|
pos_hare[2], pos_hare[3],
|
|
|
|
|
pos_hare[4], pos_hare[5],
|
|
|
|
|
factor_red[hare_y + alto_hare],
|
|
|
|
|
dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
no_vuelco:
|
|
|
|
|
aumenta_num_frame();
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
void DrasculaEngine::menu_sin_volcar() {
|
|
|
|
|
int h, n, x;
|
|
|
|
|
char texto_icono[13];
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x = sobre_que_objeto();
|
|
|
|
|
strcpy(texto_icono, nombre_icono[x]);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
for (n = 1; n < 43; n++) {
|
|
|
|
|
h = objetos_que_tengo[n];
|
|
|
|
|
|
|
|
|
|
if (h != 0)
|
|
|
|
|
DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
|
2007-07-28 09:45:05 +00:00
|
|
|
|
ANCHOBJ, ALTOBJ, dir_hare_frente, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE(x1d_menu[h], y1d_menu[h], x_obj[n], y_obj[n],
|
|
|
|
|
ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (x < 7)
|
2007-08-01 19:31:36 +00:00
|
|
|
|
print_abc(texto_icono, x_obj[x] - 2, y_obj[x] - 7);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::barra_menu() {
|
|
|
|
|
int n, sobre_verbo = 1;
|
|
|
|
|
|
|
|
|
|
for (n = 0; n < 7; n++) {
|
|
|
|
|
if (x_raton > x_barra[n] && x_raton < x_barra[n + 1])
|
|
|
|
|
sobre_verbo = 0;
|
|
|
|
|
DIBUJA_BLOQUE(ANCHOBJ * n, ALTOBJ * sobre_verbo,
|
2007-07-28 09:45:05 +00:00
|
|
|
|
x_barra[n], 2, ANCHOBJ, ALTOBJ,
|
|
|
|
|
dir_hare_fondo, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
sobre_verbo = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::saca_objeto() {
|
|
|
|
|
int h = 0, n;
|
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
|
|
|
|
|
for (n = 1; n < 43; n++){
|
|
|
|
|
if (sobre_que_objeto() == n) {
|
|
|
|
|
h = objetos_que_tengo[n];
|
|
|
|
|
objetos_que_tengo[n] = 0;
|
|
|
|
|
if (h != 0)
|
|
|
|
|
lleva_objeto = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
espera_soltar();
|
|
|
|
|
|
|
|
|
|
if (lleva_objeto == 1)
|
|
|
|
|
elige_objeto(h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::sal_de_la_habitacion(int l) {
|
|
|
|
|
char salgo[13];
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (num_obj[l] == 105 && flags[0] == 0)
|
|
|
|
|
hablar(TEXT442, "442.als");
|
|
|
|
|
else {
|
|
|
|
|
puertas_cerradas(l);
|
|
|
|
|
|
|
|
|
|
if (espuerta[l] != 0) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
sentido_hare = sentidobj[l];
|
|
|
|
|
refresca_pantalla();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
sentido_hare = sentido_alkeva[l];
|
|
|
|
|
obj_saliendo = alapuertakeva[l];
|
|
|
|
|
rompo = 1;
|
|
|
|
|
musica_antes = musica_room;
|
|
|
|
|
|
|
|
|
|
if (num_obj[l] == 105)
|
|
|
|
|
animacion_2();
|
|
|
|
|
borra_pantalla();
|
|
|
|
|
strcpy(salgo, alapantallakeva[l]);
|
|
|
|
|
strcat(salgo, ".ald");
|
|
|
|
|
hare_x = -1;
|
|
|
|
|
carga_escoba(salgo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::coge_objeto() {
|
|
|
|
|
int h, n;
|
|
|
|
|
h = objeto_que_lleva;
|
|
|
|
|
comprueba_flags = 1;
|
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
menu_sin_volcar();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (objeto_que_lleva < 7)
|
|
|
|
|
goto usando_verbos;
|
|
|
|
|
|
|
|
|
|
for (n = 1; n < 43; n++) {
|
|
|
|
|
if (sobre_que_objeto() == n && objetos_que_tengo[n] == 0) {
|
|
|
|
|
objetos_que_tengo[n] = h;
|
|
|
|
|
lleva_objeto = 0;
|
|
|
|
|
comprueba_flags = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
usando_verbos:
|
|
|
|
|
|
|
|
|
|
if (comprueba_flags == 1) {
|
|
|
|
|
comprueba_banderas_menu();
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
espera_soltar();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (lleva_objeto == 0)
|
|
|
|
|
sin_verbo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::banderas(int fl) {
|
|
|
|
|
hare_se_mueve = 0;
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
hay_respuesta = 1;
|
|
|
|
|
|
|
|
|
|
if (menu_scr == 1) {
|
|
|
|
|
|
|
|
|
|
if (objeto_que_lleva == MIRAR && fl == 28)
|
|
|
|
|
hablar(TEXT328, "328.als");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
} else {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (objeto_que_lleva == MIRAR && fl == 50)
|
|
|
|
|
hablar(TEXT308, "308.als");
|
|
|
|
|
else if (objeto_que_lleva == ABRIR && fl == 50)
|
|
|
|
|
hablar(TEXT310, "310.als" );
|
|
|
|
|
else if (objeto_que_lleva == CERRAR && fl == 50)
|
|
|
|
|
hablar(TEXT311, "311.als" );
|
|
|
|
|
else if (objeto_que_lleva == MOVER && fl == 50)
|
|
|
|
|
hablar(TEXT312, "312.als" );
|
|
|
|
|
else if (objeto_que_lleva == COGER && fl == 50)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
hablar(TEXT313, "313.als" );
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (objeto_que_lleva == HABLAR && fl == 50)
|
|
|
|
|
hablar(TEXT314,"314.als" );
|
|
|
|
|
else if (!strcmp(num_room, "62.alg"))
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pantalla_62(fl);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (!strcmp(num_room, "63.alg"))
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pantalla_63(fl);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else
|
|
|
|
|
hay_respuesta = 0;
|
|
|
|
|
}
|
|
|
|
|
if (hay_respuesta == 0 && hay_nombre == 1)
|
|
|
|
|
pantalla_0();
|
|
|
|
|
else if (hay_respuesta == 0 && menu_scr == 1)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pantalla_0();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::cursor_mesa() {
|
|
|
|
|
int pos_cursor[8];
|
|
|
|
|
|
|
|
|
|
pos_cursor[0] = 225;
|
|
|
|
|
pos_cursor[1] = 56;
|
|
|
|
|
pos_cursor[2] = x_raton - 20;
|
|
|
|
|
pos_cursor[3] = y_raton - 12;
|
|
|
|
|
pos_cursor[4] = 40;
|
|
|
|
|
pos_cursor[5] = 25;
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_cursor, dir_mesa, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::introduce_nombre() {
|
2007-07-28 19:43:26 +00:00
|
|
|
|
byte key;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int v = 0, h = 0;
|
|
|
|
|
char select2[23];
|
|
|
|
|
strcpy(select2, " ");
|
|
|
|
|
for (;;) {
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
select2[v] = '-';
|
|
|
|
|
DIBUJA_FONDO(115, 14, 115, 14, 176, 9, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
print_abc(select2, 117, 15);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
key = getscan();
|
|
|
|
|
if (key != 0) {
|
2007-08-01 22:11:04 +00:00
|
|
|
|
if (key == Common::KEYCODE_q)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'q';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_w)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'w';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_e)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'e';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_r)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'r';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_t)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 't';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_y)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'y';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_u)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'u';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_i)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'i';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_o)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'o';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_p)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'p';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_a)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'a';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_s)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 's';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_d)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'd';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_f)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'f';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_g)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'g';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_h)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'h';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_j)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'j';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_k)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'k';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_l)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'l';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if ((key == Common::KEYCODE_LCTRL) || (key == Common::KEYCODE_RCTRL))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '<EFBFBD>';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_z)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'z';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_x)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'x';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_c)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'c';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_v)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'v';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_b)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'b';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_n)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'n';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_m)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = 'm';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_1)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '1';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_2)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '2';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_3)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '3';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_4)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '4';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_5)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '5';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_6)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '6';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_7)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '7';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_8)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '8';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_9)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '9';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_0)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '0';
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_SPACE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '<EFBFBD>';
|
|
|
|
|
else if (key == ESC)
|
|
|
|
|
break;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
else if (key == Common::KEYCODE_RETURN) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
select2[v] = '\0';
|
|
|
|
|
h = 1;
|
|
|
|
|
break;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
} else if (key == Common::KEYCODE_BACKSPACE)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
select2[v] = '\0';
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else
|
|
|
|
|
v--;
|
2007-08-01 22:11:04 +00:00
|
|
|
|
|
|
|
|
|
if (key == Common::KEYCODE_BACKSPACE)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
v--;
|
|
|
|
|
else
|
|
|
|
|
v++;
|
|
|
|
|
}
|
|
|
|
|
if (v == 22)
|
|
|
|
|
v = 21;
|
|
|
|
|
else if (v == -1)
|
|
|
|
|
v = 0;
|
|
|
|
|
}
|
|
|
|
|
if (h == 1) {
|
|
|
|
|
strcpy(select, select2);
|
|
|
|
|
hay_seleccion = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::para_grabar(char nom_game[]) {
|
|
|
|
|
graba_partida(nom_game);
|
|
|
|
|
comienza_sound("99.als");
|
|
|
|
|
fin_sound();
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::OpenSSN(const char *Name, int Pause) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
MiVideoSSN = (byte *)malloc(64256);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
GlobalSpeed = CLOCKS_PER_SEC / Pause;
|
|
|
|
|
FrameSSN = 0;
|
|
|
|
|
UsingMem = 0;
|
|
|
|
|
if (MiVideoSSN == NULL)
|
|
|
|
|
return;
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion = new Common::File;
|
|
|
|
|
_Sesion->open(Name);
|
|
|
|
|
mSesion = TryInMem(_Sesion);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
LastFrame = clock();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int DrasculaEngine::PlayFrameSSN() {
|
|
|
|
|
int Exit = 0;
|
|
|
|
|
int Lengt;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
byte *BufferSSN;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (!UsingMem)
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion->read(&CHUNK, 1);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else {
|
|
|
|
|
memcpy(&CHUNK, mSesion, 1);
|
|
|
|
|
mSesion += 1;
|
|
|
|
|
}
|
|
|
|
|
switch (CHUNK) {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
case SET_PALET:
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (!UsingMem)
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion->read(dacSSN, 768);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else {
|
|
|
|
|
memcpy(dacSSN, mSesion, 768);
|
|
|
|
|
mSesion += 768;
|
|
|
|
|
}
|
|
|
|
|
set_dacSSN(dacSSN);
|
|
|
|
|
break;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
case EMPTY_FRAME:
|
2007-07-26 19:52:18 +00:00
|
|
|
|
WaitFrameSSN();
|
|
|
|
|
break;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
case INIT_FRAME:
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (!UsingMem) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion->read(&CMP, 1);
|
|
|
|
|
_Sesion->read(&Lengt, 4);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
memcpy(&CMP, mSesion, 1);
|
|
|
|
|
mSesion += 1;
|
|
|
|
|
memcpy(&Lengt, mSesion, 4);
|
|
|
|
|
mSesion += 4;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (CMP == CMP_RLE) {
|
|
|
|
|
if (!UsingMem) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
BufferSSN = (byte *)malloc(Lengt);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion->read(BufferSSN, Lengt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
BufferSSN = (byte *)malloc(Lengt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
memcpy(BufferSSN, mSesion, Lengt);
|
|
|
|
|
mSesion += Lengt;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Des_RLE(BufferSSN, MiVideoSSN);
|
|
|
|
|
free(BufferSSN);
|
|
|
|
|
if (FrameSSN) {
|
|
|
|
|
WaitFrameSSN();
|
|
|
|
|
MixVideo(VGA, MiVideoSSN);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
WaitFrameSSN();
|
|
|
|
|
memcpy(VGA, MiVideoSSN, 64000);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->updateScreen();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
FrameSSN++;
|
|
|
|
|
} else {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (CMP == CMP_OFF) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (!UsingMem) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
BufferSSN = (byte *)malloc(Lengt);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion->read(BufferSSN, Lengt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
BufferSSN = (byte *)malloc(Lengt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
memcpy(BufferSSN, mSesion, Lengt);
|
|
|
|
|
mSesion += Lengt;
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
Des_OFF(BufferSSN, MiVideoSSN, Lengt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
free(BufferSSN);
|
|
|
|
|
if (FrameSSN) {
|
|
|
|
|
WaitFrameSSN();
|
|
|
|
|
MixVideo(VGA, MiVideoSSN);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
WaitFrameSSN();
|
|
|
|
|
memcpy(VGA, MiVideoSSN, 64000);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-07-28 14:45:26 +00:00
|
|
|
|
_system->updateScreen();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
FrameSSN++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case END_ANIM:
|
|
|
|
|
Exit = 1;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
Exit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return (!Exit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::EndSSN() {
|
|
|
|
|
free(MiVideoSSN);
|
|
|
|
|
if (UsingMem)
|
|
|
|
|
free(pointer);
|
|
|
|
|
else {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
_Sesion->close();
|
|
|
|
|
delete _Sesion;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
byte *DrasculaEngine::TryInMem(Common::File *Sesion) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int Lengt;
|
|
|
|
|
|
|
|
|
|
Sesion->seek(0, SEEK_END);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
Lengt = Sesion->pos();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
Sesion->seek(0, SEEK_SET);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
pointer = (byte *)malloc(Lengt);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (pointer == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
Sesion->read(pointer, Lengt);
|
|
|
|
|
UsingMem = 1;
|
|
|
|
|
Sesion->close();
|
|
|
|
|
delete Sesion;
|
|
|
|
|
return pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 01:21:03 +00:00
|
|
|
|
void DrasculaEngine::set_dacSSN(byte *PalBuf) {
|
|
|
|
|
setvgapalette256((byte *)PalBuf);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght) {
|
|
|
|
|
int x = 0;
|
|
|
|
|
unsigned char Reps;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int Offset;
|
|
|
|
|
|
|
|
|
|
memset(MiVideoSSN, 0, 64000);
|
|
|
|
|
while (x < Lenght) {
|
|
|
|
|
Offset = BufferOFF[x] + BufferOFF[x + 1] * 256;
|
|
|
|
|
Reps = BufferOFF[x + 2];
|
|
|
|
|
memcpy(MiVideoOFF + Offset, &BufferOFF[x + 3], Reps);
|
|
|
|
|
x += 3 + Reps;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::Des_RLE(byte *BufferRLE, byte *MiVideoRLE) {
|
2007-07-27 00:25:06 +00:00
|
|
|
|
signed int con = 0;
|
|
|
|
|
unsigned int X = 0;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
unsigned int fExit = 0;
|
|
|
|
|
char ch, rep;
|
|
|
|
|
while (!fExit) {
|
|
|
|
|
ch = *BufferRLE++;
|
|
|
|
|
rep = 1;
|
|
|
|
|
if ((ch & 192) == 192) {
|
|
|
|
|
rep = (ch & 63);
|
|
|
|
|
ch =* BufferRLE++;
|
|
|
|
|
}
|
|
|
|
|
for (con = 0; con < rep; con++) {
|
|
|
|
|
*MiVideoRLE++ = ch;
|
|
|
|
|
X++;
|
|
|
|
|
if (X > 64000)
|
|
|
|
|
fExit = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int x;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
for (x = 0; x < 64000; x++)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
OldScreen[x] ^= NewScreen[x];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::WaitFrameSSN() {
|
|
|
|
|
while (clock() < LastFrame + GlobalSpeed) {};
|
|
|
|
|
LastFrame = LastFrame + GlobalSpeed;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 15:18:21 +00:00
|
|
|
|
byte *DrasculaEngine::carga_pcx(byte *NamePcc) {
|
2007-07-27 00:25:06 +00:00
|
|
|
|
signed int con = 0;
|
|
|
|
|
unsigned int X = 0;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
unsigned int fExit = 0;
|
|
|
|
|
char ch, rep;
|
2007-07-28 15:18:21 +00:00
|
|
|
|
byte *AuxPun;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
AuxPun = AuxBuffDes;
|
|
|
|
|
|
|
|
|
|
while (!fExit) {
|
|
|
|
|
ch = *NamePcc++;
|
|
|
|
|
rep = 1;
|
|
|
|
|
if ((ch & 192) == 192) {
|
|
|
|
|
rep = (ch & 63);
|
|
|
|
|
ch = *NamePcc++;
|
|
|
|
|
}
|
|
|
|
|
for (con = 0; con< rep; con++) {
|
|
|
|
|
*AuxPun++ = ch;
|
|
|
|
|
X++;
|
|
|
|
|
if (X > 64000)
|
|
|
|
|
fExit = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
return AuxBuffDes;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::set_dac(byte *dac) {
|
|
|
|
|
setvgapalette256((byte *)dac);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
void DrasculaEngine::WaitForNext(int FPS) {
|
|
|
|
|
_system->delayMillis(1000 / FPS);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float DrasculaEngine::vez() {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
return _system->getMillis() / 20; // originaly was 1
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int ancho, int alto, int factor, byte *dir_inicio, byte *dir_fin) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
float suma_x, suma_y;
|
|
|
|
|
int n, m;
|
|
|
|
|
float pixel_x, pixel_y;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
int pos_pixel[6];
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
nuevo_ancho = (ancho * factor) / 100;
|
|
|
|
|
nuevo_alto = (alto * factor) / 100;
|
|
|
|
|
|
|
|
|
|
suma_x = ancho / nuevo_ancho;
|
|
|
|
|
suma_y = alto / nuevo_alto;
|
|
|
|
|
|
2007-08-01 01:21:03 +00:00
|
|
|
|
pixel_x = xx1;
|
|
|
|
|
pixel_y = yy1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
for (n = 0;n < nuevo_alto; n++){
|
|
|
|
|
for (m = 0; m < nuevo_ancho; m++){
|
2007-08-01 01:21:03 +00:00
|
|
|
|
pos_pixel[0] = (int)pixel_x;
|
|
|
|
|
pos_pixel[1] = (int)pixel_y;
|
|
|
|
|
pos_pixel[2] = xx2 + m;
|
|
|
|
|
pos_pixel[3] = yy2 + n;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pos_pixel[4] = 1;
|
|
|
|
|
pos_pixel[5] = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_pixel, dir_inicio, dir_fin);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
pixel_x = pixel_x + suma_x;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-08-01 01:21:03 +00:00
|
|
|
|
pixel_x = xx1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pixel_y = pixel_y + suma_y;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char DrasculaEngine::codifica(char car) {
|
|
|
|
|
return ~car;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::cuadrante_1() {
|
|
|
|
|
float distancia_x, distancia_y;
|
|
|
|
|
|
|
|
|
|
distancia_x = hare_x + ancho_hare / 2 - sitio_x;
|
|
|
|
|
distancia_y = (hare_y + alto_hare) - sitio_y;
|
|
|
|
|
|
|
|
|
|
if (distancia_x < distancia_y) {
|
|
|
|
|
direccion_hare = 0;
|
|
|
|
|
sentido_hare = 2;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
direccion_hare = 7;
|
|
|
|
|
sentido_hare = 0;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::cuadrante_2() {
|
|
|
|
|
float distancia_x, distancia_y;
|
|
|
|
|
|
|
|
|
|
distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x);
|
|
|
|
|
distancia_y = (hare_y + alto_hare) - sitio_y;
|
|
|
|
|
|
|
|
|
|
if (distancia_x < distancia_y) {
|
|
|
|
|
direccion_hare = 1;
|
|
|
|
|
sentido_hare = 2;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
direccion_hare = 2;
|
|
|
|
|
sentido_hare = 1;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::cuadrante_3() {
|
|
|
|
|
float distancia_x, distancia_y;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
distancia_x = hare_x + ancho_hare / 2 - sitio_x;
|
|
|
|
|
distancia_y = sitio_y - (hare_y + alto_hare);
|
|
|
|
|
|
|
|
|
|
if (distancia_x < distancia_y) {
|
|
|
|
|
direccion_hare = 5;
|
|
|
|
|
sentido_hare = 3;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
direccion_hare = 6;
|
|
|
|
|
sentido_hare = 0;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::cuadrante_4() {
|
|
|
|
|
float distancia_x, distancia_y;
|
|
|
|
|
|
|
|
|
|
distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x);
|
|
|
|
|
distancia_y = sitio_y - (hare_y + alto_hare);
|
|
|
|
|
|
|
|
|
|
if (distancia_x <distancia_y) {
|
|
|
|
|
direccion_hare = 4;
|
|
|
|
|
sentido_hare = 3;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_x = (int)distancia_x / ((int)distancia_y / PASO_HARE_Y);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
direccion_hare = 3;
|
|
|
|
|
sentido_hare = 1;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
paso_y = (int)distancia_y / ((int)distancia_x / PASO_HARE_X);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::refresca_62() {
|
|
|
|
|
int borracho_x[] = { 1, 42, 83, 124, 165, 206, 247, 1 };
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE(1, 1, 0, 0, 62, 142, dir_dibujo2, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (hare_y + alto_hare < 89) {
|
|
|
|
|
DIBUJA_BLOQUE(205, 1, 180, 9, 82, 80, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::refresca_63() {
|
|
|
|
|
DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::refresca_62_antes() {
|
|
|
|
|
int velas_y[] = { 158, 172, 186};
|
|
|
|
|
int cirio_x[] = { 14, 19, 24 };
|
|
|
|
|
int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 };
|
|
|
|
|
int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1 };
|
2007-07-28 09:45:05 +00:00
|
|
|
|
int diferencia;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
DIBUJA_FONDO(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (parpadeo == 5)
|
|
|
|
|
DIBUJA_FONDO(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (hare_x > 101 && hare_x < 155)
|
|
|
|
|
DIBUJA_FONDO(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (flags[11] == 0)
|
2007-07-28 19:43:26 +00:00
|
|
|
|
DIBUJA_FONDO(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (flags[5] == 0)
|
|
|
|
|
DIBUJA_FONDO(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
else
|
|
|
|
|
DIBUJA_FONDO(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
if (flags[12] == 1)
|
2007-07-28 19:43:26 +00:00
|
|
|
|
DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-08-01 01:21:03 +00:00
|
|
|
|
diferencia = (int)vez() - conta_ciego_vez;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (diferencia > 6) {
|
|
|
|
|
if (flags[12] == 1) {
|
|
|
|
|
frame_borracho++;
|
|
|
|
|
if (frame_borracho == 8) {
|
|
|
|
|
frame_borracho = 0;
|
|
|
|
|
flags[12] = 0;
|
|
|
|
|
}
|
2007-07-28 19:43:26 +00:00
|
|
|
|
} else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
|
2007-07-26 19:52:18 +00:00
|
|
|
|
flags[12] = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
frame_velas++;
|
|
|
|
|
if (frame_velas == 3)
|
|
|
|
|
frame_velas = 0;
|
|
|
|
|
frame_piano++;
|
|
|
|
|
if (frame_piano == 9)
|
|
|
|
|
frame_piano = 0;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
parpadeo = _rnd->getRandomNumber(10);
|
2007-08-01 01:21:03 +00:00
|
|
|
|
conta_ciego_vez = (int)vez();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::graba_partida(char nom_game[]) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
Common::OutSaveFile *out;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int l;
|
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
if (!(out = _saveFileMan->openForSaving(nom_game))) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir el archivo");
|
|
|
|
|
}
|
2007-08-01 19:31:36 +00:00
|
|
|
|
out->writeSint32LE(num_ejec);
|
|
|
|
|
out->write(datos_actuales, 13);
|
|
|
|
|
out->writeSint32LE(hare_x);
|
|
|
|
|
out->writeSint32LE(hare_y);
|
|
|
|
|
out->writeSint32LE(sentido_hare);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
for (l = 1; l < 43; l++) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
out->writeSint32LE(objetos_que_tengo[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (l = 0; l < NUM_BANDERAS; l++) {
|
2007-08-01 19:31:36 +00:00
|
|
|
|
out->writeSint32LE(flags[l]);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
out->writeSint32LE(lleva_objeto);
|
|
|
|
|
out->writeSint32LE(objeto_que_lleva);
|
|
|
|
|
|
|
|
|
|
out->finalize();
|
|
|
|
|
if (out->ioFailed())
|
|
|
|
|
warning("Can't write file '%s'. (Disk full?)", nom_game);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-08-01 19:31:36 +00:00
|
|
|
|
delete out;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
canal_p(nom_game);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::aumenta_num_frame() {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
diff_vez = vez() - conta_vez;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (diff_vez >= 5.7) {
|
|
|
|
|
conta_vez = vez();
|
|
|
|
|
num_frame++;
|
|
|
|
|
if (num_frame == 6)
|
|
|
|
|
num_frame = 0;
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (direccion_hare == 0) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_x = hare_x - paso_x;
|
|
|
|
|
hare_y = hare_y - paso_y;
|
|
|
|
|
} else if (direccion_hare == 7) {
|
|
|
|
|
hare_x = hare_x - paso_x;
|
|
|
|
|
hare_y = hare_y - paso_y;
|
|
|
|
|
} else if (direccion_hare == 1) {
|
|
|
|
|
hare_x = hare_x + paso_x;
|
|
|
|
|
hare_y = hare_y - paso_y;
|
|
|
|
|
} else if (direccion_hare == 2) {
|
|
|
|
|
hare_x = hare_x + paso_x;
|
|
|
|
|
hare_y = hare_y - paso_y;
|
|
|
|
|
} else if (direccion_hare == 3) {
|
|
|
|
|
hare_x = hare_x + paso_x;
|
|
|
|
|
hare_y = hare_y + paso_y;
|
|
|
|
|
} else if (direccion_hare == 4) {
|
|
|
|
|
hare_x = hare_x + paso_x;
|
|
|
|
|
hare_y = hare_y + paso_y;
|
|
|
|
|
} else if (direccion_hare == 5) {
|
|
|
|
|
hare_x = hare_x - paso_x;
|
|
|
|
|
hare_y = hare_y + paso_y;
|
|
|
|
|
} else if (direccion_hare == 6) {
|
|
|
|
|
hare_x = hare_x - paso_x;
|
|
|
|
|
hare_y = hare_y + paso_y;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-01 01:21:03 +00:00
|
|
|
|
diferencia_y = alto_hare - (int)nuevo_alto;
|
|
|
|
|
diferencia_x = ancho_hare - (int)nuevo_ancho;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
hare_y = hare_y + diferencia_y;
|
|
|
|
|
hare_x = hare_x + diferencia_x;
|
2007-08-01 01:21:03 +00:00
|
|
|
|
alto_hare = (int)nuevo_alto;
|
|
|
|
|
ancho_hare = (int)nuevo_ancho;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
int DrasculaEngine::sobre_que_objeto() {
|
|
|
|
|
int n;
|
|
|
|
|
|
|
|
|
|
for (n = 1; n < 43; n++) {
|
|
|
|
|
if (x_raton > x_obj[n] && y_raton > y_obj[n]
|
|
|
|
|
&& x_raton < x_obj[n] + ANCHOBJ && y_raton < y_obj[n] + ALTOBJ)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::comprueba_banderas_menu() {
|
|
|
|
|
int h, n;
|
|
|
|
|
|
|
|
|
|
for (n = 0; n < 43; n++){
|
|
|
|
|
if (sobre_que_objeto() == n) {
|
|
|
|
|
h = objetos_que_tengo[n];
|
|
|
|
|
if (h != 0)
|
|
|
|
|
banderas(h);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pantalla_0() {
|
|
|
|
|
if (objeto_que_lleva == MIRAR)
|
|
|
|
|
hablar(TEXT54, "54.als");
|
|
|
|
|
else if (objeto_que_lleva == MOVER)
|
|
|
|
|
hablar(TEXT19, "19.als" );
|
|
|
|
|
else if (objeto_que_lleva == COGER)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
hablar(TEXT11, "11.als" );
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (objeto_que_lleva == ABRIR)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
hablar(TEXT9, "9.als" );
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (objeto_que_lleva == CERRAR)
|
|
|
|
|
hablar(TEXT9, "9.als" );
|
|
|
|
|
else if (objeto_que_lleva == HABLAR)
|
|
|
|
|
hablar(TEXT16, "16.als" );
|
|
|
|
|
else
|
|
|
|
|
hablar(TEXT11, "11.als");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pantalla_62(int fl) {
|
|
|
|
|
if (objeto_que_lleva == HABLAR && fl == 53)
|
|
|
|
|
conversa("op_13.cal");
|
|
|
|
|
else if (objeto_que_lleva == HABLAR && fl == 52 && flags[0] == 0)
|
|
|
|
|
animacion_3();
|
|
|
|
|
else if (objeto_que_lleva == HABLAR && fl == 52 && flags[0] == 1)
|
|
|
|
|
hablar(TEXT109, "109.als");
|
|
|
|
|
else if (objeto_que_lleva == HABLAR && fl == 54)
|
|
|
|
|
animacion_4();
|
|
|
|
|
else if (objeto_que_lleva == MIRAR && fl == 100)
|
|
|
|
|
hablar(TEXT168, "168.als");
|
|
|
|
|
else if (objeto_que_lleva == HABLAR && fl == 100)
|
|
|
|
|
hablar(TEXT169, "169.als");
|
|
|
|
|
else if (objeto_que_lleva == COGER && fl == 100)
|
|
|
|
|
hablar(TEXT170, "170.als");
|
|
|
|
|
else if (objeto_que_lleva == MIRAR && fl == 101)
|
|
|
|
|
hablar(TEXT171, "171.als");
|
|
|
|
|
else if (objeto_que_lleva == MIRAR && fl == 102)
|
|
|
|
|
hablar(TEXT167, "167.als");
|
|
|
|
|
else if (objeto_que_lleva == MIRAR && fl == 103)
|
|
|
|
|
hablar(TEXT166, "166.als");
|
|
|
|
|
else hay_respuesta = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::pantalla_63(int fl) {
|
|
|
|
|
if (objeto_que_lleva == MIRAR && fl == 110)
|
|
|
|
|
hablar(TEXT172, "172.als");
|
|
|
|
|
else if (objeto_que_lleva == MIRAR && fl == 109)
|
|
|
|
|
hablar(TEXT173, "173.als");
|
|
|
|
|
else if (objeto_que_lleva == MOVER && fl == 109)
|
|
|
|
|
hablar(TEXT174, "174.als");
|
|
|
|
|
else if (objeto_que_lleva == MIRAR && fl == 108)
|
|
|
|
|
hablar(TEXT334, "334.als");
|
|
|
|
|
else if (objeto_que_lleva == HABLAR && fl == 108)
|
|
|
|
|
hablar(TEXT333, "333.als");
|
|
|
|
|
else
|
|
|
|
|
hay_respuesta = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::conversa(const char *nom_fich) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
int h;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int juego1 = 1, juego2 = 1, juego3 = 1, juego4 = 1;
|
|
|
|
|
char frase1[78];
|
|
|
|
|
char frase2[78];
|
|
|
|
|
char frase3[78];
|
|
|
|
|
char frase4[78];
|
|
|
|
|
char para_codificar[13];
|
|
|
|
|
char suena1[13];
|
|
|
|
|
char suena2[13];
|
|
|
|
|
char suena3[13];
|
|
|
|
|
char suena4[13];
|
|
|
|
|
int longitud;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
int respuesta1;
|
|
|
|
|
int respuesta2;
|
|
|
|
|
int respuesta3;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int usado1 = 0;
|
|
|
|
|
int usado2 = 0;
|
|
|
|
|
int usado3 = 0;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
char buffer[256];
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
rompo_y_salgo = 0;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
strcpy(para_codificar, nom_fich);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
canal_p(para_codificar);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
ald = new Common::File;
|
|
|
|
|
ald->open(nom_fich);
|
|
|
|
|
if (!ald->isOpen()) {
|
|
|
|
|
error("missing data file");
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
2007-07-28 14:45:26 +00:00
|
|
|
|
int size = ald->size();
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", frase1);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", frase2);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", frase3);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", frase4);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", suena1);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", suena2);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", suena3);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%s", suena4);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &respuesta1);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &respuesta2);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
getLine(ald, buffer, size);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sscanf(buffer, "%d", &respuesta3);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
delete ald;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
canal_p(para_codificar);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
longitud = strlen(frase1);
|
2007-07-28 14:45:26 +00:00
|
|
|
|
for (h = 0; h < longitud; h++)
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (frase1[h] == (char)0xa7)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
frase1[h] = ' ';
|
|
|
|
|
|
|
|
|
|
longitud = strlen(frase2);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
for (h = 0; h < longitud; h++)
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (frase2[h] == (char)0xa7)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
frase2[h] = ' ';
|
|
|
|
|
|
|
|
|
|
longitud = strlen(frase3);
|
|
|
|
|
for (h = 0; h < longitud; h++)
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (frase3[h] == (char)0xa7)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
frase3[h] = ' ';
|
|
|
|
|
|
|
|
|
|
longitud = strlen(frase4);
|
|
|
|
|
for (h = 0; h < longitud; h++)
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (frase4[h] == (char)0xa7)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
frase4[h] = ' ';
|
2007-07-28 14:45:26 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("car.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo,1);
|
|
|
|
|
/* TODO
|
2007-07-28 09:45:05 +00:00
|
|
|
|
ent.w.ax = 8;
|
|
|
|
|
ent.w.cx = 1;
|
|
|
|
|
ent.w.dx = 31;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int386(0x33, &ent, &sal);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
*/
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(VERDE_CLARO);
|
|
|
|
|
|
|
|
|
|
bucle_opc:
|
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (music_status() == 0 && flags[11] == 0)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
playmusic(musica_room);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
MirarRaton();
|
|
|
|
|
|
|
|
|
|
if ( y_raton > 0 && y_raton < 9) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (usado1 == 1 && _color != BLANCO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(BLANCO);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
else if (usado1 == 0 && _color != VERDE_CLARO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(VERDE_CLARO);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
} else if (y_raton > 8 && y_raton < 17) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (usado2 == 1 && _color != BLANCO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(BLANCO);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
else if (usado2 == 0 && _color != VERDE_CLARO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(VERDE_CLARO);
|
|
|
|
|
} else if (y_raton > 16 && y_raton < 25) {
|
2007-07-29 17:48:25 +00:00
|
|
|
|
if (usado3 == 1 && _color != BLANCO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(BLANCO);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
else if (usado3 == 0 && _color != VERDE_CLARO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(VERDE_CLARO);
|
2007-07-29 17:48:25 +00:00
|
|
|
|
} else if (_color != VERDE_CLARO)
|
2007-07-26 19:52:18 +00:00
|
|
|
|
color_abc(VERDE_CLARO);
|
|
|
|
|
|
|
|
|
|
if (y_raton > 0 && y_raton < 9)
|
|
|
|
|
juego1 = 2;
|
|
|
|
|
else if (y_raton > 8 && y_raton < 17)
|
|
|
|
|
juego2 = 2;
|
|
|
|
|
else if (y_raton > 16 && y_raton < 25)
|
|
|
|
|
juego3 = 2;
|
|
|
|
|
else if (y_raton > 24 && y_raton < 33)
|
|
|
|
|
juego4 = 2;
|
|
|
|
|
|
|
|
|
|
print_abc_opc(frase1, 1, 2, juego1);
|
|
|
|
|
print_abc_opc(frase2, 1, 10, juego2);
|
|
|
|
|
print_abc_opc(frase3, 1, 18, juego3);
|
|
|
|
|
print_abc_opc(frase4, 1, 26, juego4);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if ((boton_izq == 1) && (juego1 == 2)) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
usado1 = 1;
|
|
|
|
|
hablar(frase1, suena1);
|
|
|
|
|
responde(respuesta1);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
} else if ((boton_izq == 1) && (juego2 == 2)) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
usado2 = 1;
|
|
|
|
|
hablar(frase2, suena2);
|
|
|
|
|
responde(respuesta2);
|
2007-07-28 09:45:05 +00:00
|
|
|
|
} else if ((boton_izq == 1) && (juego3 == 2)) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
usado3 = 1;
|
|
|
|
|
hablar(frase3, suena3);
|
|
|
|
|
responde(respuesta3);
|
|
|
|
|
} else if ((boton_izq == 1) && (juego4 == 2)) {
|
|
|
|
|
hablar(frase4, suena4);
|
2007-07-28 19:43:26 +00:00
|
|
|
|
rompo_y_salgo = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (boton_izq == 1)
|
|
|
|
|
color_abc(VERDE_CLARO);
|
|
|
|
|
|
|
|
|
|
if (usado1 == 0)
|
|
|
|
|
juego1 = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
else
|
2007-07-26 19:52:18 +00:00
|
|
|
|
juego1 = 3;
|
|
|
|
|
if (usado2 == 0)
|
|
|
|
|
juego2 = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
else
|
2007-07-26 19:52:18 +00:00
|
|
|
|
juego2 = 3;
|
|
|
|
|
if (usado3 == 0)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
juego3 = 1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else
|
|
|
|
|
juego3 = 3;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
juego4 = 1;
|
|
|
|
|
|
|
|
|
|
if (rompo_y_salgo == 0)
|
|
|
|
|
goto bucle_opc;
|
|
|
|
|
|
|
|
|
|
lee_dibujos("99.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_fondo, 1);
|
|
|
|
|
sin_verbo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::animacion_3() {
|
|
|
|
|
lee_dibujos("an11y13.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
|
|
|
|
|
|
|
|
|
hablar(TEXT192, "192.als");
|
|
|
|
|
habla_tabernero(TEXTT1, "t1.als");
|
|
|
|
|
hablar(TEXT193, "193.als");
|
|
|
|
|
habla_tabernero(TEXTT2, "t2.als");
|
|
|
|
|
hablar(TEXT194, "194.als");
|
|
|
|
|
habla_tabernero(TEXTT3, "t3.als");
|
|
|
|
|
hablar(TEXT195, "195.als");
|
|
|
|
|
habla_tabernero(TEXTT4, "t4.als");
|
|
|
|
|
hablar(TEXT196, "196.als");
|
|
|
|
|
habla_tabernero(TEXTT5, "t5.als");
|
|
|
|
|
habla_tabernero(TEXTT6, "t6.als");
|
|
|
|
|
hablar(TEXT197, "197.als");
|
|
|
|
|
habla_tabernero(TEXTT7, "t7.als");
|
|
|
|
|
hablar(TEXT198, "198.als");
|
|
|
|
|
habla_tabernero(TEXTT8, "t8.als");
|
|
|
|
|
hablar(TEXT199, "199.als");
|
|
|
|
|
habla_tabernero(TEXTT9, "t9.als");
|
|
|
|
|
hablar(TEXT200, "200.als");
|
|
|
|
|
hablar(TEXT201, "201.als");
|
|
|
|
|
hablar(TEXT202, "202.als");
|
|
|
|
|
|
|
|
|
|
flags[0] = 1;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
lee_dibujos("97.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::animacion_4() {
|
|
|
|
|
lee_dibujos("an12.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
|
|
|
|
|
|
|
|
|
hablar(TEXT205,"205.als");
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
VUELCA_PANTALLA(228,112, 228,112, 47,60, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
|
|
|
|
|
pon_hare();
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
stopmusic();
|
|
|
|
|
flags[11] = 1;
|
|
|
|
|
|
|
|
|
|
habla_pianista(TEXTP1, "p1.als");
|
|
|
|
|
hablar(TEXT206, "206.als");
|
|
|
|
|
habla_pianista(TEXTP2, "p2.als");
|
|
|
|
|
hablar(TEXT207, "207.als");
|
|
|
|
|
habla_pianista(TEXTP3, "p3.als");
|
|
|
|
|
hablar(TEXT208, "208.als");
|
|
|
|
|
habla_pianista(TEXTP4, "p4.als");
|
|
|
|
|
hablar(TEXT209, "209.als");
|
|
|
|
|
|
|
|
|
|
flags[11] = 0;
|
|
|
|
|
lee_dibujos("97.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_dch, 1);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:50:25 +00:00
|
|
|
|
void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pantalla, int juego) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int pos_texto[6];
|
2007-07-29 17:48:25 +00:00
|
|
|
|
int y_de_signos, y_de_letra, x_de_letra = 0, h, longitud;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
|
|
|
|
for (h = 0; h < longitud; h++) {
|
|
|
|
|
if (juego == 1) {
|
|
|
|
|
y_de_letra = Y_ABC_OPC_1;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
y_de_signos = Y_SIGNOS_OPC_1;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
} else if (juego == 3) {
|
|
|
|
|
y_de_letra = Y_ABC_OPC_3;
|
|
|
|
|
y_de_signos = Y_SIGNOS_OPC_3;
|
|
|
|
|
} else {
|
|
|
|
|
y_de_letra = Y_ABC_OPC_2;
|
|
|
|
|
y_de_signos = Y_SIGNOS_OPC_2;
|
|
|
|
|
}
|
2007-07-28 22:10:30 +00:00
|
|
|
|
|
2007-07-28 22:14:17 +00:00
|
|
|
|
char c = toupper(dicho[h]);
|
|
|
|
|
if (c == 'A')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_A_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
|
|
|
|
// x_de_letra = X_A_OPC;
|
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_A_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
|
|
|
|
// x_de_letra = X_A_OPC;
|
|
|
|
|
else if (c == 'B'
|
2007-07-26 19:52:18 +00:00
|
|
|
|
)x_de_letra = X_B_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'C')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_C_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_C_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_C_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'D')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_D_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'E')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_E_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_E_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_E_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_E_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'F')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_F_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'G')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_G_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'H')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_H_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'I')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_I_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_I_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_I_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_I_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'J')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_J_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'K')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_K_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'L')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_L_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'M')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_M_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'N')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == ''')
|
|
|
|
|
// x_de_letra = X_GN_OPC;
|
|
|
|
|
else if (c == 'O')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_O_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_O_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_O_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_O_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'P')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_P_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'Q')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_Q_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'R')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_R_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'S')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_S_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'T')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_T_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'U')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_U_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_U_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_U_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_U_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'V')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_V_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'W')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_W_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'X')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_X_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'Y')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_Y_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == 'Z')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_Z_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == ' ')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = ESPACIO_OPC;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else
|
|
|
|
|
y_de_letra = y_de_signos;
|
|
|
|
|
|
2007-07-28 22:14:17 +00:00
|
|
|
|
if (c == '.')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_PUNTO_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == ',')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_COMA_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '-')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_GUION_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '?')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_CIERRA_INTERROGACION_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '<27>')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_ABRE_INTERROGACION_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '"')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_COMILLAS_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
// else if (c == '!')
|
2007-07-28 22:10:30 +00:00
|
|
|
|
// x_de_letra = X_CIERRA_EXCLAMACION_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '<EFBFBD>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_ABRE_EXCLAMACION_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == ';')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_PUNTO_Y_COMA_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '>')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_MAYOR_QUE_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '<')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_MENOR_QUE_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '$')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_DOLAR_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '%')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_POR_CIENTO_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == ':')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_DOS_PUNTOS_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '&')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_AND_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '/')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_BARRA_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '(')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_ABRE_PARENTESIS_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == ')')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_CIERRA_PARENTESIS_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '*')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_ASTERISCO_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '+')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_MAS_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '1')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N1_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '2')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N2_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '3')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N3_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '4')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N4_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '5')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N5_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '6')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N6_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '7')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N7_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '8')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N8_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '9')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N9_OPC;
|
2007-07-28 22:14:17 +00:00
|
|
|
|
else if (c == '0')
|
2007-07-26 19:52:18 +00:00
|
|
|
|
x_de_letra = X_N0_OPC;
|
2007-07-28 22:10:30 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pos_texto[0] = x_de_letra;
|
|
|
|
|
pos_texto[1] = y_de_letra;
|
|
|
|
|
pos_texto[2] = x_pantalla;
|
|
|
|
|
pos_texto[3] = y_pantalla;
|
|
|
|
|
pos_texto[4] = ANCHO_LETRAS_OPC;
|
|
|
|
|
pos_texto[5] = ALTO_LETRAS_OPC;
|
|
|
|
|
|
|
|
|
|
DIBUJA_BLOQUE_CUT(pos_texto, dir_hare_fondo, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
x_pantalla = x_pantalla + ANCHO_LETRAS_OPC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::responde(int funcion) {
|
|
|
|
|
if (funcion == 10)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
habla_borracho(TEXTB1, "B1.als");
|
2007-07-26 19:52:18 +00:00
|
|
|
|
else if (funcion == 11)
|
|
|
|
|
habla_borracho(TEXTB2, "B2.als");
|
|
|
|
|
else if (funcion == 12)
|
|
|
|
|
habla_borracho(TEXTB3, "B3.als");
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::habla_pianista(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
int x_habla[4] = { 97, 145, 193, 241};
|
|
|
|
|
int cara;
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(BLANCO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(3);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(x_habla[cara], 139, 228, 112, 47, 60,
|
2007-07-28 09:45:05 +00:00
|
|
|
|
dir_hare_dch, dir_zona_pantalla);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
pon_hare();
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, 221, 128);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 18:14:44 +00:00
|
|
|
|
byte key = getscan();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-27 17:24:22 +00:00
|
|
|
|
void DrasculaEngine::habla_borracho(const char *dicho, const char *filename) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
int tiempou;
|
|
|
|
|
long tiempol;
|
|
|
|
|
|
|
|
|
|
int x_habla[8] = { 1, 21, 41, 61, 81, 101, 121, 141 };
|
|
|
|
|
int cara;
|
|
|
|
|
int longitud;
|
|
|
|
|
longitud = strlen(dicho);
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
tiempol = _system->getMillis();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
tiempou = (unsigned int)tiempol / 2;
|
2007-07-28 19:43:26 +00:00
|
|
|
|
_rnd->setSeed(tiempou);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
lee_dibujos("an11y13.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_frente, 1);
|
|
|
|
|
|
|
|
|
|
flags[13] = 1;
|
|
|
|
|
|
2007-07-28 09:45:05 +00:00
|
|
|
|
bebiendo:
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
if (flags[12] == 1) {
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
goto bebiendo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
|
|
|
|
|
color_abc(VERDE_OSCURO);
|
|
|
|
|
|
|
|
|
|
if (hay_sb == 1) {
|
2007-07-28 14:45:26 +00:00
|
|
|
|
sku = new Common::File;
|
|
|
|
|
sku->open(filename);
|
|
|
|
|
if (!sku->isOpen()) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
error("no puedo abrir archivo de voz\n");
|
|
|
|
|
}
|
|
|
|
|
ctvd_init(2);
|
|
|
|
|
ctvd_speaker(1);
|
|
|
|
|
ctvd_output(sku);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bucless:
|
|
|
|
|
|
2007-07-28 19:43:26 +00:00
|
|
|
|
cara = _rnd->getRandomNumber(7);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
actualiza_refresco_antes();
|
|
|
|
|
|
|
|
|
|
DIBUJA_FONDO(x_habla[cara], 29, 177, 50, 19, 19, dir_hare_frente, dir_zona_pantalla);
|
|
|
|
|
pon_hare();
|
|
|
|
|
actualiza_refresco();
|
|
|
|
|
|
|
|
|
|
if (con_voces == 0)
|
|
|
|
|
centra_texto(dicho, 181, 54);
|
|
|
|
|
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
pausa(3);
|
|
|
|
|
|
2007-07-29 17:48:25 +00:00
|
|
|
|
byte key = getscan();
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (key != 0)
|
|
|
|
|
ctvd_stop();
|
|
|
|
|
buffer_teclado();
|
|
|
|
|
if (hay_sb == 1) {
|
|
|
|
|
if (LookForFree() != 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
} else {
|
|
|
|
|
longitud = longitud - 2;
|
|
|
|
|
if (longitud > 0)
|
|
|
|
|
goto bucless;
|
2007-07-28 09:45:05 +00:00
|
|
|
|
}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
refresca_pantalla();
|
|
|
|
|
VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
|
|
|
|
|
|
|
|
|
|
flags[13] = 0;
|
|
|
|
|
lee_dibujos("96.alg");
|
|
|
|
|
descomprime_dibujo(dir_hare_frente, 1);
|
|
|
|
|
|
|
|
|
|
if (music_status() == 0 && flags[11] == 0)
|
2007-07-28 09:45:05 +00:00
|
|
|
|
playmusic(musica_room);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::suma_objeto(int osj) {
|
|
|
|
|
int h, puesto = 0;
|
|
|
|
|
|
|
|
|
|
for (h = 1; h < 43; h++) {
|
|
|
|
|
if (objetos_que_tengo[h] == osj)
|
|
|
|
|
puesto = 1;
|
|
|
|
|
}
|
2007-07-28 09:45:05 +00:00
|
|
|
|
|
2007-07-26 19:52:18 +00:00
|
|
|
|
if (puesto == 0) {
|
|
|
|
|
for (h = 1; h < 43; h++) {
|
|
|
|
|
if (objetos_que_tengo[h] == 0) {
|
|
|
|
|
objetos_que_tengo[h]=osj;
|
|
|
|
|
puesto = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::fin_sound_corte() {
|
2007-07-28 09:45:05 +00:00
|
|
|
|
if (hay_sb == 1) {
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_stop();
|
2007-07-28 14:45:26 +00:00
|
|
|
|
delete sku;
|
2007-07-26 19:52:18 +00:00
|
|
|
|
ctvd_terminate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::MusicFadeout() {
|
2007-08-01 20:56:39 +00:00
|
|
|
|
int org_vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
|
|
|
|
|
for (;;) {
|
|
|
|
|
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
|
|
|
|
|
vol -= 10;
|
|
|
|
|
if (vol < 0)
|
|
|
|
|
vol = 0;
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol);
|
|
|
|
|
if (vol == 0)
|
|
|
|
|
break;
|
|
|
|
|
update_events();
|
|
|
|
|
_system->updateScreen();
|
|
|
|
|
_system->delayMillis(50);
|
|
|
|
|
}
|
|
|
|
|
AudioCD.stop();
|
|
|
|
|
_system->delayMillis(100);
|
|
|
|
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, org_vol);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::ctvd_end() {
|
2007-07-29 11:21:12 +00:00
|
|
|
|
_mixer->stopHandle(_soundHandle);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::ctvd_stop() {
|
2007-07-29 11:21:12 +00:00
|
|
|
|
_mixer->stopHandle(_soundHandle);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::ctvd_terminate() {
|
2007-07-29 11:21:12 +00:00
|
|
|
|
// _mixer->stopHandle(_soundHandle);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrasculaEngine::ctvd_speaker(int flag) {}
|
|
|
|
|
|
2007-07-28 14:45:26 +00:00
|
|
|
|
void DrasculaEngine::ctvd_output(Common::File *file_handle) {}
|
2007-07-26 19:52:18 +00:00
|
|
|
|
|
|
|
|
|
void DrasculaEngine::ctvd_init(int b) {
|
2007-07-29 11:21:12 +00:00
|
|
|
|
int soundSize = sku->size();
|
|
|
|
|
byte *soundData = (byte *)malloc(soundSize);
|
|
|
|
|
sku->seek(32);
|
|
|
|
|
sku->read(soundData, soundSize);
|
2007-08-01 19:31:36 +00:00
|
|
|
|
_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, soundData, soundSize - 64,
|
2007-07-29 11:21:12 +00:00
|
|
|
|
11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int DrasculaEngine::LookForFree() {
|
|
|
|
|
return _mixer->isSoundHandleActive(_soundHandle);
|
2007-07-26 19:52:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 21:35:01 +00:00
|
|
|
|
} // End of namespace Drascula
|