From 4d28d4eee96048847ebb8660fd21a1e3c50bb818 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sun, 11 Aug 2024 00:25:13 -0400 Subject: [PATCH] minimal hardcode rework port minimum bits needed for soundcode parity --- code/__DEFINES/sounds.dm | 21 +++++++++++++++++++++ code/game/sound.dm | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/sounds.dm b/code/__DEFINES/sounds.dm index 498e68486d..079d5c9258 100644 --- a/code/__DEFINES/sounds.dm +++ b/code/__DEFINES/sounds.dm @@ -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 diff --git a/code/game/sound.dm b/code/game/sound.dm index 486409f097..fcbdd7f283 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -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 @@ -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 @@ -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