mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
TSAGE: Corrections to the sound fading code
This commit is contained in:
+7
-11
@@ -398,15 +398,11 @@ void SoundManager::_sfProcessFading() {
|
||||
--s->_fadeCounter;
|
||||
else {
|
||||
if (s->_volume >= s->_fadeDest) {
|
||||
if ((s->_fadeDest - s->_volume) > s->_fadeSteps)
|
||||
s->_volume += s->_fadeSteps;
|
||||
else
|
||||
s->_volume = s->_fadeDest;
|
||||
s->_volume = ((s->_volume - s->_fadeDest) > s->_fadeSteps) ?
|
||||
s->_volume - s->_fadeSteps : s->_fadeDest;
|
||||
} else {
|
||||
if (s->_fadeDest > s->_fadeSteps)
|
||||
s->_volume -= s->_fadeSteps;
|
||||
else
|
||||
s->_volume = s->_fadeDest;
|
||||
s->_volume = ((s->_fadeDest - s->_volume) > s->_fadeSteps) ?
|
||||
s->_volume + s->_fadeSteps : s->_fadeDest;
|
||||
}
|
||||
|
||||
_sfDoUpdateVolume(s);
|
||||
@@ -1606,7 +1602,7 @@ void Sound::mute(bool flag) {
|
||||
_soundManager->restartSoundServer();
|
||||
}
|
||||
|
||||
void Sound::fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeFlag) {
|
||||
void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag) {
|
||||
_soundManager->suspendSoundServer();
|
||||
|
||||
if (fadeDest > 127)
|
||||
@@ -2346,11 +2342,11 @@ void ASound::unPrime() {
|
||||
_action = NULL;
|
||||
}
|
||||
|
||||
void ASound::fade(int v1, int v2, int v3, int v4, Action *action) {
|
||||
void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, Action *action) {
|
||||
if (action)
|
||||
_action = action;
|
||||
|
||||
_sound.fade(v1, v2, v3, v4);
|
||||
_sound.fade(fadeDest, fadeSteps, fadeTicks, stopAfterFadeFlag);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
bool isMuted() const;
|
||||
void pause(bool flag);
|
||||
void mute(bool flag);
|
||||
void fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeFlag);
|
||||
void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag);
|
||||
void setTimeIndex(uint32 timeIndex);
|
||||
uint32 getTimeIndex() const;
|
||||
int getCueValue() const;
|
||||
@@ -380,9 +380,9 @@ public:
|
||||
bool isMuted() const { return _sound.isMuted(); }
|
||||
void pause(bool flag) { _sound.pause(flag); }
|
||||
void mute(bool flag) { _sound.mute(flag); }
|
||||
void fadeIn() { fade(127, 5, 10, 0, NULL); }
|
||||
void fadeOut(Action *action) { fade(0, 5, 10, 1, action); }
|
||||
void fade(int v1, int v2, int v3, int v4, Action *action);
|
||||
void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, Action *action);
|
||||
void fadeIn() { fade(127, 5, 10, false, NULL); }
|
||||
void fadeOut(Action *action) { fade(0, 5, 10, true, action); }
|
||||
void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); }
|
||||
uint32 getTimeIndex() const { return _sound.getTimeIndex(); }
|
||||
void setPri(int v) { _sound.setPri(v); }
|
||||
|
||||
Reference in New Issue
Block a user