aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2008-05-30 21:09:21 +0000
committerFilippos Karapetis2008-05-30 21:09:21 +0000
commit798ce0ace82d5afad2a2863cc671b056be382ded (patch)
tree18274626d327f3d28c83a19369b0fb884b20e2de /engines
parentdc3cb78e6b79cc50262f93475bc06d015bf44f16 (diff)
downloadscummvm-rg350-798ce0ace82d5afad2a2863cc671b056be382ded.tar.gz
scummvm-rg350-798ce0ace82d5afad2a2863cc671b056be382ded.tar.bz2
scummvm-rg350-798ce0ace82d5afad2a2863cc671b056be382ded.zip
Cleanup
svn-id: r32406
Diffstat (limited to 'engines')
-rw-r--r--engines/drascula/drascula.cpp16
-rw-r--r--engines/drascula/drascula.h15
-rw-r--r--engines/drascula/talk.cpp466
3 files changed, 85 insertions, 412 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 41d3af28e5..4986b784b3 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -4324,20 +4324,8 @@ void DrasculaEngine::grr() {
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
bucless:
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index b5470bf492..ed65a00266 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -365,12 +365,6 @@ public:
bool escoba();
void black();
- void talk_vb(int);
- void talk_vb(const char *, const char *);
- void talk_vbpuerta(int);
- void talk_vbpuerta(const char *said, const char *filename);
- void talk_blind(const char *, const char *, const char *);
- void talk_hacker(const char *, const char *);
void pickObject(int);
void anda_parriba();
void anda_pabajo();
@@ -491,12 +485,12 @@ public:
void stopSound_corte();
void fadeToBlack(int VelocidadDeFundido);
void pause(int);
- void talk_dr_grande(const char *said, const char *filename);
void placeIgor();
void placeBJ();
void placeDrascula();
void talkInit(const char *filename);
+ bool isTalkFinished(int* length);
void talk_igor_dch(int);
void talk_igor_dch(const char *said, const char *filename);
void talk_dr_dch(int);
@@ -536,6 +530,13 @@ public:
void talk_wolf(const char *said, const char *filename);
void talk_mus(int);
void talk_mus(const char *said, const char *filename);
+ void talk_dr_grande(const char *said, const char *filename);
+ void talk_vb(int);
+ void talk_vb(const char *, const char *);
+ void talk_vbpuerta(int);
+ void talk_vbpuerta(const char *said, const char *filename);
+ void talk_blind(const char *, const char *, const char *);
+ void talk_hacker(const char *, const char *);
void hiccup(int);
void stopSound();
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
index c3f9fa2e2d..a37b8179df 100644
--- a/engines/drascula/talk.cpp
+++ b/engines/drascula/talk.cpp
@@ -42,6 +42,25 @@ void DrasculaEngine::talkInit(const char *filename) {
}
}
+bool DrasculaEngine::isTalkFinished(int* length) {
+ byte key = getScan();
+ if (key != 0)
+ ctvd_stop();
+ if (hay_sb == 1) {
+ if (soundIsActive())
+ return false;
+ delete(sku);
+ sku = 0;
+ ctvd_terminate();
+ } else {
+ length -= 2;
+ if (length > 0)
+ return false;
+ }
+
+ return true;
+}
+
void DrasculaEngine::talk_igor_dch(int index) {
char name[20];
sprintf(name, "I%i.als", index);
@@ -80,22 +99,9 @@ bucless:
pause(3);
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
+
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
placeDrascula();
@@ -145,22 +151,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
placeIgor();
@@ -210,22 +202,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
if (num_ejec == 6)
updateRoom();
@@ -262,22 +240,9 @@ bucless:
}
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
+
if (num_ejec == 6) {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -324,22 +289,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
if (num_ejec == 6) {
updateRoom();
@@ -395,19 +346,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete(sku);
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -459,22 +399,8 @@ bucless:
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
}
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -595,22 +521,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -656,20 +568,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -723,20 +623,8 @@ bucless:
pause(3);
- byte key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -793,20 +681,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -834,20 +710,8 @@ bucless:
centerText(said, 150, 80);
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -904,20 +768,8 @@ bucless:
pause(2);
p++;
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
}
void DrasculaEngine::talk_hacker(const char *said, const char *filename) {
@@ -935,22 +787,8 @@ bucless:
centerText(said, 156, 170);
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
-
- key = 0;
+ if (!isTalkFinished(&length))
+ goto bucless;
}
void DrasculaEngine::talk_wolf(int index) {
@@ -987,20 +825,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1040,20 +866,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
+ if (!isTalkFinished(&length))
goto bucless;
- }
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1093,20 +907,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
flags[1] = 0;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
@@ -1144,20 +946,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
flags[1] = 0;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
@@ -1199,20 +989,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1253,20 +1031,9 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
+
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
}
@@ -1309,20 +1076,8 @@ bucless:
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1407,20 +1162,8 @@ bucless:
p++;
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
if (num_ejec == 1 && musicStatus() == 0 && flags[11] == 0)
playMusic(roomMusic);
@@ -1452,20 +1195,8 @@ bucless:
pause(4);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
flags[19] = cara_antes;
updateRoom();
@@ -1492,20 +1223,8 @@ bucless:
centerText(said, 87, 66);
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1545,20 +1264,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1598,20 +1305,8 @@ bucless:
pause(3);
- int key = getScan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1){
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
updateRoom();
updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
@@ -1648,19 +1343,8 @@ bucless:
if (key == Common::KEYCODE_ESCAPE)
term_int = 1;
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (soundIsActive())
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- length -= 2;
- if (length > 0)
- goto bucless;
- }
+ if (!isTalkFinished(&length))
+ goto bucless;
}
} // End of namespace Drascula