Skip to content

Duke3D: Replace the SF_ONEINST_INTERNAL sound flag, allowing multiple looping sounds of the same type to play simultaneously

Dino Bollinger requested to merge dibollinger/eduke32:no_oneinst_flag into master

This flag is set for all sounds that were declared with the SF_LOOP flag, and it prevents multiple SF_LOOP sounds of the same type from playing at the same time.

It appears that this was needed for effects such as SE 0, which runs A_CallSound() at the end of the sector movement. Because of the flag, this call is aborted, as the original moving sound is already playing. If this wasn't the case, it would continuously play a sound after activation.

The game now instead checks if a looping sound is emitted from an effector or activator sprite, and aborts the call if it is already playing. This achieves the same effect without preventing the same ambient sound from overlapping with itself in other situations.

This MR also improves sound handling in Mapster32, see the second commit.

Merge request reports