CHEWY: Implement getStereoPos()

This commit is contained in:
Strangerke 2022-03-23 00:31:22 +01:00
parent dded4e6d71
commit f96b146a20
4 changed files with 5 additions and 15 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);