- fixed some initialization problems with sound.

* a position-less sound did not get the listener's position attached.
 * an unattached sound mixed up y and z coordinates.
This commit is contained in:
Christoph Oelckers 2016-04-04 12:46:32 +02:00
parent fadc7d650d
commit 32c32ea739
1 changed files with 3 additions and 1 deletions

View File

@ -665,6 +665,7 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
if (listener != NULL) if (listener != NULL)
{ {
listenpos = listener->Pos(); listenpos = listener->Pos();
*pos = listener->SoundPos();
pgroup = listener->Sector->PortalGroup; pgroup = listener->Sector->PortalGroup;
} }
else else
@ -1276,7 +1277,8 @@ void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume
void S_Sound(const DVector3 &pos, int channel, FSoundID sound_id, float volume, float attenuation) void S_Sound(const DVector3 &pos, int channel, FSoundID sound_id, float volume, float attenuation)
{ {
FVector3 p((float)pos.X, (float)pos.Y, (float)pos.Z); // The sound system switches Y and Z around.
FVector3 p((float)pos.X, (float)pos.Z, (float)pos.Y);
S_StartSound (NULL, NULL, NULL, &p, channel, sound_id, volume, attenuation); S_StartSound (NULL, NULL, NULL, &p, channel, sound_id, volume, attenuation);
} }