From 48259cc65f374ad61ade70c5417f9a7947a4b84a Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Fri, 29 Feb 2008 15:11:44 +0000 Subject: fixed exit from engine svn-id: r31002 --- engines/drascula/drascula.cpp | 39 +++++++-------------------------------- engines/drascula/drascula.h | 3 +-- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index b8987fcc2c..55c600bd2c 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -75,8 +75,6 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam } DrasculaEngine::~DrasculaEngine() { - salir_al_dos(0); - delete _rnd; } @@ -762,15 +760,9 @@ bucles: delay(1460); if (num_ejec != 3) cont_sv = 0; - } else if (key == Common::KEYCODE_DELETE) { -// if (num_ejec == 4) // FIXME -// carga_partida("gsave00"); -// else - confirma_go(); - if (num_ejec != 3) - cont_sv = 0; } else if (key == Common::KEYCODE_ESCAPE) { - confirma_salir(); + if (!confirma_salir()) + return false; if (num_ejec != 3) cont_sv = 0; } else if (num_ejec == 6 && key == Common::KEYCODE_0 && !strcmp(num_room, "61.alg")) { @@ -2328,27 +2320,7 @@ void DrasculaEngine::delay(int ms) { _system->delayMillis(ms * 2); // originaly was 1 } -void DrasculaEngine::confirma_go() { - byte key; - - color_abc(ROJO); - refresca_pantalla(); - centra_texto(SYS0, 160, 87); - VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); - - for (;;) { - key = getscan(); - if (key != 0) - break; - } - - if (key == Common::KEYCODE_DELETE) { - stopmusic(); -// carga_partida("gsave00"); // FIXME - } -} - -void DrasculaEngine::confirma_salir() { +bool DrasculaEngine::confirma_salir() { byte key; color_abc(ROJO); @@ -2356,6 +2328,7 @@ void DrasculaEngine::confirma_salir() { centra_texto(SYS1, 160, 87); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + delay(100); for (;;) { key = getscan(); if (key != 0) @@ -2364,8 +2337,10 @@ void DrasculaEngine::confirma_salir() { if (key == Common::KEYCODE_ESCAPE) { stopmusic(); - salir_al_dos(0); + return false; } + + return true; } void DrasculaEngine::salva_pantallas() { diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 577e920095..22af486a6a 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -584,8 +584,7 @@ public: bool saves(); void print_abc(const char *, int, int); void delay(int ms); - void confirma_go(); - void confirma_salir(); + bool confirma_salir(); void salva_pantallas(); void elige_objeto(int objeto); void suma_objeto(int); -- cgit v1.2.3