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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri May 30 12:55:44 CEST 2008


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

Log Message:
-----------
Wrapped up talk_drunk
Some cleanup

dir_escritura -> targetSurface
targetScreen -> targetSurface
plt (in decompressPic) -> colorCount
funcion -> function

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/animation.cpp
    scummvm/trunk/engines/drascula/drascula.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:43:21 UTC (rev 32393)
+++ scummvm/trunk/engines/drascula/animation.cpp	2008-05-30 10:55:43 UTC (rev 32394)
@@ -892,17 +892,17 @@
 }
 
 void DrasculaEngine::animation_15_2() {
-	talk_drunk(_textb[_lang][8], "B8.als");
+	talk_drunk(8);
 	pause(7);
-	talk_drunk(_textb[_lang][9], "B9.als");
-	talk_drunk(_textb[_lang][10], "B10.als");
-	talk_drunk(_textb[_lang][11], "B11.als");
+	talk_drunk(9);
+	talk_drunk(10);
+	talk_drunk(11);
 }
 
 void DrasculaEngine::animation_16_2() {
 	int l;
 
-	talk_drunk(_textb[_lang][12], "B12.als");
+	talk_drunk(12);
 	talk(371);
 
 	clearRoom();
@@ -1060,8 +1060,8 @@
 }
 
 void DrasculaEngine::animation_17_2() {
-	talk_drunk(_textb[_lang][13], "B13.als");
-	talk_drunk(_textb[_lang][14], "B14.als");
+	talk_drunk(13);
+	talk_drunk(14);
 	flags[40] = 1;
 }
 
@@ -2393,14 +2393,14 @@
 
 	if (flags[41] == 0) {
 		talk(103);
-		talk_drunk(_textb[_lang][4], "B4.als");
+		talk_drunk(4);
 		flags[12] = 1;
 		talk(367);
-		talk_drunk(_textb[_lang][5], "B5.als");
+		talk_drunk(5);
 		flags[12] = 1;
 		talk(368);
-		talk_drunk(_textb[_lang][6], "B6.als");
-		talk_drunk(_textb[_lang][7], "B7.als");
+		talk_drunk(6);
+		talk_drunk(7);
 		flags[41] = 1;
 	}
 	converse("op_2.cal");

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2008-05-30 10:43:21 UTC (rev 32393)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2008-05-30 10:55:43 UTC (rev 32394)
@@ -357,10 +357,10 @@
 	file.close();
 }
 
-void DrasculaEngine::decompressPic(byte *dir_escritura, int plt) {
-	memcpy(dir_escritura, pcxBuffer, 64000);
+void DrasculaEngine::decompressPic(byte *targetSurface, int colorCount) {
+	memcpy(targetSurface, pcxBuffer, 64000);
 	free(pcxBuffer);
-	setRGB((byte *)cPal, plt);
+	setRGB((byte *)cPal, colorCount);
 }
 
 void DrasculaEngine::paleta_hare() {
@@ -988,7 +988,7 @@
 		sscanf(buffer, "%d", &isDoor[l]);
 		if (isDoor[l] != 0) {
 			getLine(ald, buffer, size);
-			sscanf(buffer, "%s", targetScreen[l]);
+			sscanf(buffer, "%s", targetSurface[l]);
 			getLine(ald, buffer, size);
 			sscanf(buffer, "%d", &x_alakeva[l]);
 			getLine(ald, buffer, size);
@@ -1117,7 +1117,7 @@
 	if (num_ejec == 2) {
 		soc = 0;
 		for (l = 0; l < 6; l++) {
-			soc = soc + ancho_hare;
+			soc += ancho_hare;
 			frame_x[l] = soc;
 		}
 	}
@@ -2647,7 +2647,7 @@
 					return true;
 				}
 				clearRoom();
-				strcpy(salgo, targetScreen[l]);
+				strcpy(salgo, targetSurface[l]);
 				strcat(salgo, ".ald");
 				hare_x = -1;
 				carga_escoba(salgo);
@@ -2681,7 +2681,7 @@
 			clearRoom();
 			delete ald;
 			ald = NULL;
-			strcpy(salgo, targetScreen[l]);
+			strcpy(salgo, targetSurface[l]);
 			strcat(salgo, ".ald");
 			hare_x =- 1;
 			carga_escoba(salgo);
@@ -2699,7 +2699,7 @@
 			doBreak = 1;
 			previousMusic = roomMusic;
 			clearRoom();
-			strcpy(salgo, targetScreen[l]);
+			strcpy(salgo, targetSurface[l]);
 			strcat(salgo, ".ald");
 			hare_x =- 1;
 			carga_escoba(salgo);
@@ -2720,7 +2720,7 @@
 			if (objectNum[l] == 108)
 				lleva_al_hare(171, 78);
 			clearRoom();
-			strcpy(salgo, targetScreen[l]);
+			strcpy(salgo, targetSurface[l]);
 			strcat(salgo, ".ald");
 			hare_x = -1;
 			carga_escoba(salgo);
@@ -2739,7 +2739,7 @@
 			previousMusic = roomMusic;
 			hare_se_ve = 1;
 			clearRoom();
-			strcpy(salgo, targetScreen[l]);
+			strcpy(salgo, targetSurface[l]);
 			strcat(salgo, ".ald");
 			hare_x = -1;
 			carga_escoba(salgo);
@@ -2757,7 +2757,7 @@
 			doBreak = 1;
 			previousMusic = roomMusic;
 			clearRoom();
-			strcpy(salgo, targetScreen[l]);
+			strcpy(salgo, targetSurface[l]);
 			strcat(salgo, ".ald");
 			hare_x = -1;
 			carga_escoba(salgo);
@@ -4019,83 +4019,83 @@
 	}
 }
 
-void DrasculaEngine::response(int funcion) {
+void DrasculaEngine::response(int function) {
 	if (num_ejec == 1) {
-		if (funcion == 10)
-			talk_drunk(_textb[_lang][1], "B1.als");
-		else if (funcion == 11)
-			talk_drunk(_textb[_lang][2], "B2.als");
-		else if (funcion == 12)
-			talk_drunk(_textb[_lang][3], "B3.als");
+		if (function == 10)
+			talk_drunk(1);
+		else if (function == 11)
+			talk_drunk(2);
+		else if (function == 12)
+			talk_drunk(3);
 	} else if (num_ejec == 2) {
-		if (funcion == 8)
+		if (function == 8)
 			animation_8_2();
-		else if (funcion == 9)
+		else if (function == 9)
 			animation_9_2();
-		else if (funcion == 10)
+		else if (function == 10)
 			animation_10_2();
-		else if (funcion == 15)
+		else if (function == 15)
 			animation_15_2();
-		else if (funcion == 16)
+		else if (function == 16)
 			animation_16_2();
-		else if (funcion == 17)
+		else if (function == 17)
 			animation_17_2();
-		else if (funcion == 19)
+		else if (function == 19)
 			animation_19_2();
-		else if (funcion == 20)
+		else if (function == 20)
 			animation_20_2();
-		else if (funcion == 21)
+		else if (function == 21)
 			animation_21_2();
-		else if (funcion == 23)
+		else if (function == 23)
 			animation_23_2();
-		else if (funcion == 28)
+		else if (function == 28)
 			animation_28_2();
-		else if (funcion == 29)
+		else if (function == 29)
 			animation_29_2();
-		else if (funcion == 30)
+		else if (function == 30)
 			animation_30_2();
-		else if (funcion == 31)
+		else if (function == 31)
 			animation_31_2();
 	} else if (num_ejec == 4) {
-		if (funcion == 2)
+		if (function == 2)
 			animation_2_4();
-		else if (funcion == 3)
+		else if (function == 3)
 			animation_3_4();
-		else if (funcion == 4)
+		else if (function == 4)
 			animation_4_4();
 	} else if (num_ejec == 5) {
-		if (funcion == 2)
+		if (function == 2)
 			animation_2_5();
-		else if (funcion == 3)
+		else if (function == 3)
 			animation_3_5();
-		else if (funcion == 6)
+		else if (function == 6)
 			animation_6_5();
-		else if (funcion == 7)
+		else if (function == 7)
 			animation_7_5();
-		else if (funcion == 8)
+		else if (function == 8)
 			animation_8_5();
-		else if (funcion == 15)
+		else if (function == 15)
 			animation_15_5();
-		else if (funcion == 16)
+		else if (function == 16)
 			animation_16_5();
-		else if (funcion == 17)
+		else if (function == 17)
 			animation_17_5();
 	} else if (num_ejec == 6) {
-		if (funcion == 2)
+		if (function == 2)
 			animation_2_6();
-		else if (funcion == 3)
+		else if (function == 3)
 			animation_3_6();
-		else if (funcion == 4)
+		else if (function == 4)
 			animation_4_6();
-		else if (funcion == 11)
+		else if (function == 11)
 			animation_11_6();
-		else if (funcion == 12)
+		else if (function == 12)
 			animation_12_6();
-		else if (funcion == 13)
+		else if (function == 13)
 			animation_13_6();
-		else if (funcion == 14)
+		else if (function == 14)
 			animation_14_6();
-		else if (funcion == 15)
+		else if (function == 15)
 			animation_15_6();
 	}
 }
@@ -4299,11 +4299,7 @@
 }
 
 void DrasculaEngine::lleva_vb(int pointX) {
-	if (pointX < vb_x)
-		sentido_vb = 0;
-	else
-		sentido_vb = 1;
-
+	sentido_vb = (pointX < vb_x) ? 0 : 1;
 	vb_se_mueve = 1;
 
 	for (;;) {

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2008-05-30 10:43:21 UTC (rev 32393)
+++ scummvm/trunk/engines/drascula/drascula.h	2008-05-30 10:55:43 UTC (rev 32394)
@@ -238,7 +238,7 @@
 	void releaseGame();
 
 	void loadPic(const char *);
-	void decompressPic(byte *dir_escritura, int plt);
+	void decompressPic(byte *targetSurface, int colorCount);
 
 	typedef char DacPalette256[256][3];
 
@@ -290,7 +290,7 @@
 	int objectNum[40], visible[40], isDoor[40];
 	int sitiobj_x[40], sitiobj_y[40], sentidobj[40];
 	int inventoryObjects[43];
-	char targetScreen[40][20];
+	char targetSurface[40][20];
 	int x_alakeva[40], y_alakeva[40], sentido_alkeva[40], alapuertakeva[40];
 	int x1[40], y1[40], x2[40], y2[40];
 	int takeObject, pickedObject;
@@ -509,6 +509,7 @@
 	void talk(int);
 	void talk(const char *, const char *);
 	void talk_sinc(const char *, const char *, const char *);
+	void talk_drunk(int);
 	void talk_drunk(const char *said, const char *filename);
 	void talk_pianista(const char *said, const char *filename);
 	void talk_igor_seated(int);

Modified: scummvm/trunk/engines/drascula/talk.cpp
===================================================================
--- scummvm/trunk/engines/drascula/talk.cpp	2008-05-30 10:43:21 UTC (rev 32393)
+++ scummvm/trunk/engines/drascula/talk.cpp	2008-05-30 10:55:43 UTC (rev 32394)
@@ -669,6 +669,12 @@
 	updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
 }
 
+void DrasculaEngine::talk_drunk(int index) {
+	char name[20];
+	sprintf(name, "B%i.als", index);
+	talk_drunk(_textb[_lang][index], name);
+}
+
 void DrasculaEngine::talk_drunk(const char *said, const char *filename) {
 	int x_talk[8] = { 1, 21, 41, 61, 81, 101, 121, 141 };
 	int face;


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