[Scummvm-git-logs] scummvm master -> 8df285937bfdc5faeede8c21b623137e72d0f217

bluegr noreply at scummvm.org
Mon Jun 13 14:13:13 UTC 2022


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d26674eb91 CHEWY: More fixes for speech only mode
8df285937b CHEWY: More fixes for dialog delays


Commit: d26674eb913ad8338f1b9467b5b9d9ba3295fb4a
    https://github.com/scummvm/scummvm/commit/d26674eb913ad8338f1b9467b5b9d9ba3295fb4a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-13T17:12:56+03:00

Commit Message:
CHEWY: More fixes for speech only mode

Changed paths:
    engines/chewy/atds.cpp
    engines/chewy/r_event.cpp
    engines/chewy/rooms/room68.cpp
    engines/chewy/sound.cpp
    engines/chewy/sound.h
    engines/chewy/sprite.cpp


diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index e99020b6526..f2e8d9ab849 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -414,7 +414,7 @@ bool Atdsys::start_ats(int16 txtNr, int16 txtMode, int16 color, int16 mode, int1
 
 	if (_atsv.text.size() > 0) {
 		*vocNr = txtMode != TXT_MARK_NAME ? _text->getLastSpeechId() : -1;
-		_atsv.shown = g_engine->_sound->subtitlesEnabled();
+		_atsv.shown = true;
 		_atsv._txtMode = txtMode;
 		_atsv._delayCount = get_delay(_atsv.text.size());
 		_atsv._color = color;
@@ -430,6 +430,8 @@ void Atdsys::stop_ats() {
 }
 
 void Atdsys::print_ats(int16 x, int16 y, int16 scrX, int16 scrY) {
+	const Sound *sound = g_engine->_sound;
+
 	if (_atsv.shown) {
 		if (_atdsv._eventsEnabled) {
 			switch (_G(in)->getSwitchCode()) {
@@ -470,22 +472,24 @@ void Atdsys::print_ats(int16 x, int16 y, int16 scrX, int16 scrY) {
 			split_string(atsSsi, &splitString);
 
 			for (int16 i = 0; i < splitString._nr; i++) {
-				_G(out)->printxy(splitString._x[i],
-								 splitString._y + (i * h) + 1,
-								 0, 300, 0, splitString._strPtr[i]);
-				_G(out)->printxy(splitString._x[i],
-								 splitString._y + (i * h) - 1,
-								 0, 300, 0, splitString._strPtr[i]);
-				_G(out)->printxy(splitString._x[i] + 1,
-				              splitString._y + (i * h),
-				              0, 300, 0, splitString._strPtr[i]);
-				_G(out)->printxy(splitString._x[i] - 1,
-				              splitString._y + (i * h),
-				              0, 300, 0, splitString._strPtr[i]);
-				_G(out)->printxy(splitString._x[i],
-				              splitString._y + (i * h),
-				              _atsv._color,
-				              300, 0, splitString._strPtr[i]);
+				if (g_engine->_sound->subtitlesEnabled()) {
+					_G(out)->printxy(splitString._x[i],
+									 splitString._y + (i * h) + 1,
+									 0, 300, 0, splitString._strPtr[i]);
+					_G(out)->printxy(splitString._x[i],
+									 splitString._y + (i * h) - 1,
+									 0, 300, 0, splitString._strPtr[i]);
+					_G(out)->printxy(splitString._x[i] + 1,
+									 splitString._y + (i * h),
+									 0, 300, 0, splitString._strPtr[i]);
+					_G(out)->printxy(splitString._x[i] - 1,
+									 splitString._y + (i * h),
+									 0, 300, 0, splitString._strPtr[i]);
+					_G(out)->printxy(splitString._x[i],
+									 splitString._y + (i * h),
+									 _atsv._color,
+									 300, 0, splitString._strPtr[i]);
+				}
 
 				shownLen += strlen(splitString._strPtr[i]) + 1;
 			}
@@ -672,14 +676,10 @@ void Atdsys::print_aad(int16 scrX, int16 scrY) {
 					_aadv._strHeader->_vocNr - ATDS_VOC_OFFSET != -1) {
 				if (_atdsv._vocNr != _aadv._strHeader->_vocNr - ATDS_VOC_OFFSET) {
 					_atdsv._vocNr = _aadv._strHeader->_vocNr - ATDS_VOC_OFFSET;
-					g_engine->_sound->playSpeech(_atdsv._vocNr, false);
-					int16 vocx = _G(moveState)[personId].Xypos[0] -
+					const int16 vocx = _G(moveState)[personId].Xypos[0] -
 								 _G(gameState).scrollx + _G(spieler_mi)[personId].HotX;
 					g_engine->_sound->setSoundChannelBalance(0, getStereoPos(vocx));
-
-					if (!g_engine->_sound->subtitlesEnabled()) {
-						_aadv._strNr = -1;
-					}
+					g_engine->_sound->playSpeech(_atdsv._vocNr, false);
 				}
 			}
 
diff --git a/engines/chewy/r_event.cpp b/engines/chewy/r_event.cpp
index a1166efa23e..96dff9537d9 100644
--- a/engines/chewy/r_event.cpp
+++ b/engines/chewy/r_event.cpp
@@ -794,9 +794,7 @@ void flic_cut(int16 nr) {
 	if (nr != FCUT_135) {
 		g_engine->_sound->playRoomMusic(_G(gameState)._personRoomNr[0]);
 
-		if (g_engine->_sound->speechEnabled())
-			_G(det)->enable_room_sound();
-
+		_G(det)->enable_room_sound();
 		_G(uhr)->resetTimer(0, 0);
 	}
 
diff --git a/engines/chewy/rooms/room68.cpp b/engines/chewy/rooms/room68.cpp
index 0f9dd860ea4..c51a79fc255 100644
--- a/engines/chewy/rooms/room68.cpp
+++ b/engines/chewy/rooms/room68.cpp
@@ -347,10 +347,6 @@ void Room68::kostuem_aad(int16 aad_nr) {
 	else if (!_G(gameState).R67LiedOk)
 		startAadWait(389);
 	else {
-		// TODO: Reimplement
-		//if (!g_engine->_sound->subtitlesEnabled())
-		//	_G(sndPlayer)->fadeOut(5);
-		
 		_G(SetUpScreenFunc) = nullptr;
 		delInventory(_G(gameState).AkInvent);
 		goAutoXy(150, -13, P_NICHELLE, ANI_WAIT);
@@ -374,19 +370,11 @@ void Room68::kostuem_aad(int16 aad_nr) {
 			_G(det)->stop_detail(23);
 		}
 
-		if (g_engine->_sound->subtitlesEnabled()) {
-			g_engine->_sound->playSound(108, 1, false);
-		}
+		g_engine->_sound->playSound(108, 1, false);
 		
 		_G(det)->startDetail(24, 255, ANI_FRONT);
 		setPersonPos(26, 40, P_NICHELLE, P_RIGHT);
-		if (g_engine->_sound->subtitlesEnabled()) {
-			startAadWait(391);
-		} else {
-			waitShowScreen(100);
-			startAadWait(602);
-			waitShowScreen(100);
-		}
+		startAadWait(391);
 
 		_G(room)->set_timer_status(8, TIMER_STOP);
 		_G(det)->del_static_ani(8);
@@ -417,9 +405,7 @@ void Room68::kostuem_aad(int16 aad_nr) {
 		_G(gameState)._personHide[P_NICHELLE] = false;
 		setPersonPos(150, -13, P_NICHELLE, P_RIGHT);
 
-		if (g_engine->_sound->subtitlesEnabled()) {
-			g_engine->_sound->playRoomMusic(_G(gameState)._personRoomNr[0]);
-		}
+		g_engine->_sound->playRoomMusic(_G(gameState)._personRoomNr[0]);
 	}
 	showCur();
 }
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index e5f69f964dd..e8741bf0e68 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -103,7 +103,7 @@ void Sound::stopAllSounds() {
 		stopSound(i);
 }
 
-bool Sound::isSoundActive(uint channel) {
+bool Sound::isSoundActive(uint channel) const {
 	assert(channel < MAX_SOUND_EFFECTS);
 	return _mixer->isSoundHandleActive(_soundHandle[channel]);
 }
@@ -153,7 +153,7 @@ void Sound::stopMusic() {
 	_mixer->stopHandle(_musicHandle);
 }
 
-bool Sound::isMusicActive() {
+bool Sound::isMusicActive() const {
 	return _mixer->isSoundHandleActive(_musicHandle);
 }
 
@@ -202,7 +202,7 @@ void Sound::stopSpeech() {
 	_mixer->stopHandle(_speechHandle);
 }
 
-bool Sound::isSpeechActive() {
+bool Sound::isSpeechActive() const {
 	return _mixer->isSoundHandleActive(_speechHandle);
 }
 
diff --git a/engines/chewy/sound.h b/engines/chewy/sound.h
index e5d0cf8df04..09c0d5e5b05 100644
--- a/engines/chewy/sound.h
+++ b/engines/chewy/sound.h
@@ -49,7 +49,7 @@ public:
 	void resumeSound(uint channel);
 	void stopSound(uint channel = 0);
 	void stopAllSounds();
-	bool isSoundActive(uint channel);
+	bool isSoundActive(uint channel) const;
 	void setSoundVolume(uint volume);
 	void setSoundChannelVolume(uint channel, uint volume);
 	void setSoundChannelBalance(uint channel, int8 balance);
@@ -59,7 +59,7 @@ public:
 	void pauseMusic();
 	void resumeMusic();
 	void stopMusic();
-	bool isMusicActive();
+	bool isMusicActive() const;
 	void setMusicVolume(uint volume);
 	void playRoomMusic(int16 roomNum);
 
@@ -67,7 +67,7 @@ public:
 	void pauseSpeech();
 	void resumeSpeech();
 	void stopSpeech();
-	bool isSpeechActive();
+	bool isSpeechActive() const;
 	void setSpeechVolume(uint volume);
 
 	void stopAll();
diff --git a/engines/chewy/sprite.cpp b/engines/chewy/sprite.cpp
index 738af00a1f2..c25b9d809a2 100644
--- a/engines/chewy/sprite.cpp
+++ b/engines/chewy/sprite.cpp
@@ -505,7 +505,7 @@ bool startAtsWait(int16 txtNr, int16 txtMode, int16 col, int16 mode) {
 
 				g_engine->_sound->setSoundChannelBalance(0, _G(atds)->getStereoPos(vocx));
 				if (vocNr >= 0) {
-					g_engine->_sound->playSpeech(vocNr, !g_engine->_sound->subtitlesEnabled());
+					g_engine->_sound->playSpeech(vocNr, false);
 				}
 
 				setupScreen(DO_SETUP);


Commit: 8df285937bfdc5faeede8c21b623137e72d0f217
    https://github.com/scummvm/scummvm/commit/8df285937bfdc5faeede8c21b623137e72d0f217
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-13T17:12:56+03:00

Commit Message:
CHEWY: More fixes for dialog delays

Changed paths:
    engines/chewy/atds.cpp
    engines/chewy/sprite.cpp


diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index f2e8d9ab849..17e15137ca0 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -430,8 +430,6 @@ void Atdsys::stop_ats() {
 }
 
 void Atdsys::print_ats(int16 x, int16 y, int16 scrX, int16 scrY) {
-	const Sound *sound = g_engine->_sound;
-
 	if (_atsv.shown) {
 		if (_atdsv._eventsEnabled) {
 			switch (_G(in)->getSwitchCode()) {
@@ -681,6 +679,9 @@ void Atdsys::print_aad(int16 scrX, int16 scrY) {
 					g_engine->_sound->setSoundChannelBalance(0, getStereoPos(vocx));
 					g_engine->_sound->playSpeech(_atdsv._vocNr, false);
 				}
+
+				if (_atdsv._vocNr >= 0 && !g_engine->_sound->isSpeechActive())
+					stopAad();
 			}
 
 			if (_aadv._delayCount <= 0) {
diff --git a/engines/chewy/sprite.cpp b/engines/chewy/sprite.cpp
index c25b9d809a2..b6c36148a08 100644
--- a/engines/chewy/sprite.cpp
+++ b/engines/chewy/sprite.cpp
@@ -463,10 +463,14 @@ void startAadWait(int16 diaNr) {
 		g_engine->_sound->isSpeechActive()
 		)) {
 
-		if (_G(minfo).button && _G(atds)->aadGetStatus() == -1)
+		if (_G(minfo).button && _G(atds)->aadGetStatus() == -1) {
 			g_engine->_sound->stopSpeech();
+		}
 
 		setupScreen(DO_SETUP);
+
+		if (_G(atds)->aadGetStatus() != -1 && g_engine->_sound->speechEnabled() && !g_engine->_sound->isSpeechActive())
+			_G(atds)->stopAad();
 	}
 
 	_G(mouseLeftClick) = oldMouseLeftClick;




More information about the Scummvm-git-logs mailing list