Rename sfx->pitch to sfx->flags

This commit is contained in:
NepDisk 2025-08-12 19:47:50 -04:00
parent 0629a2a160
commit 497fe4bcac
6 changed files with 16 additions and 16 deletions

View file

@ -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"))
{

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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)

View file

@ -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;

View file

@ -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;