Some compile fixes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5685 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-04-29 12:25:24 +00:00
parent 6931c565df
commit 97861a59a3
3 changed files with 14 additions and 1 deletions

View File

@ -499,6 +499,10 @@ static qboolean OpenAL_LoadCache(oalinfo_t *oali, unsigned int *bufptr, sfxcache
{
switch(sc->format)
{
#ifdef FTE_TARGET_WEB
case QAF_BLOB:
break; //unreachable
#endif
case QAF_S8:
{
unsigned char *tmp = malloc(size);
@ -540,6 +544,10 @@ static qboolean OpenAL_LoadCache(oalinfo_t *oali, unsigned int *bufptr, sfxcache
{
switch(sc->format)
{
#ifdef FTE_TARGET_WEB
case QAF_BLOB:
break; //unreachable
#endif
case QAF_S8:
{
unsigned char *tmp = malloc(size);

View File

@ -3168,6 +3168,11 @@ float S_GetChannelLevel(int entnum, int entchannel)
spos *= scache->numchannels;
switch(scache->format)
{
#ifdef FTE_TARGET_WEB
case QAF_BLOB:
result = 0; //sorry. you're going to have to use .wav :(
break;
#endif
case QAF_S8:
for (j = 0; j < scache->numchannels; j++) //average the channels
result += abs(((signed char*)scache->data)[spos+j]);

View File

@ -833,7 +833,7 @@ static qboolean QDECL S_LoadBrowserFile (sfx_t *s, qbyte *data, size_t datalen,
s->loopstart = -1;
sc->data = (qbyte*)(sc+1);
sc->length = datalen;
sc->width = 0; //ie: not pcm
sc->format = AF_BLOB; //ie: not pcm
sc->speed = sndspeed;
sc->numchannels = 2;
sc->soundoffset = 0;