[Scummvm-cvs-logs] SF.net SVN: scummvm: [32390] scummvm/trunk/engines/drascula

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri May 30 12:14:28 CEST 2008


Revision: 32390
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32390&view=rev
Author:   thebluegr
Date:     2008-05-30 03:14:27 -0700 (Fri, 30 May 2008)

Log Message:
-----------
More simplification of talk code. Moved talk_dr_grande() from animation.cpp to talk.cpp

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/animation.cpp
    scummvm/trunk/engines/drascula/drascula.h
    scummvm/trunk/engines/drascula/talk.cpp

Modified: scummvm/trunk/engines/drascula/animation.cpp
===================================================================
--- scummvm/trunk/engines/drascula/animation.cpp	2008-05-30 10:04:39 UTC (rev 32389)
+++ scummvm/trunk/engines/drascula/animation.cpp	2008-05-30 10:14:27 UTC (rev 32390)
@@ -27,9 +27,6 @@
 
 namespace Drascula {
 
-static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
-static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
-
 void DrasculaEngine::updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delay) {
 	int x = 0;
 
@@ -401,63 +398,6 @@
 	decompressPic(backSurface, 1);
 }
 
-void DrasculaEngine::talk_dr_grande(const char *said, const char *filename) {
-	int x_talk[4] = {47, 93, 139, 185};
-	int face;
-	int l = 0;
-	int length = strlen(said);
-
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
-	color_abc(kColorRed);
-
-	if (hay_sb == 1) {
-		sku = new Common::File;
-		sku->open(filename);
-		if (!sku->isOpen()) {
-			error("no puedo abrir archivo de voz");
-		}
-		ctvd_init(2);
-		ctvd_speaker(1);
-		ctvd_output(sku);
-	}
-
-bucless:
-
-	face = _rnd->getRandomNumber(3);
-	copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
-	copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, drawSurface2, screenSurface);
-	copyBackground(x_talk[face], 1, 171, 68, 45, 48, drawSurface2, screenSurface);
-	l++;
-	if (l == 7)
-		l = 0;
-
-	if (withVoices == 0)
-		centerText(said, 191, 69);
-
-	updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
-
-	pause(3);
-
-	byte key = getScan();
-	if (key == Common::KEYCODE_ESCAPE)
-		term_int = 1;
-
-	if (key != 0)
-		ctvd_stop();
-	if (hay_sb == 1) {
-		if (LookForFree() != 0)
-			goto bucless;
-		delete sku;
-		sku = NULL;
-		ctvd_terminate();
-	} else {
-		length -= 2;
-		if (length > 0)
-			goto bucless;
-	}
-}
-
 void DrasculaEngine::animation_2_1() {
 	int l;
 

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2008-05-30 10:04:39 UTC (rev 32389)
+++ scummvm/trunk/engines/drascula/drascula.h	2008-05-30 10:14:27 UTC (rev 32390)
@@ -211,6 +211,9 @@
 #define COMPLETE_PAL   256
 #define HALF_PAL       128
 
+static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
+static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
+
 class DrasculaEngine : public ::Engine {
 	int _gameId;
 	Common::KeyState _keyPressed;

Modified: scummvm/trunk/engines/drascula/talk.cpp
===================================================================
--- scummvm/trunk/engines/drascula/talk.cpp	2008-05-30 10:04:39 UTC (rev 32389)
+++ scummvm/trunk/engines/drascula/talk.cpp	2008-05-30 10:14:27 UTC (rev 32390)
@@ -28,6 +28,8 @@
 namespace Drascula {
 
 void DrasculaEngine::talkInit(const char *filename) {
+	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
+
 	if (hay_sb == 1) {
 		sku = new Common::File;
 		sku->open(filename);
@@ -51,8 +53,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -113,8 +113,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorRed);
 
 	talkInit(filename);
@@ -181,8 +179,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorRed);
 
 	talkInit(filename);
@@ -244,8 +240,6 @@
 void DrasculaEngine::talk_solo(const char *said, const char *filename) {
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	if (num_ejec == 1)
 		color_abc(color_solo);
 	else if (num_ejec == 4)
@@ -295,8 +289,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -366,8 +358,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorMaroon);
 
 	talkInit(filename);
@@ -428,8 +418,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -514,8 +502,6 @@
 		}
 	}
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	if (num_ejec != 2) {
 		if (factor_red[hare_y + alto_hare] == 100)
 			suma_1_pixel = 0;
@@ -634,8 +620,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -684,8 +668,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	if (num_ejec == 1) {
 		loadPic("an11y13.alg");
 		decompressPic(frontSurface, 1);
@@ -768,8 +750,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorBrown);
 
 	talkInit(filename);
@@ -827,8 +807,6 @@
 void DrasculaEngine::talk_vbpuerta(const char *said, const char *filename) {
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorBrown);
 
 	talkInit(filename);
@@ -935,8 +913,6 @@
 void DrasculaEngine::talk_hacker(const char *said, const char *filename) {
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 	updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
 
@@ -972,8 +948,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorRed);
 
 	talkInit(filename);
@@ -1021,8 +995,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -1076,8 +1048,6 @@
 	copyRect(44, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
 	updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorYellow);
 
 	talkInit(filename);
@@ -1129,8 +1099,6 @@
 
 	flags[1] = 1;
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorYellow);
 
 	talkInit(filename);
@@ -1186,8 +1154,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorMaroon);
 
 	talkInit(filename);
@@ -1241,8 +1207,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -1291,8 +1255,6 @@
 	int face, pantalla;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorYellow);
 
 	talkInit(filename);
@@ -1442,8 +1404,6 @@
 	int face = 0, cara_antes;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	cara_antes = flags[19];
 
 	color_abc(kColorMaroon);
@@ -1490,8 +1450,6 @@
 void DrasculaEngine::talk_igor_door(const char *said, const char *filename) {
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -1527,8 +1485,6 @@
 	int face;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -1576,8 +1532,6 @@
 	int face = 0;
 	int length = strlen(said);
 
-	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
-
 	color_abc(kColorWhite);
 
 	talkInit(filename);
@@ -1620,4 +1574,50 @@
 	updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
 }
 
+void DrasculaEngine::talk_dr_grande(const char *said, const char *filename) {
+	int x_talk[4] = {47, 93, 139, 185};
+	int face;
+	int l = 0;
+	int length = strlen(said);
+
+	color_abc(kColorRed);
+
+	talkInit(filename);
+
+bucless:
+
+	face = _rnd->getRandomNumber(3);
+	copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
+	copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, drawSurface2, screenSurface);
+	copyBackground(x_talk[face], 1, 171, 68, 45, 48, drawSurface2, screenSurface);
+	l++;
+	if (l == 7)
+		l = 0;
+
+	if (withVoices == 0)
+		centerText(said, 191, 69);
+
+	updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
+
+	pause(3);
+
+	byte key = getScan();
+	if (key == Common::KEYCODE_ESCAPE)
+		term_int = 1;
+
+	if (key != 0)
+		ctvd_stop();
+	if (hay_sb == 1) {
+		if (LookForFree() != 0)
+			goto bucless;
+		delete sku;
+		sku = NULL;
+		ctvd_terminate();
+	} else {
+		length -= 2;
+		if (length > 0)
+			goto bucless;
+	}
+}
+
 } // End of namespace Drascula


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list