From 497fe4bcac587b9dba29aceacfb419150c6f7e4c Mon Sep 17 00:00:00 2001 From: NepDisk Date: Tue, 12 Aug 2025 19:47:50 -0400 Subject: [PATCH] Rename sfx->pitch to sfx->flags --- src/deh_soc.c | 2 +- src/lua_infolib.c | 6 +++--- src/r_skins.c | 2 +- src/s_sound.c | 14 +++++++------- src/sounds.c | 4 ++-- src/sounds.h | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index bf73bbc12..53367985f 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2520,7 +2520,7 @@ void readsound(MYFILE *f, INT32 num) } else if (fastcmp(word, "FLAGS")) { - S_sfx[num].pitch = value; + S_sfx[num].flags = value; } else if (fastcmp(word, "VOLUME")) { diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 7b3d45283..ae171c623 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -1427,7 +1427,7 @@ static int lib_setSfxInfo(lua_State *L) info->priority = (INT32)luaL_checkinteger(L, 3); break; case sfxinfow_flags: - info->pitch = (INT32)luaL_checkinteger(L, 3); + info->flags = (INT32)luaL_checkinteger(L, 3); break; case sfxinfow_volume: info->volume = (INT32)luaL_checkinteger(L, 3); @@ -1470,7 +1470,7 @@ static int sfxinfo_get(lua_State *L) lua_pushinteger(L, sfx->priority); return 1; case sfxinfor_flags: - lua_pushinteger(L, sfx->pitch); + lua_pushinteger(L, sfx->flags); return 1; case sfxinfor_volume: lua_pushinteger(L, sfx->volume); @@ -1517,7 +1517,7 @@ static int sfxinfo_set(lua_State *L) sfx->priority = luaL_checkinteger(L, 1); break; case sfxinfow_flags: - sfx->pitch = luaL_checkinteger(L, 1); + sfx->flags = luaL_checkinteger(L, 1); break; case sfxinfow_volume: sfx->volume = luaL_checkinteger(L, 1); diff --git a/src/r_skins.c b/src/r_skins.c index 71f365283..ac41076bd 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -731,7 +731,7 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value) stoken + stokenadjust)) { skin->soundsid[S_sfx[i].skinsound] = - S_AddSoundFx(value, S_sfx[i].singularity, S_sfx[i].pitch, true); + S_AddSoundFx(value, S_sfx[i].singularity, S_sfx[i].flags, true); found = true; } } diff --git a/src/s_sound.c b/src/s_sound.c index f1fe5762d..20794222e 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -192,7 +192,7 @@ static INT32 S_getChannel(const void *origin, sfxinfo_t *sfxinfo) // Now checks if same sound is being played, rather // than just one sound per mobj - else if (sfxinfo == channels[cnum].sfxinfo && (sfxinfo->pitch & SF_NOMULTIPLESOUND)) + else if (sfxinfo == channels[cnum].sfxinfo && (sfxinfo->flags & SF_NOMULTIPLESOUND)) { return -1; } @@ -203,7 +203,7 @@ static INT32 S_getChannel(const void *origin, sfxinfo_t *sfxinfo) } else if (origin && channels[cnum].origin == origin && channels[cnum].sfxinfo == sfxinfo) { - if (sfxinfo->pitch & SF_NOINTERRUPT) + if (sfxinfo->flags & SF_NOINTERRUPT) return -1; else S_StopChannel(cnum); @@ -211,7 +211,7 @@ static INT32 S_getChannel(const void *origin, sfxinfo_t *sfxinfo) } else if (origin && channels[cnum].origin == origin && channels[cnum].sfxinfo->name != sfxinfo->name - && (channels[cnum].sfxinfo->pitch & SF_TOTALLYSINGLE) && (sfxinfo->pitch & SF_TOTALLYSINGLE)) + && (channels[cnum].sfxinfo->flags & SF_TOTALLYSINGLE) && (sfxinfo->flags & SF_TOTALLYSINGLE)) { S_StopChannel(cnum); break; @@ -1090,7 +1090,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 } } - if (sfxinfo->pitch & SF_OUTSIDESOUND) // Rain special case + if (sfxinfo->flags & SF_OUTSIDESOUND) // Rain special case { fixed_t x, y, yl, yh, xl, xh, newdist; @@ -1126,14 +1126,14 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 } // Ring loss, deaths, etc, should all be heard louder. - if (sfxinfo->pitch & SF_X8AWAYSOUND) + if (sfxinfo->flags & SF_X8AWAYSOUND) approx_dist = FixedDiv(approx_dist,8*FRACUNIT); // Combine 8XAWAYSOUND with 4XAWAYSOUND and get.... 32XAWAYSOUND? - if (sfxinfo->pitch & SF_X4AWAYSOUND) + if (sfxinfo->flags & SF_X4AWAYSOUND) approx_dist = FixedDiv(approx_dist,4*FRACUNIT); - if (sfxinfo->pitch & SF_X2AWAYSOUND) + if (sfxinfo->flags & SF_X2AWAYSOUND) approx_dist = FixedDiv(approx_dist,2*FRACUNIT); if (approx_dist > S_CLIPPING_DIST) diff --git a/src/sounds.c b/src/sounds.c index f4822b9be..816ef6faa 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -82,7 +82,7 @@ void S_InitRuntimeSounds (void) S_sfx[i].name = soundnames[i]; S_sfx[i].singularity = false; S_sfx[i].priority = 0; - S_sfx[i].pitch = 0; + S_sfx[i].flags = 0; S_sfx[i].volume = -1; S_sfx[i].data = NULL; S_sfx[i].length = 0; @@ -119,7 +119,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean strncpy(soundnames[i], name, 6); S_sfx[i].singularity = singular; S_sfx[i].priority = 60; - S_sfx[i].pitch = flags; + S_sfx[i].flags = flags; S_sfx[i].volume = -1; S_sfx[i].lumpnum = LUMPERROR; S_sfx[i].skinsound = -1; diff --git a/src/sounds.h b/src/sounds.h index 6e8462215..3c78d999a 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -57,8 +57,8 @@ struct sfxinfo_t // Sfx priority INT32 priority; - // pitch if a link - INT32 pitch; + // Sfx flags + INT32 flags; // volume if a link INT32 volume;