Move implementation details of Mapster32's sound system from m32exec.c into sounds_mapster32.c, and set up a sound system stub in KenBuild Editor.

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4563 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-07-28 06:45:18 +00:00
parent 61b956cd41
commit cf4473c4d7
4 changed files with 39 additions and 12 deletions

View file

@ -2943,7 +2943,7 @@ dodefault:
insptr++;
{
int32_t j=Gv_GetVarX(*insptr);
if (j<0 || j>=MAXSOUNDS)
if (S_InvalidSound(j))
{
M32_ERROR("Invalid sound %d", j);
insptr++;
@ -2954,14 +2954,7 @@ dodefault:
continue;
case CON_IFNOSOUNDS:
{
int32_t j = MAXSOUNDS-1;
for (; j>=0; j--)
if (g_sounds[j].SoundOwner[0].ow == vm.g_i)
break;
VM_DoConditional(j < 0);
}
VM_DoConditional(S_SoundsPlaying(vm.g_i) < 0);
continue;
case CON_IFIN3DMODE:
@ -2986,14 +2979,14 @@ dodefault:
insptr++;
{
int32_t j=Gv_GetVarX(*insptr++), var=*insptr++;
if (j<0 || j>=MAXSOUNDS)
if (S_InvalidSound(j))
{
M32_ERROR("Invalid sound %d", j);
insptr++;
continue;
}
Gv_SetVarX(var, g_sounds[j].m);
Gv_SetVarX(var, S_SoundFlags(j));
}
continue;
@ -3005,7 +2998,7 @@ dodefault:
{
int32_t j=Gv_GetVarX(*insptr++);
if (j<0 || j>=MAXSOUNDS)
if (S_InvalidSound(j))
{
M32_ERROR("Invalid sound %d", j);
continue;

View file

@ -505,3 +505,23 @@ int32_t S_CheckSoundPlaying(int32_t i, int32_t num)
}
return(g_sounds[num].num);
}
int32_t S_SoundsPlaying(int32_t i)
{
int32_t j = MAXSOUNDS-1;
for (; j>=0; j--)
if (g_sounds[j].SoundOwner[0].ow == i)
break;
return j;
}
int32_t S_InvalidSound(int32_t num)
{
return (unsigned) num >= MAXSOUNDS;
}
int32_t S_SoundFlags(int32_t num)
{
return g_sounds[num].m;
}

View file

@ -61,6 +61,9 @@ void S_Update(void);
int32_t A_CheckSoundPlaying(int32_t i, int32_t num);
int32_t S_CheckSoundPlaying(int32_t i, int32_t num);
void S_ClearSoundLocks(void);
int32_t S_SoundsPlaying(int32_t i);
int32_t S_InvalidSound(int32_t num);
int32_t S_SoundFlags(int32_t num);
#pragma pack(pop)

View file

@ -642,6 +642,17 @@ int32_t taglab_getnextfreetag(int32_t *duetoptr)
return 0;
}
int32_t S_InvalidSound(int32_t num) { UNREFERENCED_PARAMETER(num); return 1; };
int32_t S_CheckSoundPlaying(int32_t i, int32_t num) { UNREFERENCED_PARAMETER(i); UNREFERENCED_PARAMETER(num); return 0; };
int32_t S_SoundsPlaying(int32_t i) { UNREFERENCED_PARAMETER(i); return -1; }
int32_t S_SoundFlags(int32_t num) { UNREFERENCED_PARAMETER(num); return 0; };
int32_t A_PlaySound(uint32_t num, int32_t i) { UNREFERENCED_PARAMETER(num); UNREFERENCED_PARAMETER(i); return 0; };
void S_StopSound(int32_t num) { UNREFERENCED_PARAMETER(num); };
#ifdef __cplusplus
extern "C"
#endif
int32_t FX_StopAllSounds(void) { return 0; };
//Just thought you might want my getnumber16 code
/*
getnumber16(char namestart[80], short num, int maxnumber)