[Scummvm-git-logs] scummvm branch-2-6 -> 4899c1882fcdc9c9cdf0433ec89d0d37d2c58d89
bluegr
noreply at scummvm.org
Sun Jul 3 14:35:51 UTC 2022
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
289e088fb9 CHEWY: Fix sound settings
f850fb6c34 CHEWY: Fix sound volume and panning
7f9911cd2f CHEWY: Use enums in some cases of set_ats_str()
f3767583a1 CHEWY: Remove useless check
9f6ab4758d CHEWY: Start reworking dynamic hotspot string changes
cab9e55108 CHEWY: Implement extra music check for the harbor scene - bug #13652
4899c1882f CHEWY: Fix for vanishing items - bug #13653
Commit: 289e088fb973b6a842ef9cf1ee739f706ad08b92
https://github.com/scummvm/scummvm/commit/289e088fb973b6a842ef9cf1ee739f706ad08b92
Author: Coen Rampen (crampen at gmail.com)
Date: 2022-07-03T17:35:31+03:00
Commit Message:
CHEWY: Fix sound settings
This fixes the in-game options screen and synchronizes the sound settings there
with the ScummVM options screen settings.
Changed paths:
engines/chewy/chewy.cpp
engines/chewy/chewy.h
engines/chewy/dialogs/options.cpp
engines/chewy/sound.cpp
engines/chewy/sound.h
diff --git a/engines/chewy/chewy.cpp b/engines/chewy/chewy.cpp
index 1181eaa2242..89bc197e8ad 100644
--- a/engines/chewy/chewy.cpp
+++ b/engines/chewy/chewy.cpp
@@ -92,6 +92,12 @@ Common::Error ChewyEngine::run() {
#define SCUMMVM_TAG MKTAG('S', 'C', 'V', 'M')
+void ChewyEngine::syncSoundSettings() {
+ _sound->syncSoundSettings();
+
+ Engine::syncSoundSettings();
+}
+
Common::Error ChewyEngine::loadGameStream(Common::SeekableReadStream *stream) {
exit_room(-1);
diff --git a/engines/chewy/chewy.h b/engines/chewy/chewy.h
index 1a94a2a6b95..6c0741512f6 100644
--- a/engines/chewy/chewy.h
+++ b/engines/chewy/chewy.h
@@ -93,6 +93,8 @@ public:
_canSave = canLoadSave;
}
+ void syncSoundSettings() override;
+
/**
* Load savegame data
*/
diff --git a/engines/chewy/dialogs/options.cpp b/engines/chewy/dialogs/options.cpp
index 5f73b116e52..e895f2ff884 100644
--- a/engines/chewy/dialogs/options.cpp
+++ b/engines/chewy/dialogs/options.cpp
@@ -26,6 +26,8 @@
#include "chewy/mcga_graphics.h"
#include "chewy/sound.h"
+#include "common/config-manager.h"
+
namespace Chewy {
namespace Dialogs {
@@ -37,7 +39,7 @@ namespace Dialogs {
#define MUND_END 11
#define SCHNULL_OFF 23
#define TDISP_START 12
-#define TDISP_END 19
+#define TDISP_END 13
#define TDISP_EIN 20
#define TDISP_AUS 21
#define MUSIC_OFF 24
@@ -60,9 +62,6 @@ void Options::execute(TafInfo *ti) {
int16 mund_ani = MUND_START;
int16 mund_delay = 3;
int16 mund_count = mund_delay;
- int16 tdisp_ani = TDISP_START;
- int16 tdisp_delay = 3;
- int16 tdisp_count = tdisp_delay;
_G(FrameSpeed) = 0;
int16 delay_count = _G(gameState).DelaySpeed;
//warning("stop_clock = (clock() / CLK_TCK) + 1;");
@@ -85,7 +84,7 @@ void Options::execute(TafInfo *ti) {
Common::String fps = Common::String::format("%d", _G(gameState).FramesPerSecond << 1);
_G(out)->printxy(36 + bar_off, 65, 255, 300, 0, fps.c_str());
- if (g_engine->_sound->soundEnabled()) {
+ if (g_engine->_sound->speechEnabled()) {
_G(out)->spriteSet(ti->image[mund_ani],
18 + ti->correction[mund_ani << 1],
8 + ti->correction[(mund_ani << 1) + 1], 0);
@@ -101,15 +100,15 @@ void Options::execute(TafInfo *ti) {
8 + ti->correction[(SCHNULL_BAND << 1) + 1], 0);
}
- const int soundVolume = g_engine->_sound->getSoundVolume() * Audio::Mixer::kMaxChannelVolume / 120;
+ const int soundVolume = MAX(1, g_engine->_sound->getSoundVolume() * 32 / Audio::Mixer::kMaxMixerVolume);
_G(out)->pop_box(32 - 2, 104 - 12, 42 + 4, 136 + 2, 192, 183, 182);
_G(out)->printxy(32 + 3, 104 - 10, 15, 300, 0, "S");
- _G(out)->boxFill(33, 136 - (soundVolume >> 1), 42, 136, 15);
+ _G(out)->boxFill(33, 136 - soundVolume, 42, 136, 15);
- const int musicVolume = g_engine->_sound->getSoundVolume() * Audio::Mixer::kMaxChannelVolume / 120;
+ const int musicVolume = MAX(1, g_engine->_sound->getMusicVolume() * 32 / Audio::Mixer::kMaxMixerVolume);
_G(out)->pop_box(52 - 2, 104 - 12, 62 + 4, 136 + 2, 192, 183, 182);
_G(out)->printxy(52 + 3, 104 - 10, 31, 300, 0, "M");
- _G(out)->boxFill(53, 136 - (musicVolume >> 1), 62, 136, 31);
+ _G(out)->boxFill(53, 136 - musicVolume, 62, 136, 31);
if (g_engine->_sound->musicEnabled()) {
_G(out)->spriteSet(ti->image[MUSIC_ON1],
@@ -123,17 +122,21 @@ void Options::execute(TafInfo *ti) {
18 + ti->correction[MUSIC_OFF << 1],
8 + ti->correction[(MUSIC_OFF << 1) + 1], 0);
- if (g_engine->_sound->subtitlesEnabled()) {
- _G(out)->spriteSet(ti->image[tdisp_ani],
- 18 + ti->correction[tdisp_ani << 1],
- 8 + ti->correction[(tdisp_ani << 1) + 1], 0);
+ if (g_engine->_sound->soundEnabled()) {
+ _G(out)->spriteSet(ti->image[TDISP_START],
+ ti->correction[TDISP_START << 1],
+ ti->correction[(TDISP_START << 1) + 1], 0);
_G(out)->spriteSet(ti->image[TDISP_EIN],
18 + ti->correction[TDISP_EIN << 1],
8 + ti->correction[(TDISP_EIN << 1) + 1], 0);
- } else
+ } else {
+ _G(out)->spriteSet(ti->image[TDISP_END],
+ ti->correction[TDISP_END << 1],
+ ti->correction[(TDISP_END << 1) + 1], 0);
_G(out)->spriteSet(ti->image[TDISP_AUS],
18 + ti->correction[TDISP_AUS << 1],
8 + ti->correction[(TDISP_AUS << 1) + 1], 0);
+ }
_G(out)->spriteSet(ti->image[EXIT],
18 + ti->correction[EXIT << 1],
@@ -141,19 +144,32 @@ void Options::execute(TafInfo *ti) {
key = _G(in)->getSwitchCode();
if ((_G(minfo).button == 1) || (key == Common::KEYCODE_RETURN)) {
- WAIT_TASTE_LOS
+ // TODO This line breaks screen updates. Not sure what it does
+ // otherwise; options screen seems to work without it.
+ //WAIT_TASTE_LOS
int16 rect = _G(in)->findHotspot(_G(optionHotspots));
switch (rect) {
- case 0:
+ case 0: // Hamster wheel arrow left (speed down)
if (_G(gameState).FramesPerSecond > 6)
--_G(gameState).FramesPerSecond;
break;
- case 1:
+ case 1: // Hamster wheel arrow right (speed up)
if (_G(gameState).FramesPerSecond < 10)
++_G(gameState).FramesPerSecond;
break;
- case 2:
+ case 2: // Mouth (speech/subtitles)
+ if (!g_engine->_sound->speechEnabled()) {
+ g_engine->_sound->toggleSubtitles(false);
+ g_engine->_sound->toggleSpeech(true);
+ } else {
+ g_engine->_sound->toggleSubtitles(true);
+ g_engine->_sound->toggleSpeech(false);
+ }
+ g_engine->syncSoundSettings();
+ break;
+ case 3:
+ case 4: // Speaker (sound)
if (g_engine->_sound->soundEnabled()) {
g_engine->_sound->toggleSound(false);
_G(det)->disable_room_sound();
@@ -161,18 +177,9 @@ void Options::execute(TafInfo *ti) {
g_engine->_sound->toggleSound(true);
_G(det)->enable_room_sound();
}
+ g_engine->syncSoundSettings();
break;
- case 3:
- case 4:
- if (g_engine->_sound->subtitlesEnabled()) {
- g_engine->_sound->toggleSubtitles(false);
- g_engine->_sound->toggleSpeech(true);
- } else {
- g_engine->_sound->toggleSubtitles(true);
- g_engine->_sound->toggleSpeech(false);
- }
- break;
- case 5:
+ case 5: // Guitarist (music)
if (g_engine->_sound->musicEnabled()) {
g_engine->_sound->toggleMusic(false);
g_engine->_sound->stopMusic();
@@ -180,15 +187,18 @@ void Options::execute(TafInfo *ti) {
g_engine->_sound->toggleMusic(true);
g_engine->_sound->playRoomMusic(_G(gameState)._personRoomNr[P_CHEWY]);
}
+ g_engine->syncSoundSettings();
break;
- case 6:
+ case 6: // Door (exit)
key = Common::KEYCODE_ESCAPE;
break;
- case 7:
- g_engine->_sound->setSoundVolume(((136 - g_events->_mousePos.y) << 1) * Audio::Mixer::kMaxChannelVolume / 120);
+ case 7: // S volume gauge
+ g_engine->_sound->setSoundVolume(MIN(32, 136 - g_events->_mousePos.y) * Audio::Mixer::kMaxMixerVolume / 32);
+ g_engine->syncSoundSettings();
break;
- case 8:
- g_engine->_sound->setMusicVolume(((136 - g_events->_mousePos.y) << 1) * Audio::Mixer::kMaxChannelVolume / 120);
+ case 8: // M volume gauge
+ g_engine->_sound->setMusicVolume(MIN(32, 136 - g_events->_mousePos.y) * Audio::Mixer::kMaxMixerVolume / 32);
+ g_engine->syncSoundSettings();
break;
default:
@@ -237,15 +247,6 @@ void Options::execute(TafInfo *ti) {
mund_ani = MUND_START;
mund_count = mund_delay;
}
- if (tdisp_count > 0)
- --tdisp_count;
- else {
- if (tdisp_ani < TDISP_END)
- ++tdisp_ani;
- else
- tdisp_ani = TDISP_START;
- tdisp_count = tdisp_delay;
- }
delay_count = _G(gameState).DelaySpeed;
} else
--delay_count;
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index c2c3da0262b..f2cd37cca8d 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -95,25 +95,26 @@ bool Sound::isSoundActive(uint channel) const {
}
void Sound::setSoundVolume(uint volume) {
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, volume);
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volume);
+ _userSoundVolume = volume;
+ if (soundEnabled())
+ ConfMan.setInt("sfx_volume", volume);
}
int Sound::getSoundVolume() const {
- return _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
+ return _userSoundVolume;
}
void Sound::pushVolume() {
- _soundVolume = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
+ /* _soundVolume = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
_speechVolume = _mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType);
- _musicVolume = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
+ _musicVolume = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);*/
}
void Sound::popVolume() {
- assert(_soundVolume >= 0 && _speechVolume >= 0 && _musicVolume >= 0);
+ /* assert(_soundVolume >= 0 && _speechVolume >= 0 && _musicVolume >= 0);
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _soundVolume);
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _speechVolume);
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _musicVolume);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _musicVolume);*/
}
void Sound::setSoundChannelVolume(uint channel, uint volume) {
@@ -162,11 +163,13 @@ bool Sound::isMusicActive() const {
}
void Sound::setMusicVolume(uint volume) {
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume);
+ _userMusicVolume = volume;
+ if (musicEnabled())
+ ConfMan.setInt("music_volume", volume);
}
int Sound::getMusicVolume() const {
- return _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
+ return _userMusicVolume;
}
void Sound::playSpeech(int num, bool waitForFinish) {
@@ -227,19 +230,19 @@ void Sound::waitForSpeechToFinish() {
}
bool Sound::soundEnabled() const {
- return !ConfMan.getBool("sfx_mute");
+ return ConfMan.getInt("sfx_volume") > 0;
}
void Sound::toggleSound(bool enable) {
- return ConfMan.setBool("sfx_mute", !enable);
+ ConfMan.setInt("sfx_volume", enable ? _userSoundVolume : 0);
}
bool Sound::musicEnabled() const {
- return !ConfMan.getBool("music_mute");
+ return ConfMan.getInt("music_volume") > 0;
}
void Sound::toggleMusic(bool enable) {
- return ConfMan.setBool("music_mute", !enable);
+ ConfMan.setInt("music_volume", enable ? _userSoundVolume : 0);
}
bool Sound::speechEnabled() const {
@@ -247,7 +250,7 @@ bool Sound::speechEnabled() const {
}
void Sound::toggleSpeech(bool enable) {
- return ConfMan.setBool("speech_mute", !enable);
+ ConfMan.setBool("speech_mute", !enable);
}
bool Sound::subtitlesEnabled() const {
@@ -255,7 +258,31 @@ bool Sound::subtitlesEnabled() const {
}
void Sound::toggleSubtitles(bool enable) {
- return ConfMan.setBool("subtitles", enable);
+ ConfMan.setBool("subtitles", enable);
+}
+
+void Sound::syncSoundSettings() {
+ int confSoundVolume = ConfMan.getInt("sfx_volume");
+ int confMusicVolume = ConfMan.getInt("music_volume");
+
+ if (confSoundVolume == 0) {
+ // Sound is muted.
+ if (_userSoundVolume == 0)
+ // Set a default value.
+ _userSoundVolume = 192;
+ // Otherwise leave _soundVolume at the last value set by the user.
+ } else {
+ _userSoundVolume = confSoundVolume;
+ }
+ if (confMusicVolume == 0) {
+ // Music is muted.
+ if (_userMusicVolume == 0)
+ // Set a default value.
+ _userMusicVolume = 192;
+ // Otherwise leave _musicVolume at the last value set by the user.
+ } else {
+ _userMusicVolume = confMusicVolume;
+ }
}
struct RoomMusic {
diff --git a/engines/chewy/sound.h b/engines/chewy/sound.h
index e20be085fbb..b2862e35b84 100644
--- a/engines/chewy/sound.h
+++ b/engines/chewy/sound.h
@@ -92,13 +92,16 @@ public:
bool subtitlesEnabled() const;
void toggleSubtitles(bool enable);
+ void syncSoundSettings();
+
private:
Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle[MAX_SOUND_EFFECTS];
Audio::SoundHandle _musicHandle;
Audio::SoundHandle _speechHandle;
int16 _curMusic = -1;
- int _soundVolume = -1, _speechVolume = -1, _musicVolume = -1;
+ // Volume settings in the in-game options screen.
+ int _userSoundVolume = -1, _userMusicVolume = -1;
SoundResource *_speechRes;
SoundResource *_soundRes;
Commit: f850fb6c3479814f05ee557f895c3e1bb5114a41
https://github.com/scummvm/scummvm/commit/f850fb6c3479814f05ee557f895c3e1bb5114a41
Author: Coen Rampen (crampen at gmail.com)
Date: 2022-07-03T17:35:31+03:00
Commit Message:
CHEWY: Fix sound volume and panning
This commit fixes the initial panning for speech and scripted SFX. These were
set on the sound handle of the previous speech or SFX sample, which would not
affect the new sample.
Changed paths:
engines/chewy/atds.cpp
engines/chewy/detail.cpp
engines/chewy/sound.cpp
engines/chewy/sound.h
engines/chewy/sprite.cpp
engines/chewy/video/cfo_decoder.cpp
diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index 1b7667a6cca..2bce9f8b457 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -665,8 +665,7 @@ void Atdsys::print_aad(int16 scrX, int16 scrY) {
_atdsv._vocNr = _aadv._strHeader->_vocNr - ATDS_VOC_OFFSET;
const int16 vocx = _G(moveState)[personId].Xypos[0] -
_G(gameState).scrollx + _G(spieler_mi)[personId].HotX;
- g_engine->_sound->setSoundChannelBalance(0, getStereoPos(vocx));
- g_engine->_sound->playSpeech(_atdsv._vocNr, false);
+ g_engine->_sound->playSpeech(_atdsv._vocNr, false, getStereoPos(vocx));
}
if (_atdsv._vocNr >= 0 && !g_engine->_sound->isSpeechActive())
@@ -991,7 +990,7 @@ int16 Atdsys::calc_inv_no_use(int16 curInv, int16 testNr) {
}
int8 Atdsys::getStereoPos(int16 x) {
- return floor(x / 2.5) * 2 - 127;
+ return floor(x / 2.5);
}
void Atdsys::saveAtdsStream(Common::WriteStream *stream) {
diff --git a/engines/chewy/detail.cpp b/engines/chewy/detail.cpp
index bb3fa31d71b..75b24a071c2 100644
--- a/engines/chewy/detail.cpp
+++ b/engines/chewy/detail.cpp
@@ -404,9 +404,7 @@ void Detail::plot_ani_details(int16 scrx, int16 scry, int16 start, int16 end, in
if ((adiptr->sfx.sound_start[k] == adiptr->ani_count) &&
(!adiptr->delay_count)) {
const uint channel = adiptr->sfx.kanal[k] & 7;
- sound->setSoundChannelBalance(channel, adiptr->sfx.stereo[k]);
- sound->setSoundChannelVolume(channel, adiptr->sfx.volume[k]);
- sound->playSound(soundEffect, channel, adiptr->sfx.repeats[k]);
+ sound->playSound(soundEffect, channel, adiptr->sfx.repeats[k], adiptr->sfx.volume[k], adiptr->sfx.stereo[k]);
}
}
}
@@ -545,9 +543,7 @@ SprInfo Detail::plot_detail_sprite(int16 scrx, int16 scry, int16 det_nr, int16 s
(_rdi.sample[soundEffect])) {
if (adiptr->sfx.sound_start[k] == spr_nr) {
const uint channel = adiptr->sfx.kanal[k] & 7;
- sound->setSoundChannelBalance(channel, adiptr->sfx.stereo[k]);
- sound->setSoundChannelVolume(channel, adiptr->sfx.volume[k]);
- sound->playSound(soundEffect, channel, adiptr->sfx.repeats[k]);
+ sound->playSound(soundEffect, channel, adiptr->sfx.repeats[k], adiptr->sfx.volume[k], adiptr->sfx.stereo[k]);
}
}
}
@@ -594,9 +590,7 @@ void Detail::play_detail_sound(int16 nr) {
if ((sdb->sound_enable[k]) && (sdb->sound_index[k] != -1) &&
(_rdi.sample[sdb->sound_index[k]])) {
const uint channel = sdb->kanal[k] & 7;
- sound->setSoundChannelBalance(channel, sdb->stereo[k]);
- sound->setSoundChannelVolume(channel, sdb->volume[k]);
- sound->playSound(sdb->sound_index[k], channel, sdb->repeats[k]);
+ sound->playSound(sdb->sound_index[k], channel, sdb->repeats[k], sdb->volume[k], sdb->stereo[k]);
}
}
}
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index f2cd37cca8d..937cb98e260 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -46,18 +46,18 @@ Sound::~Sound() {
delete _speechRes;
}
-void Sound::playSound(int num, uint channel, bool loop) {
+void Sound::playSound(int num, uint channel, bool loop, uint16 volume, uint16 balance) {
SoundChunk *sound = _soundRes->getSound(num);
uint8 *data = (uint8 *)MALLOC(sound->size);
memcpy(data, sound->data, sound->size);
- playSound(data, sound->size, channel, loop);
+ playSound(data, sound->size, channel, loop, volume, balance);
delete[] sound->data;
delete sound;
}
-void Sound::playSound(uint8 *data, uint32 size, uint channel, bool loop, DisposeAfterUse::Flag dispose) {
+void Sound::playSound(uint8 *data, uint32 size, uint channel, bool loop, uint16 volume, uint16 balance, DisposeAfterUse::Flag dispose) {
stopSound(channel);
Audio::AudioStream *stream = Audio::makeLoopingAudioStream(
@@ -66,7 +66,11 @@ void Sound::playSound(uint8 *data, uint32 size, uint channel, bool loop, Dispose
dispose),
loop ? 0 : 1);
- _mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle[channel], stream);
+ assert(volume >= 0 && volume < 64);
+ assert(balance >= 0 && balance < 128);
+
+ _mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle[channel], stream, -1,
+ volume * Audio::Mixer::kMaxChannelVolume / 63, MIN(127, (balance - 63) * 2));
}
void Sound::pauseSound(uint channel) {
@@ -172,7 +176,7 @@ int Sound::getMusicVolume() const {
return _userMusicVolume;
}
-void Sound::playSpeech(int num, bool waitForFinish) {
+void Sound::playSpeech(int num, bool waitForFinish, uint16 balance) {
if (isSpeechActive())
stopSpeech();
@@ -190,8 +194,10 @@ void Sound::playSpeech(int num, bool waitForFinish) {
new Common::MemorySeekableReadWriteStream(data, size, DisposeAfterUse::YES),
DisposeAfterUse::YES);
- _mixer->playStream(Audio::Mixer::kSpeechSoundType,
- &_speechHandle, stream);
+ assert(balance >= 0 && balance < 128);
+
+ _mixer->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream,
+ -1 , 255, MIN(127, (balance - 63) * 2));
if (waitForFinish) {
// Wait for speech to finish
@@ -229,6 +235,12 @@ void Sound::waitForSpeechToFinish() {
}
}
+void Sound::setSpeechBalance(uint16 balance) {
+ if (isSpeechActive()) {
+ _mixer->setChannelBalance(_speechHandle, balance);
+ }
+}
+
bool Sound::soundEnabled() const {
return ConfMan.getInt("sfx_volume") > 0;
}
diff --git a/engines/chewy/sound.h b/engines/chewy/sound.h
index b2862e35b84..eb3d3021065 100644
--- a/engines/chewy/sound.h
+++ b/engines/chewy/sound.h
@@ -43,8 +43,8 @@ public:
Sound(Audio::Mixer *mixer);
virtual ~Sound();
- void playSound(int num, uint channel = 0, bool loop = false);
- void playSound(uint8 *data, uint32 size, uint channel = 0, bool loop = false, DisposeAfterUse::Flag dispose = DisposeAfterUse::YES);
+ void playSound(int num, uint channel = 0, bool loop = false, uint16 volume = 63, uint16 balance = 63);
+ void playSound(uint8 *data, uint32 size, uint channel = 0, bool loop = false, uint16 volume = 63, uint16 balance = 63, DisposeAfterUse::Flag dispose = DisposeAfterUse::YES);
void pauseSound(uint channel);
void resumeSound(uint channel);
void stopSound(uint channel = 0);
@@ -67,11 +67,12 @@ public:
int getMusicVolume() const;
void playRoomMusic(int16 roomNum);
- void playSpeech(int num, bool waitForFinish);
+ void playSpeech(int num, bool waitForFinish, uint16 balance = 63);
void pauseSpeech();
void resumeSpeech();
void stopSpeech();
bool isSpeechActive() const;
+ void setSpeechBalance(uint16 balance = 63);
void stopAll();
diff --git a/engines/chewy/sprite.cpp b/engines/chewy/sprite.cpp
index 1ff46c0105d..7753b457228 100644
--- a/engines/chewy/sprite.cpp
+++ b/engines/chewy/sprite.cpp
@@ -507,9 +507,12 @@ bool startAtsWait(int16 txtNr, int16 txtMode, int16 col, int16 mode) {
if (g_engine->_sound->speechEnabled()) {
const int16 vocx = _G(moveState)[P_CHEWY].Xypos[0] - _G(gameState).scrollx + _G(spieler_mi)[P_CHEWY].HotX;
- g_engine->_sound->setSoundChannelBalance(0, _G(atds)->getStereoPos(vocx));
if (vocNr >= 0) {
- g_engine->_sound->playSpeech(vocNr, false);
+ g_engine->_sound->playSpeech(vocNr, false, _G(atds)->getStereoPos(vocx));
+ } else {
+ // Not sure if the game alters speech balance while speech
+ // plays, but the old code behaved this way.
+ g_engine->_sound->setSpeechBalance(_G(atds)->getStereoPos(vocx));
}
setupScreen(DO_SETUP);
diff --git a/engines/chewy/video/cfo_decoder.cpp b/engines/chewy/video/cfo_decoder.cpp
index e556651fe7a..dc9c4de53a6 100644
--- a/engines/chewy/video/cfo_decoder.cpp
+++ b/engines/chewy/video/cfo_decoder.cpp
@@ -258,12 +258,12 @@ void CfoDecoder::CfoVideoTrack::handleCustomFrame() {
case kChunkPlayVoc:
number = _fileStream->readUint16LE();
channel = _fileStream->readUint16LE();
- volume = _fileStream->readUint16LE() * Audio::Mixer::kMaxChannelVolume / 63;
+ volume = _fileStream->readUint16LE();// * Audio::Mixer::kMaxChannelVolume / 63;
repeat = _fileStream->readUint16LE();
assert(number < MAX_SOUND_EFFECTS);
- _sound->setSoundVolume(volume);
- _sound->playSound(_soundEffects[number], _soundEffectSize[number], channel, repeat, DisposeAfterUse::NO);
+ //_sound->setSoundVolume(volume);
+ _sound->playSound(_soundEffects[number], _soundEffectSize[number], channel, repeat, volume, 63, DisposeAfterUse::NO);
break;
case kChunkSetSoundVolume:
volume = _fileStream->readUint16LE() * Audio::Mixer::kMaxChannelVolume / 63;
Commit: 7f9911cd2fd5ade7d982f45251cda3afddd993f9
https://github.com/scummvm/scummvm/commit/7f9911cd2fd5ade7d982f45251cda3afddd993f9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-03T17:35:32+03:00
Commit Message:
CHEWY: Use enums in some cases of set_ats_str()
Changed paths:
engines/chewy/rooms/room03.cpp
engines/chewy/rooms/room77.cpp
engines/chewy/t_event.cpp
diff --git a/engines/chewy/rooms/room03.cpp b/engines/chewy/rooms/room03.cpp
index b3bfe4e9107..3ad7539e1db 100644
--- a/engines/chewy/rooms/room03.cpp
+++ b/engines/chewy/rooms/room03.cpp
@@ -395,7 +395,7 @@ void Room3::probeTransfer() {
case 1:
g_engine->_sound->waitForSpeechToFinish();
- _G(atds)->set_ats_str(24, 0, 1);
+ _G(atds)->set_ats_str(24, 0, ATS_DATA);
_G(mov_phasen)[0].AtsText = 544;
switchRoom(1);
break;
diff --git a/engines/chewy/rooms/room77.cpp b/engines/chewy/rooms/room77.cpp
index ff1c0969920..8a47badca69 100644
--- a/engines/chewy/rooms/room77.cpp
+++ b/engines/chewy/rooms/room77.cpp
@@ -108,7 +108,7 @@ int Room77::proc2() {
if (_G(gameState).flags29_8) {
start_spz_wait(14, 1, false, P_CHEWY);
delInventory(_G(cur)->getInventoryCursor());
- _G(atds)->set_ats_str(464, 1, 1);
+ _G(atds)->set_ats_str(464, 1, ATS_DATA);
_G(gameState).flags29_20 = true;
_G(gameState).flags29_40 = true;
diaNr = 442;
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index ad7ef1ca3d8..0a82e7d8bb4 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -2280,14 +2280,14 @@ void calc_inv_use_txt(int16 test_nr) {
case 105:
delInventory(_G(cur)->getInventoryCursor());
- _G(atds)->set_ats_str(105, 0, 1, 6);
+ _G(atds)->set_ats_str(105, 0, 1, INV_ATS_DATA);
_G(menu_item) = CUR_USE;
cursorChoice(CUR_USE);
break;
case 106:
del_invent_slot(106);
- _G(atds)->set_ats_str(105, 0, 1, 6);
+ _G(atds)->set_ats_str(105, 0, 1, INV_ATS_DATA);
break;
default:
Commit: f3767583a1083e54d255ccc9333087d8a14fce85
https://github.com/scummvm/scummvm/commit/f3767583a1083e54d255ccc9333087d8a14fce85
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-03T17:35:32+03:00
Commit Message:
CHEWY: Remove useless check
Changed paths:
engines/chewy/rooms/room21.cpp
diff --git a/engines/chewy/rooms/room21.cpp b/engines/chewy/rooms/room21.cpp
index b017872d91a..48516727b9a 100644
--- a/engines/chewy/rooms/room21.cpp
+++ b/engines/chewy/rooms/room21.cpp
@@ -206,8 +206,7 @@ void Room21::chewy_kolli() {
}
void Room21::salto() {
- if (!_G(cur)->usingInventoryCursor() && _G(atds)->get_ats_str(134, TXT_MARK_USE, ATS_DATA) == 8
- && !_G(gameState).R21Salto && !_G(flags).AutoAniPlay) {
+ if (!_G(cur)->usingInventoryCursor() && !_G(gameState).R21Salto && !_G(flags).AutoAniPlay) {
_G(gameState).R21Salto = true;
_G(flags).AutoAniPlay = true;
_G(gameState)._personHide[P_CHEWY] = true;
Commit: 9f6ab4758d7900336b69a2c99dbc81100fcd8df6
https://github.com/scummvm/scummvm/commit/9f6ab4758d7900336b69a2c99dbc81100fcd8df6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-03T17:35:32+03:00
Commit Message:
CHEWY: Start reworking dynamic hotspot string changes
This was not implemented in the refactoring done in 8eadac5eeda.
It's still incomplete, and doesn't work yet
Changed paths:
engines/chewy/atds.cpp
engines/chewy/atds.h
engines/chewy/defines.h
engines/chewy/inits.cpp
engines/chewy/text.cpp
engines/chewy/text.h
engines/chewy/types.cpp
engines/chewy/types.h
diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index 2bce9f8b457..1320832259b 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -352,39 +352,11 @@ void Atdsys::load_atds(int16 chunkNr, int16 mode) {
}
}
-void Atdsys::set_ats_mem(int16 mode) {
- switch (mode) {
- case ATS_DATA:
- _ats_sheader = _G(gameState).Ats;
- _atsMem = _atdsMem[mode];
- break;
-
- case INV_USE_DATA:
- _ats_sheader = _G(gameState).InvUse;
- _atsMem = _atdsMem[mode];
- break;
-
- case INV_USE_DEF:
- error("set_ats_mem() called with mode INV_USE_DEF");
-
- case INV_ATS_DATA:
- _ats_sheader = _G(gameState).InvAts;
- _atsMem = _atdsMem[mode];
- break;
-
- default:
- break;
- }
-}
-
bool Atdsys::start_ats(int16 txtNr, int16 txtMode, int16 color, int16 mode, int16 *vocNr) {
assert(mode == ATS_DATA || mode == INV_USE_DATA || mode == INV_USE_DEF);
*vocNr = -1;
- if (mode != INV_USE_DEF)
- set_ats_mem(mode);
-
_atsv.shown = false;
Common::StringArray textArray;
@@ -501,19 +473,7 @@ void Atdsys::print_ats(int16 x, int16 y, int16 scrX, int16 scrY) {
}
void Atdsys::set_ats_str(int16 txtNr, int16 txtMode, int16 strNr, int16 mode) {
- set_ats_mem(mode);
- uint8 status = _ats_sheader[(txtNr * MAX_ATS_STATUS) + (txtMode + 1) / 2];
- int16 ak_nybble = (txtMode + 1) % 2;
-
- uint8 lo_hi[2];
- lo_hi[1] = status >> 4;
- lo_hi[0] = status &= 15;
- lo_hi[ak_nybble] = strNr;
- status = 0;
- lo_hi[1] <<= 4;
- status |= lo_hi[0];
- status |= lo_hi[1];
- _ats_sheader[(txtNr * MAX_ATS_STATUS) + (txtMode + 1) / 2] = status;
+ _text->setTextId(txtNr, txtMode, strNr, mode);
}
void Atdsys::set_ats_str(int16 txtNr, int16 strNr, int16 mode) {
@@ -521,31 +481,16 @@ void Atdsys::set_ats_str(int16 txtNr, int16 strNr, int16 mode) {
set_ats_str(txtNr, i, strNr, mode);
}
-int16 Atdsys::get_ats_str(int16 txtNr, int16 txtMode, int16 mode) {
- set_ats_mem(mode);
- uint8 status = _ats_sheader[(txtNr * MAX_ATS_STATUS) + (txtMode + 1) / 2];
- int16 ak_nybble = (txtMode + 1) % 2;
-
- uint8 lo_hi[2];
- lo_hi[1] = status >> 4;
- lo_hi[0] = status &= 15;
-
- return (int16)lo_hi[ak_nybble];
-}
-
int16 Atdsys::getControlBit(int16 txtNr, int16 bitIdx) {
- set_ats_mem(ATS_DATA);
- return (_ats_sheader[txtNr * MAX_ATS_STATUS] & bitIdx) != 0;
+ return _text->getControlBit(txtNr, bitIdx);
}
void Atdsys::setControlBit(int16 txtNr, int16 bitIdx) {
- set_ats_mem(ATS_DATA);
- _ats_sheader[txtNr * MAX_ATS_STATUS] |= bitIdx;
+ _text->setControlBit(txtNr, bitIdx);
}
void Atdsys::delControlBit(int16 txtNr, int16 bitIdx) {
- set_ats_mem(ATS_DATA);
- _ats_sheader[txtNr * MAX_ATS_STATUS] &= ~bitIdx;
+ _text->delControlBit(txtNr, bitIdx);
}
int16 Atdsys::start_aad(int16 diaNr) {
@@ -1025,4 +970,8 @@ Common::String Atdsys::getTextEntry(uint dialogNum, uint entryNum, int type, int
return Common::String();
}
+int16 Atdsys::getLastSpeechId() {
+ return _text->getLastSpeechId();
+}
+
} // namespace Chewy
diff --git a/engines/chewy/atds.h b/engines/chewy/atds.h
index 74dadb6e945..76508377ad9 100644
--- a/engines/chewy/atds.h
+++ b/engines/chewy/atds.h
@@ -228,8 +228,6 @@ public:
void delControlBit(int16 txtNr, int16 bitIdx);
void set_ats_str(int16 txtNr, int16 txtMode, int16 strNr, int16 mode);
void set_ats_str(int16 txtNr, int16 strNr, int16 mode);
- int16 get_ats_str(int16 txtNr, int16 txtMode, int16 mode);
- void set_ats_mem(int16 mode);
int16 start_aad(int16 diaNr);
void stopAad();
void print_aad(int16 scrX, int16 scrY);
@@ -263,7 +261,7 @@ public:
Common::StringArray getTextArray(uint dialogNum, uint entryNum, int type, int subEntry = -1);
Common::String getTextEntry(uint dialogNum, uint entryNum, int type, int subEntry = -1);
- int16 getLastSpeechId() { return _text->getLastSpeechId(); }
+ int16 getLastSpeechId();
private:
void init();
@@ -273,8 +271,6 @@ private:
Common::File *_atdsHandle = nullptr;
char *_atdsMem[MAX_HANDLE] = { nullptr };
int16 _atdsPoolOff[MAX_HANDLE] = { 0 };
- char *_atsMem = nullptr;
- uint8 *_ats_sheader = nullptr;
AadVar _aadv;
AtsVar _atsv;
DialogCloseupVariables _dialogCloseup;
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 9ec3aa92972..aa502b054a3 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -404,7 +404,6 @@ enum SetupScreenMode {
#define AUTO_OBJ4 4
#define MAX_OBJ_MOV 3
-#define ROOM_ATS_MAX 1000
#define INV_USE_ATS_MAX 500
#define ATS_ACTION_VOR 0
#define ATS_ACTION_NACH 1
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index 9a2a3abc621..c94270feba1 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -164,24 +164,6 @@ void new_game() {
_G(obj)->load(INVENTORY_SIB, &_G(gameState).room_s_obj[0]);
_G(obj)->load(EXIT_EIB, &_G(gameState).room_e_obj[0]);
- Common::File f;
-
- if (!f.open(ROOM_ATS_STEUER))
- error("Error reading file: %s", ROOM_ATS_STEUER);
- for (int16 i = 0; i < ROOM_ATS_MAX; i++)
- _G(gameState).Ats[i * MAX_ATS_STATUS] = f.readByte();
- f.close();
-
- // WORKAROUND: For English version, taxi hotspot in
- // room 45 (Big City) isn't turned on by default
- _G(gameState).Ats[295 * MAX_ATS_STATUS] = ATS_ACTION_BIT;
-
- if (!f.open(INV_ATS_STEUER))
- error("Error reading file: %s", INV_ATS_STEUER);
- for (int16 i = 0; i < MAX_MOV_OBJ; i++)
- _G(gameState).InvAts[i * MAX_ATS_STATUS] = f.readByte();
- f.close();
-
_G(obj)->sort();
for (int16 i = 0; i < _G(obj)->spieler_invnr[0]; i++)
_G(gameState).InventSlot[i] = _G(obj)->spieler_invnr[i + 1];
diff --git a/engines/chewy/text.cpp b/engines/chewy/text.cpp
index 0a920246453..17c7d22026d 100644
--- a/engines/chewy/text.cpp
+++ b/engines/chewy/text.cpp
@@ -22,12 +22,35 @@
#include "common/system.h"
#include "chewy/resource.h"
#include "chewy/text.h"
+
+#include "types.h"
#include "chewy/atds.h"
#include "chewy/defines.h"
namespace Chewy {
Text::Text() : Resource("atds.tap") {
+ memset(_hotspotStrings, sizeof(_hotspotStrings), 0);
+
+ Common::File f;
+
+ if (!f.open(ROOM_ATS_STEUER))
+ error("Error reading file: %s", ROOM_ATS_STEUER);
+ for (int16 i = 0; i < ROOM_ATS_MAX; i++)
+ _hotspotStrings[i * MAX_ATS_STATUS] = f.readByte();
+
+ f.close();
+
+ if (!f.open(INV_ATS_STEUER))
+ error("Error reading file: %s", INV_ATS_STEUER);
+ for (int16 i = 0; i < MAX_MOV_OBJ; i++)
+ _inventoryStrings[i * MAX_ATS_STATUS] = f.readByte();
+
+ f.close();
+
+ // WORKAROUND: For English version, taxi hotspot in
+ // room 45 (Big City) isn't turned on by default
+ _hotspotStrings[295] = ATS_ACTION_BIT;
}
Text::~Text() {
@@ -86,6 +109,11 @@ TextEntry *Text::getText(uint chunk, uint entry, int type, int subEntry) {
bool isAutoDialog = false;
bool isInvDesc = false;
+ //int subEntryNew = -1;
+
+ //if (subEntry >= 0)
+ // subEntryNew = getTextId(entry, subEntry, type);
+
switch (type) {
case AAD_DATA:
chunk += kADSTextMax + kATSTextMax;
@@ -232,4 +260,85 @@ const char *Text::strPos(const char *txtAdr, int16 pos) {
return ptr;
}
+void Text::syncHotspotStrings(Common::Serializer &s) {
+ for (size_t i = 0; i < sizeof(_hotspotStrings); ++i)
+ s.syncAsByte(_hotspotStrings[i]);
+}
+
+void Text::syncInventoryStrings(Common::Serializer &s) {
+ for (size_t i = 0; i < sizeof(_inventoryStrings); ++i)
+ s.syncAsByte(_inventoryStrings[i]);
+}
+
+void Text::syncInventoryUseStrings(Common::Serializer &s) {
+ for (size_t i = 0; i < sizeof(_inventoryUseStrings); ++i)
+ s.syncAsByte(_inventoryUseStrings[i]);
+}
+
+bool Text::getControlBit(int16 txtNr, int16 bitIdx) {
+ return (_hotspotStrings[txtNr * MAX_ATS_STATUS] & bitIdx) != 0;
+}
+
+void Text::setControlBit(int16 txtNr, int16 bitIdx) {
+ _hotspotStrings[txtNr * MAX_ATS_STATUS] |= bitIdx;
+}
+
+void Text::delControlBit(int16 txtNr, int16 bitIdx) {
+ _hotspotStrings[txtNr * MAX_ATS_STATUS] &= ~bitIdx;
+}
+
+/*uint8 Text::getTextStatus(uint8 status, int16 subEntry, int16 strNr) {
+ const int16 hotspotActionStr = (subEntry + 1) % 2;
+ uint8 lo_hi[2];
+ lo_hi[0] = status &= 15;
+ lo_hi[1] = status >> 4;
+ lo_hi[hotspotActionStr] = strNr;
+ status = 0;
+ lo_hi[1] <<= 4;
+ status |= lo_hi[0];
+ status |= lo_hi[1];
+
+ return status;
+}*/
+
+uint8 Text::updateTextStatus(int16 entry, int16 subEntry, int16 strNr, int16 type) {
+ byte *buffer;
+
+ switch (type) {
+ case ATS_DATA:
+ buffer = _hotspotStrings;
+ break;
+ case INV_USE_DATA:
+ buffer = _inventoryUseStrings;
+ break;
+ case INV_ATS_DATA:
+ buffer = _inventoryStrings;
+ break;
+ default:
+ error("setTextId called for type %d", type);
+ }
+
+ const uint8 status = buffer[(entry * MAX_ATS_STATUS) + (subEntry + 1) / 2];
+ if (strNr >= 0) {
+ buffer[(entry * MAX_ATS_STATUS) + (subEntry + 1) / 2] = strNr; // getTextStatus(status, subEntry, strNr);
+ return strNr;
+ }
+
+ return status;
+}
+
+uint8 Text::getTextId(uint entry, uint subEntry, int type) {
+ uint8 status = updateTextStatus(entry, subEntry, -1, type);
+
+ const int16 hotspotActionStr = (subEntry + 1) % 2;
+ uint8 lo_hi[2];
+ lo_hi[0] = status &= 15;
+ lo_hi[1] = status >> 4;
+ return lo_hi[hotspotActionStr];
+}
+
+void Text::setTextId(int16 entry, int16 subEntry, int16 strNr, int16 type) {
+ updateTextStatus(entry, subEntry, strNr, type);
+}
+
} // namespace Chewy
diff --git a/engines/chewy/text.h b/engines/chewy/text.h
index ae8f6363f72..e5b14978222 100644
--- a/engines/chewy/text.h
+++ b/engines/chewy/text.h
@@ -23,7 +23,10 @@
#define CHEWY_TEXT_H
#include "common/list.h"
+#include "common/serializer.h"
+#include "chewy/atds.h"
#include "chewy/chewy.h"
+#include "chewy/defines.h"
#include "chewy/resource.h"
namespace Chewy {
@@ -65,6 +68,8 @@ struct TextEntry {
typedef Common::List<TextEntry> TextEntryList;
+#define ROOM_ATS_MAX 1000
+
class Text : public Resource {
public:
Text();
@@ -93,8 +98,25 @@ public:
const char *strPos(const char *txtAdr, int16 pos);
+ void syncHotspotStrings(Common::Serializer &s);
+ void syncInventoryStrings(Common::Serializer &s);
+ void syncInventoryUseStrings(Common::Serializer &s);
+
+ bool getControlBit(int16 txtNr, int16 bitIdx);
+ void setControlBit(int16 txtNr, int16 bitIdx);
+ void delControlBit(int16 txtNr, int16 bitIdx);
+
+ void setTextId(int16 entry, int16 subEntry, int16 strNr, int16 type);
+
private:
int16 _lastSpeechId = -1;
+ byte _hotspotStrings[ROOM_ATS_MAX * 3] = { 0 };
+ uint8 _inventoryStrings[MAX_MOV_OBJ * 3] = {0};
+ uint8 _inventoryUseStrings[INV_USE_ATS_MAX * 3] = {0};
+
+ //uint8 getTextStatus(uint8 status, int16 subEntry, int16 strNr);
+ uint8 getTextId(uint entry, uint subEntry, int type);
+ uint8 updateTextStatus(int16 entry, int16 subEntry, int16 strNr, int16 type);
};
} // namespace Chewy
diff --git a/engines/chewy/types.cpp b/engines/chewy/types.cpp
index ed1953218c7..35bbb906a51 100644
--- a/engines/chewy/types.cpp
+++ b/engines/chewy/types.cpp
@@ -42,6 +42,7 @@ static void syncArray(Common::Serializer &s, uint8 *arr, size_t count) {
for (size_t i = 0; i < count; ++i)
s.syncAsByte(arr[i]);
}
+
static void syncArray(Common::Serializer &s, int16 *arr, size_t count) {
for (size_t i = 0; i < count; ++i)
s.syncAsSint16LE(arr[i]);
@@ -55,14 +56,15 @@ bool GameState::synchronize(Common::Serializer &s) {
byte dummy = 0;
int16 dummy16 = 0;
+ uint8 InvUseDef[40 * 3] = {0}; // dummy
int inventoryCursor = _G(cur)->getInventoryCursor();
// Sync the structure's bitflags
s.syncBytes((byte *)_flags, SPIELER_FLAGS_SIZE);
- syncArray(s, Ats, ROOM_ATS_MAX * 3);
- syncArray(s, InvAts, MAX_MOV_OBJ * 3);
- syncArray(s, InvUse, INV_USE_ATS_MAX * 3);
+ _G(txt)->syncHotspotStrings(s);
+ _G(txt)->syncInventoryStrings(s);
+ _G(txt)->syncInventoryUseStrings(s);
syncArray(s, InvUseDef, 40 * 3);
s.syncAsSint16LE(MainMenuY);
diff --git a/engines/chewy/types.h b/engines/chewy/types.h
index 81662512ed6..c9be166323d 100644
--- a/engines/chewy/types.h
+++ b/engines/chewy/types.h
@@ -391,10 +391,6 @@ struct GameState : public GameFlags {
bool synchronize(Common::Serializer &s);
GameFlags *_flags = nullptr;
- uint8 Ats[ROOM_ATS_MAX * 3] = { 0 };
- uint8 InvAts[MAX_MOV_OBJ * 3] = { 0 };
- uint8 InvUse[INV_USE_ATS_MAX * 3] = { 0 };
- uint8 InvUseDef[40 * 3] = { 0 };
int16 MainMenuY = 0;
int16 InvDisp = 0;
Commit: cab9e551081f36ef64d392f4cf4f679a4e974f34
https://github.com/scummvm/scummvm/commit/cab9e551081f36ef64d392f4cf4f679a4e974f34
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-03T17:35:33+03:00
Commit Message:
CHEWY: Implement extra music check for the harbor scene - bug #13652
Changed paths:
engines/chewy/sound.cpp
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index 937cb98e260..1cfa1a2de68 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -314,7 +314,7 @@ const RoomMusic roomMusic[] = {
{ 89, 38 }, { 92, 38 }, { 33, 35 }, { 37, 8 }, { 39, 9 },
{ 42, 41 }, { 45, 44 }, { 46, 21 }, { 50, 21 }, { 73, 21 },
{ 74, 21 }, { 48, 22 }, { 49, 3 }, { 51, 27 }, { 52, 27 },
- { 53, 26 }, { 55, 23 }, { 57, 23 }, { 56, 52 }, { 62, 25 },
+ { 53, 26 }, { 55, 23 }, { 57, 23 }, { 56, 7 }, { 62, 25 },
{ 64, 51 }, { 66, 34 }, { 68, 34 }, { 67, 28 }, { 69, 28 },
{ 70, 28 }, { 75, 28 }, { 72, 31 }, { 76, 46 }, { 79, 6 },
{ 80, 29 }, { 81, 45 }, { 82, 50 }, { 84, 24 }, { 85, 32 },
@@ -335,11 +335,9 @@ void Sound::playRoomMusic(int16 roomNum) {
}
}
- // TODO: Extra checks for two flags in room 56
- //if ((spieler.flags32 & SpielerFlags32_10) != 0 && spieler.flags33 >= 0)
- // musicIndex = 52;
- //else
- // musicIndex = 7;
+ // Room 56 music (first vs second visit)
+ if (roomNum == 56 && _G(gameState).flags32_10 && _G(gameState).flags33_80)
+ musicIndex = 52;
if (musicIndex != _curMusic) {
stopMusic();
Commit: 4899c1882fcdc9c9cdf0433ec89d0d37d2c58d89
https://github.com/scummvm/scummvm/commit/4899c1882fcdc9c9cdf0433ec89d0d37d2c58d89
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-07-03T17:35:33+03:00
Commit Message:
CHEWY: Fix for vanishing items - bug #13653
This was introduced after the cursor code refactoring
Changed paths:
engines/chewy/main.cpp
diff --git a/engines/chewy/main.cpp b/engines/chewy/main.cpp
index 629165779c3..b16ef394a17 100644
--- a/engines/chewy/main.cpp
+++ b/engines/chewy/main.cpp
@@ -347,6 +347,8 @@ bool mainLoop(int16 mode) {
_G(cur)->move(_G(maus_old_x), _G(maus_old_y));
g_events->_mousePos.x = _G(maus_old_x);
g_events->_mousePos.y = _G(maus_old_y);
+ if (_G(cur)->usingInventoryCursor())
+ invent_2_slot(_G(cur)->getInventoryCursor());
_G(cur)->setInventoryCursor(-1);
cursorChoice(_G(menu_item));
}
More information about the Scummvm-git-logs
mailing list