Skip to content

Commit

Permalink
minimal hardcode rework port
Browse files Browse the repository at this point in the history
minimum bits needed for soundcode parity
  • Loading branch information
Doubleumc committed Aug 11, 2024
1 parent fd425da commit 4d28d4e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 21 additions & 0 deletions code/__DEFINES/sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@
#define SOUND_CHANNEL_LOBBY 1023
#define SOUND_CHANNEL_Z 1024

//default byond sound echo list index positions.
//ECHO_DIRECT and ECHO_ROOM are the only two that actually appear to do anything, and represent the dry and wet channels of the environment effects, respectively.
#define ECHO_DIRECT 1
#define ECHO_DIRECTHF 2
#define ECHO_ROOM 3
#define ECHO_ROOMHF 4
#define ECHO_OBSTRUCTION 5
#define ECHO_OBSTRUCTIONLFRATIO 6
#define ECHO_OCCLUSION 7
#define ECHO_OCCLUSIONLFRATIO 8
#define ECHO_OCCLUSIONROOMRATIO 9
#define ECHO_OCCLUSIONDIRECTRATIO 10
#define ECHO_EXCLUSION 11
#define ECHO_EXCLUSIONLFRATIO 12
#define ECHO_OUTSIDEVOLUMEHF 13
#define ECHO_DOPPLERFACTOR 14
#define ECHO_ROLLOFFFACTOR 15
#define ECHO_ROOMROLLOFFFACTOR 16
#define ECHO_AIRABSORPTIONFACTOR 17
#define ECHO_FLAGS 18

//default byond sound environments
#define SOUND_ENVIRONMENT_NONE -1
#define SOUND_ENVIRONMENT_GENERIC 0
Expand Down
6 changes: 3 additions & 3 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
*
* Returns selected channel on success, FALSE on failure
*/
/proc/playsound(atom/source, sound/soundin, vol = 100, vary, sound_range, vol_cat = VOLUME_SFX, channel, status, falloff = 1)
/proc/playsound(atom/source, sound/soundin, vol = 100, vary, sound_range, vol_cat = VOLUME_SFX, channel, status, falloff = 1, list/echo)
if(!get_turf(source))
error("[source] has no turf and is trying to play a spatial sound: [soundin]")
return FALSE
Expand Down Expand Up @@ -188,7 +188,7 @@
return template.channel

//This is the replacement for playsound_local. Use this for sending sounds directly to a client
/proc/playsound_client(client/client, sound/soundin, atom/origin, vol = 100, random_freq, vol_cat = VOLUME_SFX, channel, status)
/proc/playsound_client(client/client, sound/soundin, atom/origin, vol = 100, random_freq, vol_cat = VOLUME_SFX, channel, status, list/echo)
if(!istype(client))
error("[client] is not a client and is trying to play a client sound: [soundin]")
return FALSE
Expand Down Expand Up @@ -247,7 +247,7 @@


/// Play sound for all on-map clients on a list of z-levels. Good for ambient sounds.
/proc/playsound_z(list/z_values, sound/soundin, volume = 100, vol_cat = VOLUME_SFX)
/proc/playsound_z(list/z_values, sound/soundin, volume = 100, vol_cat = VOLUME_SFX, list/echo)
var/datum/sound_template/template = new(soundin)

template.channel = SOUND_CHANNEL_Z
Expand Down

0 comments on commit 4d28d4e

Please sign in to comment.