Skip to content

Commit

Permalink
- reduced the dependency of the sound system on game state.
Browse files Browse the repository at this point in the history
Many of the simple wrappers have been moved to a separate file and the sound source handling has been abstracted.
This is only the first phase, the work is not complete yet.
Also changed the license of the sound code to BSD after verifying that this code bears no similarity to id's original sound code anymore, save for a few function names (which are due to be refactored out anyway.)
  • Loading branch information
coelckers committed Dec 8, 2019
1 parent 22e692e commit fd181f4
Show file tree
Hide file tree
Showing 9 changed files with 894 additions and 801 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -879,6 +879,7 @@ set (PCH_SOURCES
sound/s_advsound.cpp
sound/s_environment.cpp
sound/s_sndseq.cpp
sound/s_doomsound.cpp
sound/s_sound.cpp
sound/s_music.cpp
serializer.cpp
Expand Down
4 changes: 2 additions & 2 deletions src/playsim/p_acs.cpp
Expand Up @@ -5953,7 +5953,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)

if (args[0] == 0)
{
S_ChangeSoundVolume(activator, chan, volume);
S_ChangeActorSoundVolume(activator, chan, volume);
}
else
{
Expand All @@ -5962,7 +5962,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)

while ((spot = it.Next()) != NULL)
{
S_ChangeSoundVolume(spot, chan, volume);
S_ChangeActorSoundVolume(spot, chan, volume);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/scripting/vmthunks_actors.cpp
Expand Up @@ -142,21 +142,21 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StopSound, NativeStopSound)
return 0;
}

DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_SoundPitch, S_ChangeSoundPitch)
DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_SoundPitch, S_ChangeActorSoundPitch)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(channel);
PARAM_FLOAT(pitch);
S_ChangeSoundPitch(self, channel, pitch);
S_ChangeActorSoundPitch(self, channel, pitch);
return 0;
}

DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_SoundVolume, S_ChangeSoundVolume)
DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_SoundVolume, S_ChangeActorSoundVolume)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(channel);
PARAM_FLOAT(volume);
S_ChangeSoundVolume(self, channel, volume);
S_ChangeActorSoundVolume(self, channel, volume);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions src/sound/backend/i_soundinternal.h
Expand Up @@ -77,6 +77,7 @@ struct SoundListener
bool underwater;
bool valid;
ReverbContainer *Environment;
void* ListenerObject;
};

// Default rolloff information.
Expand Down

0 comments on commit fd181f4

Please sign in to comment.