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

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Jun 1 22:58:06 CEST 2008


Revision: 32475
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32475&view=rev
Author:   sev
Date:     2008-06-01 13:58:05 -0700 (Sun, 01 Jun 2008)

Log Message:
-----------
Now whole game could be run from original packed files.

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

Modified: scummvm/trunk/engines/drascula/animation.cpp
===================================================================
--- scummvm/trunk/engines/drascula/animation.cpp	2008-06-01 20:05:21 UTC (rev 32474)
+++ scummvm/trunk/engines/drascula/animation.cpp	2008-06-01 20:58:05 UTC (rev 32475)
@@ -107,7 +107,7 @@
 			break;
 		if (animate("scr2.bin", 17))
 			break;
-		stopSound_corte();
+		stopSound();
 		if (animate("scr3.bin", 17))
 			break;
 		loadAndDecompressPic("cielo2.alg", screenSurface, COMPLETE_PAL);
@@ -281,7 +281,7 @@
 			break;
 		if (animate("frel.bin", 16))
 			break;
-		stopSound_corte();
+		stopSound();
 		clearRoom();
 		black();
 		playMusic(23);
@@ -417,7 +417,7 @@
 		pause(4);
 		playSound(1);
 		hiccup(18);
-		stopSound();
+		finishSound();
 		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
 			break;
 
@@ -698,13 +698,13 @@
 	copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 	updateScreen();
 
-	stopSound();
+	finishSound();
 
 	pause (4);
 
 	playSound(1);
 	hipo_sin_nadie(12);
-	stopSound();
+	finishSound();
 }
 
 void DrasculaEngine::animation_3_2() {
@@ -841,7 +841,7 @@
 	playSound(7);
 	hiccup(15);
 
-	stopSound();
+	finishSound();
 
 	loadAndDecompressPic("99.alg", backSurface, 1);
 }
@@ -1178,7 +1178,7 @@
 		updateScreen();
 	}
 
-	stopSound();
+	finishSound();
 
 	loadAndDecompressPic("99.alg", backSurface, 1);
 }
@@ -1313,7 +1313,7 @@
 
 	playSound(1);
 	hipo_sin_nadie(18);
-	stopSound();
+	finishSound();
 
 	pause(10);
 
@@ -1445,7 +1445,7 @@
 	updateScreen(0, 0, 0, 0, 320, 200, drawSurface3);
 	pause(3);
 	updateScreen(0, 0, 0, 0, 320, 200, frontSurface);
-	stopSound();
+	finishSound();
 }
 
 void DrasculaEngine::animation_2_4() {
@@ -1620,7 +1620,7 @@
 	updateScreen(0, 0, 0, 0, 320, 200, drawSurface1);
 
 	playSound(1);
-	stopSound();
+	finishSound();
 
 	loadAndDecompressPic("99.alg", backSurface, 1);
 	loadAndDecompressPic("97.alg", extraSurface, 1);
@@ -1743,7 +1743,7 @@
 		updateScreen();
 	}
 
-	stopSound_corte();
+	stopSound();
 
 	for (frame = 0; frame < 15; frame++) {
 		if (frame == 2 || frame == 4 || frame == 7 || frame == 9)
@@ -1769,7 +1769,7 @@
 	animation_13_5();
 	playSound(1);
 	hiccup(12);
-	stopSound();
+	finishSound();
 
 	loadAndDecompressPic("99.alg", backSurface, 1);
 
@@ -1834,7 +1834,7 @@
 	playSound(3);
 	updateRoom();
 	updateScreen(0, 0, 0,0 , 320, 200, screenSurface);
-	stopSound();
+	finishSound();
 	pause(17);
 	sentido_hare = 3;
 	talk(246);
@@ -1843,7 +1843,7 @@
 	playSound(7);
 	updateRoom();
 	updateScreen();
-	stopSound();
+	finishSound();
 	pause(14);
 	sentido_hare = 3;
 	updateRoom();
@@ -2094,7 +2094,7 @@
 	updateRefresh_pre();
 	copyBackground(164, 85, 155, 48, 113, 114, drawSurface3, screenSurface);
 	updateScreen();
-	stopSound();
+	finishSound();
 	talk_taber2(23);
 	flags[7] = 1;
 }
@@ -2146,7 +2146,7 @@
 	updateScreen();
 	playSound(4);
 	pause(6);
-	stopSound();
+	finishSound();
 }
 
 void DrasculaEngine::animation_12_2() {
@@ -2232,7 +2232,7 @@
 		pause(3);
 	}
 
-	stopSound_corte();
+	stopSound();
 
 	updateAnim(121, 225, 113, 50, 59, 6, extraSurface);
 
@@ -2303,7 +2303,7 @@
 	updateRoom();
 	updateScreen();
 	playSound(13);
-	stopSound();
+	finishSound();
 	sentido_hare = 1;
 
 	talk_vbpuerta(1);
@@ -2381,7 +2381,7 @@
 
 	updateAnim(1, 218, 79, 83, 75, 3, extraSurface);
 
-	stopSound();
+	finishSound();
 
 	pause(30);
 
@@ -2493,7 +2493,7 @@
 
 	playSound(1);
 	updateAnim(86, 213, 66, 53, 84, 6, frontSurface);
-	stopSound_corte();
+	stopSound();
 
 	updateAnim(1, 213, 66, 53, 84, 6, drawSurface3);
 

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2008-06-01 20:05:21 UTC (rev 32474)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2008-06-01 20:58:05 UTC (rev 32475)
@@ -151,8 +151,6 @@
 		frame_bat = 0;
 		c_mirar = 0;
 		c_poder = 0;
-		ald = NULL;
-		sku = NULL;
 
 		allocMemory();
 
@@ -223,7 +221,7 @@
 
 void DrasculaEngine::releaseGame() {
 	if (hay_sb == 1)
-		ctvd_end();
+		stopSound();
 	clearRoom();
 	black();
 	MusicFadeout();
@@ -792,8 +790,7 @@
 	if (!loadGame(gameName))
 		return false;
 	if (currentChapter == 2 || currentChapter == 3 || currentChapter == 5) {
-		delete ald;
-		ald = NULL;
+		//
 	}
 	carga_escoba(currentData);
 	withoutVerb();
@@ -801,14 +798,14 @@
 	return true;
 }
 
-static char *getLine(Common::File *fp, char *buf, int len) {
+char *DrasculaEngine::getLine(char *buf, int len) {
 	byte c;
 	char *b;
 
 	for (;;) {
 		b = buf;
-		while (!fp->eos()) {
-			c = ~fp->readByte();
+		while (!_arj.eos()) {
+			c = ~_arj.readByte();
 			if (c == '\r')
 				continue;
 			if (c == '\n' || b - buf >= (len - 1))
@@ -816,7 +813,7 @@
 			*b++ = c;
 		}
 		*b = '\0';
-		if (fp->eos() && b == buf)
+		if (_arj.eos() && b == buf)
 			return NULL;
 		if (b != buf)
 			break;
@@ -824,13 +821,13 @@
 	return buf;
 }
 
-void getIntFromLine(Common::File *fp, char *buf, int len, int* result) {
-	getLine(fp, buf, len);
+void DrasculaEngine::getIntFromLine(char *buf, int len, int* result) {
+	getLine(buf, len);
 	sscanf(buf, "%d", result);
 }
 
-void getStringFromLine(Common::File *fp, char *buf, int len, char* result) {
-	getLine(fp, buf, len);
+void DrasculaEngine::getStringFromLine(char *buf, int len, char* result) {
+	getLine(buf, len);
 	sscanf(buf, "%s", result);
 }
 
@@ -846,32 +843,31 @@
 	strcpy(para_codificar, nom_fich);
 	strcpy(currentData, nom_fich);
 
-	ald = new Common::File;
-	ald->open(nom_fich);
-	if (!ald->isOpen()) {
-		error("missing data file");
+	_arj.open(nom_fich);
+	if (!_arj.isOpen()) {
+		error("missing data file %s", nom_fich);
 	}
-	int size = ald->size();
+	int size = _arj.size();
 
-	getIntFromLine(ald, buffer, size, &roomNumber);
-	getIntFromLine(ald, buffer, size, &roomMusic);
-	getStringFromLine(ald, buffer, size, roomDisk);
-	getIntFromLine(ald, buffer, size, &nivel_osc);
+	getIntFromLine(buffer, size, &roomNumber);
+	getIntFromLine(buffer, size, &roomMusic);
+	getStringFromLine(buffer, size, roomDisk);
+	getIntFromLine(buffer, size, &nivel_osc);
 
 	if (currentChapter == 2)
-		getIntFromLine(ald, buffer, size, &martin);
+		getIntFromLine(buffer, size, &martin);
 
 	if (currentChapter == 2 && martin != 0) {
 		ancho_hare = martin;
-		getIntFromLine(ald, buffer, size, &alto_hare);
-		getIntFromLine(ald, buffer, size, &feetHeight);
-		getIntFromLine(ald, buffer, size, &stepX);
-		getIntFromLine(ald, buffer, size, &stepY);
+		getIntFromLine(buffer, size, &alto_hare);
+		getIntFromLine(buffer, size, &feetHeight);
+		getIntFromLine(buffer, size, &stepX);
+		getIntFromLine(buffer, size, &stepY);
 
-		getStringFromLine(ald, buffer, size, pant1);
-		getStringFromLine(ald, buffer, size, pant2);
-		getStringFromLine(ald, buffer, size, pant3);
-		getStringFromLine(ald, buffer, size, pant4);
+		getStringFromLine(buffer, size, pant1);
+		getStringFromLine(buffer, size, pant2);
+		getStringFromLine(buffer, size, pant3);
+		getStringFromLine(buffer, size, pant4);
 
 		loadAndDecompressPic(pant2, extraSurface, 1);
 		loadAndDecompressPic(pant1, frontSurface, 1);
@@ -880,41 +876,40 @@
 		strcpy(menuBackground, pant4);
 	}
 
-	getIntFromLine(ald, buffer, size, &numRoomObjs);
+	getIntFromLine(buffer, size, &numRoomObjs);
 
 	for (l = 0; l < numRoomObjs; l++) {
-		getIntFromLine(ald, buffer, size, &objectNum[l]);
-		getStringFromLine(ald, buffer, size, objName[l]);
-		getIntFromLine(ald, buffer, size, &x1[l]);
-		getIntFromLine(ald, buffer, size, &y1[l]);
-		getIntFromLine(ald, buffer, size, &x2[l]);
-		getIntFromLine(ald, buffer, size, &y2[l]);
-		getIntFromLine(ald, buffer, size, &sitiobj_x[l]);
-		getIntFromLine(ald, buffer, size, &sitiobj_y[l]);
-		getIntFromLine(ald, buffer, size, &sentidobj[l]);
-		getIntFromLine(ald, buffer, size, &visible[l]);
-		getIntFromLine(ald, buffer, size, &isDoor[l]);
+		getIntFromLine(buffer, size, &objectNum[l]);
+		getStringFromLine(buffer, size, objName[l]);
+		getIntFromLine(buffer, size, &x1[l]);
+		getIntFromLine(buffer, size, &y1[l]);
+		getIntFromLine(buffer, size, &x2[l]);
+		getIntFromLine(buffer, size, &y2[l]);
+		getIntFromLine(buffer, size, &sitiobj_x[l]);
+		getIntFromLine(buffer, size, &sitiobj_y[l]);
+		getIntFromLine(buffer, size, &sentidobj[l]);
+		getIntFromLine(buffer, size, &visible[l]);
+		getIntFromLine(buffer, size, &isDoor[l]);
 		if (isDoor[l] != 0) {
-			getStringFromLine(ald, buffer, size, _targetSurface[l]);
-			getIntFromLine(ald, buffer, size, &_destX[l]);
-			getIntFromLine(ald, buffer, size, &_destY[l]);
-			getIntFromLine(ald, buffer, size, &sentido_alkeva[l]);
-			getIntFromLine(ald, buffer, size, &alapuertakeva[l]);
+			getStringFromLine(buffer, size, _targetSurface[l]);
+			getIntFromLine(buffer, size, &_destX[l]);
+			getIntFromLine(buffer, size, &_destY[l]);
+			getIntFromLine(buffer, size, &sentido_alkeva[l]);
+			getIntFromLine(buffer, size, &alapuertakeva[l]);
 			updateDoor(l);
 		}
 	}
 
-	getIntFromLine(ald, buffer, size, &suelo_x1);
-	getIntFromLine(ald, buffer, size, &suelo_y1);
-	getIntFromLine(ald, buffer, size, &suelo_x2);
-	getIntFromLine(ald, buffer, size, &suelo_y2);
+	getIntFromLine(buffer, size, &suelo_x1);
+	getIntFromLine(buffer, size, &suelo_y1);
+	getIntFromLine(buffer, size, &suelo_x2);
+	getIntFromLine(buffer, size, &suelo_y2);
 
 	if (currentChapter != 2) {
-		getIntFromLine(ald, buffer, size, &far);
-		getIntFromLine(ald, buffer, size, &near);
+		getIntFromLine(buffer, size, &far);
+		getIntFromLine(buffer, size, &near);
 	}
-	delete ald;
-	ald = NULL;
+	_arj.close();
 
 	if (currentChapter == 2) {
 		if (martin == 0) {
@@ -1849,16 +1844,8 @@
 	char file[20];
 	sprintf(file, "s%i.als", soundNum);
 
-	if (hay_sb == 1) {
-		sku = new Common::File;
-		sku->open(file);
-		if (!sku->isOpen()) {
-			error("no puedo abrir archivo de voz");
-		}
-	}
-	ctvd_init(2);
-	ctvd_speaker(1);
-	ctvd_output(sku);
+	if (hay_sb == 1)
+		playFile(file);
 }
 
 bool DrasculaEngine::animate(const char *animationFile, int FPS) {
@@ -1916,15 +1903,6 @@
 	return ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE));
 }
 
-void DrasculaEngine::animastopSound_corte() {
-	if (hay_sb == 1) {
-		ctvd_stop();
-		delete sku;
-		sku = NULL;
-		ctvd_terminate();
-	}
-}
-
 void DrasculaEngine::fadeToBlack(int fadeSpeed) {
 	char fundido;
 	unsigned int color, component;
@@ -2040,13 +2018,12 @@
 	updateScreen();
 }
 
-void DrasculaEngine::stopSound() {
+void DrasculaEngine::finishSound() {
 	delay(1);
 
 	if (hay_sb == 1) {
-		while (soundIsActive());
-		delete sku;
-		sku = NULL;
+		while (soundIsActive())
+			_system->delayMillis(10);
 	}
 }
 
@@ -2504,8 +2481,7 @@
 				addObject(11);
 			}
 			clearRoom();
-			delete ald;
-			ald = NULL;
+
 			strcpy(salgo, _targetSurface[l]);
 			strcat(salgo, ".ald");
 			hare_x =- 1;
@@ -2690,7 +2666,7 @@
 void DrasculaEngine::para_grabar(char gameName[]) {
 	saveGame(gameName);
 	playSound(99);
-	stopSound();
+	finishSound();
 }
 
 void DrasculaEngine::openSSN(const char *Name, int Pause) {
@@ -3149,27 +3125,26 @@
 	if (currentChapter == 5)
 		withoutVerb();
 
-	ald = new Common::File;
-	ald->open(nom_fich);
-	if (!ald->isOpen()) {
-		error("missing data file");
+	_arj.open(nom_fich);
+	if (!_arj.isOpen()) {
+		error("missing data file %s", nom_fich);
 	}
-	int size = ald->size();
+	int size = _arj.size();
 
-	getStringFromLine(ald, buffer, size, phrase1);
-	getStringFromLine(ald, buffer, size, phrase2);
-	getStringFromLine(ald, buffer, size, phrase3);
-	getStringFromLine(ald, buffer, size, phrase4);
-	getStringFromLine(ald, buffer, size, sound1);
-	getStringFromLine(ald, buffer, size, sound2);
-	getStringFromLine(ald, buffer, size, sound3);
-	getStringFromLine(ald, buffer, size, sound4);
-	getIntFromLine(ald, buffer, size, &answer1);
-	getIntFromLine(ald, buffer, size, &answer2);
-	getIntFromLine(ald, buffer, size, &answer3);
-	delete ald;
-	ald = NULL;
+	getStringFromLine(buffer, size, phrase1);
+	getStringFromLine(buffer, size, phrase2);
+	getStringFromLine(buffer, size, phrase3);
+	getStringFromLine(buffer, size, phrase4);
+	getStringFromLine(buffer, size, sound1);
+	getStringFromLine(buffer, size, sound2);
+	getStringFromLine(buffer, size, sound3);
+	getStringFromLine(buffer, size, sound4);
+	getIntFromLine(buffer, size, &answer1);
+	getIntFromLine(buffer, size, &answer2);
+	getIntFromLine(buffer, size, &answer3);
 
+	_arj.close();
+
 	if (currentChapter == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
 		strcpy(phrase3, _text[_lang][405]);
 		strcpy(sound3, "405.als");
@@ -3413,12 +3388,9 @@
 	}
 }
 
-void DrasculaEngine::stopSound_corte() {
+void DrasculaEngine::stopSound() {
 	if (hay_sb == 1) {
-		ctvd_stop();
-		delete sku;
-		sku = NULL;
-		ctvd_terminate();
+		_mixer->stopHandle(_soundHandle);
 	}
 }
 
@@ -3441,27 +3413,15 @@
 	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, org_vol);
 }
 
-void DrasculaEngine::ctvd_end() {
-	_mixer->stopHandle(_soundHandle);
-}
+void DrasculaEngine::playFile(const char *fname) {
+	_arj.open(fname);
 
-void DrasculaEngine::ctvd_stop() {
-	_mixer->stopHandle(_soundHandle);
-}
-
-void DrasculaEngine::ctvd_terminate() {
-//	_mixer->stopHandle(_soundHandle);
-}
-
-void DrasculaEngine::ctvd_speaker(int flag) {}
-
-void DrasculaEngine::ctvd_output(Common::File *file_handle) {}
-
-void DrasculaEngine::ctvd_init(int b) {
-	int soundSize = sku->size();
+	int soundSize = _arj.size();
 	byte *soundData = (byte *)malloc(soundSize);
-	sku->seek(32);
-	sku->read(soundData, soundSize);
+	_arj.seek(32);
+	_arj.read(soundData, soundSize);
+	_arj.close();
+
 	_mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, soundData, soundSize - 64,
 					11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED);
 }
@@ -3666,7 +3626,7 @@
 			updateDoor(doorNum);
 		updateRoom();
 		updateScreen();
-		stopSound();
+		finishSound();
 		withoutVerb();
 	}
 }
@@ -3693,16 +3653,8 @@
 
 	color_abc(kColorDarkGreen);
 
-	if (hay_sb == 1) {
-		sku = new Common::File;
-		sku->open("s10.als");
-		if (!sku->isOpen()) {
-			error("no puedo abrir archivo de voz");
-		}
-		ctvd_init(4);
-		ctvd_speaker(1);
-		ctvd_output(sku);
-	}
+	if (hay_sb == 1)
+		playFile("s10.als");
 
 	updateRoom();
 	copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
@@ -3740,7 +3692,7 @@
 			updateDoor(doorNum);
 		updateRoom();
 		updateScreen();
-		stopSound();
+		finishSound();
 		withoutVerb();
 	}
 }

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2008-06-01 20:05:21 UTC (rev 32474)
+++ scummvm/trunk/engines/drascula/drascula.h	2008-06-01 20:58:05 UTC (rev 32475)
@@ -229,8 +229,6 @@
 	byte cPal[768];
 	byte *pcxBuffer;
 
-	Common::File *ald, *sku;
-
 	Common::ArjFile _arj;
 
 	int hay_sb;
@@ -423,7 +421,6 @@
 	void centerText(const char *,int,int);
 	void playSound(int soundNum);
 	bool animate(const char *animation, int FPS);
-	void stopSound_corte();
 	void fadeToBlack(int fadeSpeed);
 	void pause(int);
 	void placeIgor();
@@ -479,6 +476,7 @@
 	void talk_hacker(const char *, const char *);
 
 	void hiccup(int);
+	void finishSound();
 	void stopSound();
 	void closeDoor(int nflag, int doorNum);
 	void playMusic(int p);
@@ -487,7 +485,6 @@
 	void updateRoom();
 	bool loadGame(const char *);
 	void updateDoor(int);
-	void animastopSound_corte();
 	void color_hare();
 	void funde_hare(int oscuridad);
 	void paleta_hare_claro();
@@ -588,12 +585,12 @@
 	void response(int);
 
 	void MusicFadeout();
-	void ctvd_end();
-	void ctvd_stop();
-	void ctvd_terminate();
-	void ctvd_speaker(int flag);
-	void ctvd_output(Common::File *file_handle);
-	void ctvd_init(int b);
+	void playFile(const char *fname);
+
+	char *getLine(char *buf, int len);
+	void getIntFromLine(char *buf, int len, int* result);
+	void getStringFromLine(char *buf, int len, char* result);
+
 	void grr();
 	bool room_13(int fl);
 	void update_13();

Modified: scummvm/trunk/engines/drascula/rooms.cpp
===================================================================
--- scummvm/trunk/engines/drascula/rooms.cpp	2008-06-01 20:05:21 UTC (rev 32474)
+++ scummvm/trunk/engines/drascula/rooms.cpp	2008-06-01 20:58:05 UTC (rev 32475)
@@ -179,7 +179,7 @@
 		flags[2] = 1;
 		updateRoom();
 		updateScreen();
-		stopSound();
+		finishSound();
 	} else if (pickedObject == kVerbClose && fl == 143 && flags[2] == 1) {
 		copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 		flags[2] = 0;
@@ -190,7 +190,7 @@
 		playSound(4);
 		updateRoom();
 		updateScreen();
-		stopSound();
+		finishSound();
 	} else if (pickedObject == kVerbOpen && fl == 139 && flags[1] == 0) {
 		copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 		updateRefresh_pre();
@@ -203,7 +203,7 @@
 		visible[2] = 0;
 		updateRoom();
 		updateScreen();
-		stopSound();
+		finishSound();
 	} else if (pickedObject == kVerbPick && fl == 140) {
 		copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
 		updateRefresh_pre();
@@ -334,7 +334,7 @@
 		copyRect(133, 135, hare_x + 6, hare_y, 39, 63, drawSurface3, screenSurface);
 		updateScreen();
 		playSound(8);
-		stopSound();
+		finishSound();
 		talk(338);
 		flags[27] = 0;
 		pickObject(19);
@@ -519,7 +519,7 @@
 		flags[26]=1;
 		playSound(1);
 		hiccup(14);
-		stopSound();
+		finishSound();
 		withoutVerb();
 		removeObject(22);
 		updateVisible();
@@ -874,7 +874,7 @@
 	else if (fl == 206) {
 		playSound(11);
 		animate("det.bin", 17);
-		stopSound();
+		finishSound();
 		lleva_al_hare(hare_x - 3, hare_y + alto_hare + 6);
 	} else
 		hasAnswer = 0;
@@ -920,7 +920,7 @@
 		if (flags[11] == 0) {
 			playSound(12);
 			delay(40);
-			stopSound();
+			finishSound();
 			delay(10);
 			lleva_al_hare(174, 168);
 			sentido_hare = 2;
@@ -929,7 +929,7 @@
 			pause(40);
 			playSound(12);
 			pause(19);
-			stopSound_corte();
+			stopSound();
 			hare_se_ve = 0;
 			updateRoom();
 			copyRect(101, 34, hare_x - 4, hare_y - 1, 37, 70, drawSurface3, screenSurface);

Modified: scummvm/trunk/engines/drascula/talk.cpp
===================================================================
--- scummvm/trunk/engines/drascula/talk.cpp	2008-06-01 20:05:21 UTC (rev 32474)
+++ scummvm/trunk/engines/drascula/talk.cpp	2008-06-01 20:58:05 UTC (rev 32475)
@@ -30,28 +30,17 @@
 void DrasculaEngine::talkInit(const char *filename) {
 	_rnd->setSeed((unsigned int)_system->getMillis() / 2);
 
-	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);
-	}
+	if (hay_sb == 1)
+		playFile(filename);
 }
 
 bool DrasculaEngine::isTalkFinished(int* length) {
 	byte key = getScan();
 	if (key != 0)
-		ctvd_stop();
+		stopSound();
 	if (hay_sb == 1) {
 		if (soundIsActive())
 			return false;
-		delete(sku);
-		sku = 0;
-		ctvd_terminate();
 	} else {
 		length -= 2;
 		if (length > 0)


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