- Changed listener structure to directly contain the sound environment instead

of getting it from the zone in the low level code.


SVN r1201 (trunk)
This commit is contained in:
Christoph Oelckers 2008-09-06 13:00:23 +00:00
parent bcbd2162b7
commit 87f0ba0bd2
4 changed files with 8 additions and 6 deletions

View file

@ -1,4 +1,6 @@
September 6, 2008 (Changes by Graf Zahl) September 6, 2008 (Changes by Graf Zahl)
- Changed listener structure to directly contain the sound environment instead
of getting it from the zone in the low level code.
- Changed sound interface so that all references to game data like actors - Changed sound interface so that all references to game data like actors
and sectors are done in s_sound.cpp and not in fmodsound.cpp. Also removed and sectors are done in s_sound.cpp and not in fmodsound.cpp. Also removed
several 'sector' parameters because they were never used inside the sound code. several 'sector' parameters because they were never used inside the sound code.

View file

@ -1641,7 +1641,8 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor)
listener.position.Y = FIXED2FLOAT(listenactor->y); listener.position.Y = FIXED2FLOAT(listenactor->y);
listener.position.Z = FIXED2FLOAT(listenactor->z); listener.position.Z = FIXED2FLOAT(listenactor->z);
listener.underwater = listenactor->waterlevel == 3; listener.underwater = listenactor->waterlevel == 3;
listener.ZoneNumber = listenactor->Sector->ZoneNumber; assert(zones != NULL);
listener.Environment = zones[listenactor->Sector->ZoneNumber].Environment;
listener.valid = true; listener.valid = true;
} }
else else
@ -1649,8 +1650,8 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor)
listener.angle = 0; listener.angle = 0;
listener.position.Zero(); listener.position.Zero();
listener.velocity.Zero(); listener.velocity.Zero();
listener.underwater=false; listener.underwater = false;
listener.ZoneNumber=0; listener.Environment = NULL;
listener.valid = false; listener.valid = false;
} }
} }

View file

@ -1791,8 +1791,7 @@ void FMODSoundRenderer::UpdateListener(SoundListener *listener)
else else
{ {
underwater = (listener->underwater && snd_waterlp); underwater = (listener->underwater && snd_waterlp);
assert (zones != NULL); env = listener->Environment;
env = zones[listener->ZoneNumber].Environment;
if (env == NULL) if (env == NULL)
{ {
env = DefaultEnvironments[0]; env = DefaultEnvironments[0];

View file

@ -51,7 +51,7 @@ struct SoundListener
float angle; float angle;
bool underwater; bool underwater;
bool valid; bool valid;
int ZoneNumber; ReverbContainer *Environment;
}; };
class SoundStream class SoundStream