Rename SOUNDOWNER's (used in sound_t) member .i to .ow for easier grepping.

git-svn-id: https://svn.eduke32.com/eduke32@2442 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-03-10 21:22:44 +00:00
parent a2328cd597
commit 95cbdbd1be
7 changed files with 27 additions and 27 deletions

View file

@ -668,7 +668,7 @@ static void G_ShowCacheLocks(void)
break; break;
Bsprintf(tempbuf, "snd #%d inst %d: voice %d, ow %d", i, j, Bsprintf(tempbuf, "snd #%d inst %d: voice %d, ow %d", i, j,
g_sounds[i].SoundOwner[j].voice, g_sounds[i].SoundOwner[j].i); g_sounds[i].SoundOwner[j].voice, g_sounds[i].SoundOwner[j].ow);
printext256(240,k,31,-1,tempbuf,0); printext256(240,k,31,-1,tempbuf,0);
k += 9; k += 9;

View file

@ -1095,7 +1095,7 @@ skip_check:
continue; continue;
} }
VM_CONDITIONAL(S_CheckSoundPlaying(vm.g_i,*insptr)); VM_CONDITIONAL(S_CheckSoundPlaying(vm.g_i,*insptr));
// VM_DoConditional(SoundOwner[*insptr][0].i == vm.g_i); // VM_DoConditional(SoundOwner[*insptr][0].ow == vm.g_i);
continue; continue;
case CON_STOPSOUND: case CON_STOPSOUND:
@ -4869,7 +4869,7 @@ nullquote:
for (; k<MAXSOUNDINSTANCES; k++) for (; k<MAXSOUNDINSTANCES; k++)
{ {
if (g_sounds[j].SoundOwner[k].i == vm.g_i) if (g_sounds[j].SoundOwner[k].ow == vm.g_i)
break; break;
} }

View file

@ -2988,7 +2988,7 @@ dodefault:
{ {
int32_t j = MAXSOUNDS-1; int32_t j = MAXSOUNDS-1;
for (; j>=0; j--) for (; j>=0; j--)
if (g_sounds[j].SoundOwner[0].i == vm.g_i) if (g_sounds[j].SoundOwner[0].ow == vm.g_i)
break; break;
VM_DoConditional(j < 0); VM_DoConditional(j < 0);

View file

@ -76,7 +76,7 @@ void S_SoundStartup(void)
{ {
g_sounds[i].num = 0; g_sounds[i].num = 0;
g_sounds[i].SoundOwner[j].voice = 0; g_sounds[i].SoundOwner[j].voice = 0;
g_sounds[i].SoundOwner[j].i = -1; g_sounds[i].SoundOwner[j].ow = -1;
} }
g_soundlocks[i] = 199; g_soundlocks[i] = 199;
@ -326,7 +326,7 @@ void S_Cleanup(void)
num = (num - j) / MAXSOUNDINSTANCES; num = (num - j) / MAXSOUNDINSTANCES;
i = g_sounds[num].SoundOwner[j].i; i = g_sounds[num].SoundOwner[j].ow;
if (g_sounds[num].num > MAXSOUNDINSTANCES) if (g_sounds[num].num > MAXSOUNDINSTANCES)
OSD_Printf(OSD_ERROR "S_Cleanup(): num exceeds MAXSOUNDINSTANCES! g_sounds[%d].num %d wtf?\n", num, g_sounds[num].num); OSD_Printf(OSD_ERROR "S_Cleanup(): num exceeds MAXSOUNDINSTANCES! g_sounds[%d].num %d wtf?\n", num, g_sounds[num].num);
@ -338,7 +338,7 @@ void S_Cleanup(void)
if (i != -1 && sprite[i].picnum == MUSICANDSFX && sector[sprite[i].sectnum].lotag < 3 && sprite[i].lotag < 999) if (i != -1 && sprite[i].picnum == MUSICANDSFX && sector[sprite[i].sectnum].lotag < 3 && sprite[i].lotag < 999)
actor[i].t_data[0] = 0; actor[i].t_data[0] = 0;
g_sounds[num].SoundOwner[j].i = -1; g_sounds[num].SoundOwner[j].ow = -1;
g_sounds[num].SoundOwner[j].voice = 0; g_sounds[num].SoundOwner[j].voice = 0;
} }
g_soundlocks[num]--; g_soundlocks[num]--;
@ -409,7 +409,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
return -1; return -1;
} }
g_sounds[num].SoundOwner[j].i = i; g_sounds[num].SoundOwner[j].ow = i;
return voice; return voice;
} }
@ -535,7 +535,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
} }
g_sounds[num].num++; g_sounds[num].num++;
g_sounds[num].SoundOwner[j].i = i; g_sounds[num].SoundOwner[j].ow = i;
g_sounds[num].SoundOwner[j].voice = voice; g_sounds[num].SoundOwner[j].voice = voice;
return voice; return voice;
} }
@ -613,7 +613,7 @@ int32_t S_PlaySound(int32_t num)
} }
g_sounds[num].num++; g_sounds[num].num++;
g_sounds[num].SoundOwner[j].i = -1; g_sounds[num].SoundOwner[j].ow = -1;
g_sounds[num].SoundOwner[j].voice = voice; g_sounds[num].SoundOwner[j].voice = voice;
return voice; return voice;
} }
@ -637,14 +637,14 @@ void S_StopEnvSound(int32_t num, int32_t i)
{ {
initprintf(OSD_ERROR "S_StopEnvSound(): too many iterations! The following IDs are still active for sound %d:\n", num); initprintf(OSD_ERROR "S_StopEnvSound(): too many iterations! The following IDs are still active for sound %d:\n", num);
for (j=MAXSOUNDINSTANCES-1; j>=0; j--) for (j=MAXSOUNDINSTANCES-1; j>=0; j--)
if (g_sounds[num].SoundOwner[j].i == i) if (g_sounds[num].SoundOwner[j].ow == i)
initprintf(OSD_ERROR "slot %d, voice %d, sprite %d\n", j, g_sounds[num].SoundOwner[j].voice, g_sounds[num].SoundOwner[j].i); initprintf(OSD_ERROR "slot %d, voice %d, sprite %d\n", j, g_sounds[num].SoundOwner[j].voice, g_sounds[num].SoundOwner[j].ow);
return; return;
} }
for (j=MAXSOUNDINSTANCES-1; j>=0; j--) for (j=MAXSOUNDINSTANCES-1; j>=0; j--)
{ {
if ((i == -1 && g_sounds[num].SoundOwner[j].voice > FX_Ok) || (i != -1 && g_sounds[num].SoundOwner[j].i == i)) if ((i == -1 && g_sounds[num].SoundOwner[j].voice > FX_Ok) || (i != -1 && g_sounds[num].SoundOwner[j].ow == i))
{ {
if (i >= 0 && g_sounds[num].SoundOwner[j].voice <= FX_Ok) if (i >= 0 && g_sounds[num].SoundOwner[j].voice <= FX_Ok)
initprintf(OSD_ERROR "S_StopEnvSound(): bad voice %d for sound ID %d index %d!\n", g_sounds[num].SoundOwner[j].voice, num, j); initprintf(OSD_ERROR "S_StopEnvSound(): bad voice %d for sound ID %d index %d!\n", g_sounds[num].SoundOwner[j].voice, num, j);
@ -677,7 +677,7 @@ void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset)
{ {
int32_t voice = g_sounds[num].SoundOwner[j].voice; int32_t voice = g_sounds[num].SoundOwner[j].voice;
if ((i == -1 && voice > FX_Ok) || (i != -1 && g_sounds[num].SoundOwner[j].i == i)) if ((i == -1 && voice > FX_Ok) || (i != -1 && g_sounds[num].SoundOwner[j].ow == i))
{ {
if (i >= 0 && voice <= FX_Ok) if (i >= 0 && voice <= FX_Ok)
initprintf(OSD_ERROR "S_ChangeSoundPitch(): bad voice %d for sound ID %d index %d!\n", voice, num, j); initprintf(OSD_ERROR "S_ChangeSoundPitch(): bad voice %d for sound ID %d index %d!\n", voice, num, j);
@ -719,7 +719,7 @@ void S_Update(void)
{ {
for (k=MAXSOUNDINSTANCES-1; k>=0; k--) for (k=MAXSOUNDINSTANCES-1; k>=0; k--)
{ {
i = g_sounds[j].SoundOwner[k].i; i = g_sounds[j].SoundOwner[k].ow;
if ((unsigned)i >= MAXSPRITES || g_sounds[j].num == 0 || g_sounds[j].SoundOwner[k].voice <= FX_Ok) if ((unsigned)i >= MAXSPRITES || g_sounds[j].num == 0 || g_sounds[j].SoundOwner[k].voice <= FX_Ok)
continue; continue;
@ -728,7 +728,7 @@ void S_Update(void)
{ {
/* /*
OSD_Printf("S_Update(): stale voice %d from sound %d position %d sprite %d\n", OSD_Printf("S_Update(): stale voice %d from sound %d position %d sprite %d\n",
g_sounds[j].SoundOwner[k].voice, j, k, g_sounds[j].SoundOwner[k].i); g_sounds[j].SoundOwner[k].voice, j, k, g_sounds[j].SoundOwner[k].ow);
*/ */
continue; continue;
} }
@ -808,7 +808,7 @@ int32_t A_CheckSoundPlaying(int32_t i, int32_t num)
int32_t j=MAXSOUNDINSTANCES-1; int32_t j=MAXSOUNDINSTANCES-1;
for (; j>=0; j--) for (; j>=0; j--)
if (g_sounds[num].SoundOwner[j].i == i) if (g_sounds[num].SoundOwner[j].ow == i)
return 1; return 1;
} }

View file

@ -51,7 +51,7 @@ int32_t EnumAudioDevs(struct audioenumdrv **wave, struct audioenumdev **midi, st
typedef struct typedef struct
{ {
int16_t voice; int16_t voice;
int16_t i; int16_t ow;
} SOUNDOWNER; } SOUNDOWNER;

View file

@ -232,7 +232,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
if (g_sounds[num].num > 0 && PN != MUSICANDSFX) if (g_sounds[num].num > 0 && PN != MUSICANDSFX)
{ {
if (g_sounds[num].SoundOwner[0].i == i) S_StopSound(num); if (g_sounds[num].SoundOwner[0].ow == i) S_StopSound(num);
else if (g_sounds[num].num > 1) S_StopSound(num); else if (g_sounds[num].num > 1) S_StopSound(num);
// else if (A_CheckEnemySprite(&sprite[i]) && sprite[i].extra <= 0) S_StopSound(num); // else if (A_CheckEnemySprite(&sprite[i]) && sprite[i].extra <= 0) S_StopSound(num);
} }
@ -270,7 +270,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
if (voice >= FX_Ok) if (voice >= FX_Ok)
{ {
g_sounds[num].SoundOwner[g_sounds[num].num].i = i; g_sounds[num].SoundOwner[g_sounds[num].num].ow = i;
g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice; g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice;
g_sounds[num].num++; g_sounds[num].num++;
} }
@ -329,7 +329,7 @@ void S_PlaySound(int32_t num)
if (voice >= FX_Ok) if (voice >= FX_Ok)
{ {
g_sounds[num].SoundOwner[g_sounds[num].num].i = -1; g_sounds[num].SoundOwner[g_sounds[num].num].ow = -1;
g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice; g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice;
g_sounds[num].num++; g_sounds[num].num++;
return; return;
@ -368,7 +368,7 @@ void S_StopEnvSound(int32_t num,int32_t i)
{ {
k = g_sounds[num].num; k = g_sounds[num].num;
for (j=0; j<k; j++) for (j=0; j<k; j++)
if (g_sounds[num].SoundOwner[j].i == i) if (g_sounds[num].SoundOwner[j].ow == i)
{ {
FX_StopSound(g_sounds[num].SoundOwner[j].voice); FX_StopSound(g_sounds[num].SoundOwner[j].voice);
break; break;
@ -392,7 +392,7 @@ void S_Update(void)
for (j=0; j<MAXSOUNDS; j++) for (j=0; j<MAXSOUNDS; j++)
for (k=0; k<g_sounds[j].num; k++) for (k=0; k<g_sounds[j].num; k++)
{ {
i = g_sounds[j].SoundOwner[k].i; i = g_sounds[j].SoundOwner[k].ow;
sx = sprite[i].x; sx = sprite[i].x;
sy = sprite[i].y; sy = sprite[i].y;
@ -450,7 +450,7 @@ void S_Callback(uint32_t num)
if ((g_sounds[num].m&16) == 0) if ((g_sounds[num].m&16) == 0)
for (j=0; j<k; j++) for (j=0; j<k; j++)
{ {
i = g_sounds[num].SoundOwner[j].i; i = g_sounds[num].SoundOwner[j].ow;
if (i < 0) if (i < 0)
continue; continue;
@ -461,14 +461,14 @@ void S_Callback(uint32_t num)
if (j < k-1) if (j < k-1)
{ {
g_sounds[num].SoundOwner[j].voice = g_sounds[num].SoundOwner[k-1].voice; g_sounds[num].SoundOwner[j].voice = g_sounds[num].SoundOwner[k-1].voice;
g_sounds[num].SoundOwner[j].i = g_sounds[num].SoundOwner[k-1].i; g_sounds[num].SoundOwner[j].ow = g_sounds[num].SoundOwner[k-1].ow;
} }
break; break;
} }
} }
g_sounds[num].num--; g_sounds[num].num--;
g_sounds[num].SoundOwner[k-1].i = -1; g_sounds[num].SoundOwner[k-1].ow = -1;
} }
g_sounds[num].lock--; g_sounds[num].lock--;

View file

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/// vvv sound structs from duke3d.h /// vvv sound structs from duke3d.h
typedef struct { typedef struct {
int32_t voice; int32_t voice;
int32_t i; int32_t ow;
} SOUNDOWNER; } SOUNDOWNER;
typedef struct { typedef struct {