[Scummvm-git-logs] scummvm master -> f96b146a20a5d239d2cd01aa697adb777105d253
Strangerke
noreply at scummvm.org
Tue Mar 22 23:32:04 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f96b146a20 CHEWY: Implement getStereoPos()
Commit: f96b146a20a5d239d2cd01aa697adb777105d253
https://github.com/scummvm/scummvm/commit/f96b146a20a5d239d2cd01aa697adb777105d253
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2022-03-23T00:31:38+01:00
Commit Message:
CHEWY: Implement getStereoPos()
Changed paths:
engines/chewy/atds.cpp
engines/chewy/atds.h
engines/chewy/sound.cpp
engines/chewy/sound.h
diff --git a/engines/chewy/atds.cpp b/engines/chewy/atds.cpp
index 10275792cb1..e83b49e8514 100644
--- a/engines/chewy/atds.cpp
+++ b/engines/chewy/atds.cpp
@@ -1317,18 +1317,8 @@ int16 Atdsys::calc_inv_no_use(int16 curInv, int16 testNr, int16 mode) {
return (_itemUseWithDesc.contains(key)) ? _itemUseWithDesc[key] : -1;
}
-int16 Atdsys::getStereoPos(int16 x) {
- // TODO: Convert to ScummVM's balance (-127 ... 0 ... 127)
- return 0;
-#if 0
- float fx_ = (float)x;
-
- fx_ /= 2.5;
- if ((fx_ - ((float)((int16)fx_))) > 0.5)
- fx_ += 1.0;
-
- return (int16)fx_;
-#endif
+int8 Atdsys::getStereoPos(int16 x) {
+ return floor(x / 2.5) * 2 - 127;
}
void Atdsys::saveAtdsStream(Common::WriteStream *stream) {
diff --git a/engines/chewy/atds.h b/engines/chewy/atds.h
index 134aca08ecd..f1261934dde 100644
--- a/engines/chewy/atds.h
+++ b/engines/chewy/atds.h
@@ -300,7 +300,7 @@ public:
void ads_search_item(int16 itemNr, char **blkAdr);
int16 start_ads_auto_dia(char *itemAdr);
int16 calc_inv_no_use(int16 curInv, int16 testNr, int16 mode);
- int16 getStereoPos(int16 x);
+ int8 getStereoPos(int16 x);
void enableEvents(bool nr) {
_atdsv._eventsEnabled = nr;
}
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index c8f64e991c3..b47a4303a7f 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -98,7 +98,7 @@ void Sound::setSoundChannelVolume(uint channel, uint volume) {
_mixer->setChannelVolume(_soundHandle[channel], volume);
}
-void Sound::setSoundChannelBalance(uint channel, uint balance) {
+void Sound::setSoundChannelBalance(uint channel, int8 balance) {
assert(channel < MAX_SOUND_EFFECTS);
_mixer->setChannelBalance(_soundHandle[channel], balance);
}
diff --git a/engines/chewy/sound.h b/engines/chewy/sound.h
index 36976f82088..bafc50329cd 100644
--- a/engines/chewy/sound.h
+++ b/engines/chewy/sound.h
@@ -46,7 +46,7 @@ public:
bool isSoundActive(uint channel);
void setSoundVolume(uint volume);
void setSoundChannelVolume(uint channel, uint volume);
- void setSoundChannelBalance(uint channel, uint balance);
+ void setSoundChannelBalance(uint channel, int8 balance);
void playMusic(int num, bool loop = false);
void playMusic(uint8 *data, uint32 size, bool loop = false, DisposeAfterUse::Flag dispose = DisposeAfterUse::YES);
More information about the Scummvm-git-logs
mailing list