- Fixed: The new rolloff values being stored in FSoundChan need to be serialized

for savegames.


SVN r1209 (trunk)
This commit is contained in:
Christoph Oelckers 2008-09-09 21:23:09 +00:00
parent e033cbf9f8
commit d02097976e
5 changed files with 20 additions and 15 deletions

View File

@ -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.

View File

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

View File

@ -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.

View File

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

View File

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