diff options
| -rw-r--r-- | engines/drascula/animation.cpp | 22 | ||||
| -rw-r--r-- | engines/drascula/drascula.cpp | 108 | ||||
| -rw-r--r-- | engines/drascula/drascula.h | 5 | ||||
| -rw-r--r-- | engines/drascula/talk.cpp | 6 | 
4 files changed, 72 insertions, 69 deletions
| diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index 57cf549f49..c94dea17d0 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -892,17 +892,17 @@ void DrasculaEngine::animation_14_2() {  }  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 @@ asco:  }  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 @@ void DrasculaEngine::animation_13_2() {  	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"); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index ab47e31bca..2a28f14c89 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -357,10 +357,10 @@ void DrasculaEngine::loadPic(const char *NamePcc) {  	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 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {  		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 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {  	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 @@ bool DrasculaEngine::exitRoom(int l) {  					return true;  				}  				clearRoom(); -				strcpy(salgo, targetScreen[l]); +				strcpy(salgo, targetSurface[l]);  				strcat(salgo, ".ald");  				hare_x = -1;  				carga_escoba(salgo); @@ -2681,7 +2681,7 @@ bool DrasculaEngine::exitRoom(int l) {  			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 @@ bool DrasculaEngine::exitRoom(int l) {  			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 @@ bool DrasculaEngine::exitRoom(int l) {  			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 @@ bool DrasculaEngine::exitRoom(int l) {  			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 @@ bool DrasculaEngine::exitRoom(int l) {  			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::print_abc_opc(const char *said, int x_pantalla, int y_panta  	}  } -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::pon_vb() {  }  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 (;;) { diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 22610accd0..3ed0793a25 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -238,7 +238,7 @@ public:  	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 @@ public:  	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 @@ public:  	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); diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 3a5820c241..669d1a7719 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -669,6 +669,12 @@ bucless:  	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; | 
