diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 81bbdc7c4a..b8ec9ba285 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ September 9, 2008 (Changes by Graf Zahl) +- Fixed: The new rolloff values being stored in FSoundChan need to be serialized + for savegames. - Since loading of the sound lump is now done in S_LoadSound I added an IsNull method to the SoundRenderer class so that this function doesn't need to load the sound for the NullSoundRenderer. diff --git a/src/s_sound.cpp b/src/s_sound.cpp index db1eae7406..9174b9375b 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -1100,7 +1100,7 @@ void S_RestartSound(FSoundChan *chan) SoundListener listener; S_SetListener(listener, players[consoleplayer].camera); - ochan = GSnd->StartSound3D(sfx->data, &listener, chan->Volume, chan->Rolloff, chan->DistanceScale, chan->Pitch, + ochan = GSnd->StartSound3D(sfx->data, &listener, chan->Volume, &chan->Rolloff, chan->DistanceScale, chan->Pitch, chan->Priority, pos, vel, chan->EntChannel, chan->ChanFlags, chan); } else @@ -1793,16 +1793,19 @@ static FArchive &operator<<(FArchive &arc, FSoundChan &chan) case SOURCE_Unattached: arc << chan.Point[0] << chan.Point[1] << chan.Point[2]; break; default: I_Error("Unknown sound source type %d\n", chan.SourceType); break; } - arc << chan.SoundID; - arc << chan.OrgID; - arc << chan.Volume; - arc << chan.DistanceScale; - arc << chan.Pitch; - arc << chan.ChanFlags; - arc << chan.EntChannel; - arc << chan.Priority; - arc << chan.NearLimit; - arc << chan.StartTime; + arc << chan.SoundID + << chan.OrgID + << chan.Volume + << chan.DistanceScale + << chan.Pitch + << chan.ChanFlags + << chan.EntChannel + << chan.Priority + << chan.NearLimit + << chan.StartTime + << chan.Rolloff.RolloffType + << chan.Rolloff.MinDistance + << chan.Rolloff.MaxDistance; if (arc.IsLoading()) { diff --git a/src/s_sound.h b/src/s_sound.h index 5a93ee87f5..8d6bb7bd5c 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -185,7 +185,7 @@ struct FSoundChan FSoundChan *NextChan; // Next channel in this list. FSoundChan **PrevChan; // Previous channel in this list. sfxinfo_t *SfxInfo; // Sound information. - FRolloffInfo *Rolloff; // Rolloff parameters (do not necessarily come from SfxInfo!) + FRolloffInfo Rolloff; // Rolloff parameters (do not necessarily come from SfxInfo!) QWORD_UNION StartTime; // Sound start time in DSP clocks. FSoundID SoundID; // Sound ID of playing sound. FSoundID OrgID; // Sound ID of sound used to start this channel. diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index 903c3d5d88..3366ae8cfa 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -1463,7 +1463,7 @@ FSoundChan *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener *list HandleChannelDelay(chan, reuse_chan, freq); chan->setPaused(false); FSoundChan *schan = CommonChannelSetup(chan, reuse_chan); - schan->Rolloff = rolloff; + schan->Rolloff = *rolloff; return schan; } @@ -2091,7 +2091,7 @@ float F_CALLBACK FMODSoundRenderer::RolloffCallback(FMOD_CHANNEL *channel, float } else if (chan->getUserData((void **)&schan) == FMOD_OK && schan != NULL) { - rolloff = schan->Rolloff; + rolloff = &schan->Rolloff; distance *= schan->DistanceScale; } else diff --git a/src/version.h b/src/version.h index 91f8928033..b5975207db 100644 --- a/src/version.h +++ b/src/version.h @@ -75,7 +75,7 @@ // SAVESIG should match SAVEVER. // MINSAVEVER is the minimum level snapshot version that can be loaded. -#define MINSAVEVER 1190 +#define MINSAVEVER 1209 #if SVN_REVISION_NUMBER < MINSAVEVER // Never write a savegame with a version lower than what we need