Bug #226
Sector soundorg z level is always 0
Description
When an elevator moves up from height 0, the sound
stays at the bottom. When an elevator goes down from
height 0, the sound stays at the top. A door is opened
at height 1024, the sound is very silent, because the
sound is at height 0.
I found a way to fix this in a dll. This works for
jDoom and jHeretic in the way it is.
Into the "void S_SectorSound(sector_t *sec, int id)" I
added this:"if(sec->soundorg.z != sec->floorheight +
((sec->ceilingheight - sec->floorheight) / 2))
sec->soundorg.z = sec->floorheight +
((sec->ceilingheight - sec->floorheight) / 2);" just
below this line:"mobj_t *origin = (mobj_t *)
&sec->soundorg;"
That way the soundorg z gets updated everytime a sound
is played in a sector, if the soundorg z is not on the
correct level.
Labels: Sound (DS8)
History
#1 Updated by danij almost 19 years ago
Logged In: YES
user_id=849456
I'm not too keen on moving the ONLY sound origin in a
sector. Remember that it is used to play ALL sector based
sounds so doing so would create somewhat strange results
sometimes.
I think a better solution would be:
Engine-side:
Have three degenmobj_ts per sector, floor, ceiling and one
that is ALWAYS at the mid height between the two.
The floor/ceiling degenmobj_ts would always be moved with
their respective plane.
Game-side:
We simply select the appropriate origin for the sound when
calling S_StartSound() via DMU.
#2 Updated by skyjake almost 19 years ago
Logged In: YES
user_id=717323
Sounds good to me (pun intended :-)).
#3 Updated by danij almost 19 years ago
Logged In: YES
user_id=849456
I've now implemented this in CVS for 1.9.0 as agreed.