mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
SW: Fix allocache parameters.
git-svn-id: https://svn.eduke32.com/eduke32@6044 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a6dbb7987c
commit
91e6c10a59
3 changed files with 9 additions and 9 deletions
|
@ -244,7 +244,7 @@ unsigned char *LoadAnm(short anim_num)
|
||||||
return NULL;
|
return NULL;
|
||||||
length = kfilelength(handle);
|
length = kfilelength(handle);
|
||||||
|
|
||||||
allocache((void **) &anm_ptr[anim_num], length + sizeof(anim_t), &walock[ANIM_TILE(ANIMnum)]);
|
allocache((intptr_t *) &anm_ptr[anim_num], length + sizeof(anim_t), &walock[ANIM_TILE(ANIMnum)]);
|
||||||
animbuf = (unsigned char *)((intptr_t)anm_ptr[anim_num] + sizeof(anim_t));
|
animbuf = (unsigned char *)((intptr_t)anm_ptr[anim_num] + sizeof(anim_t));
|
||||||
|
|
||||||
kread(handle, animbuf, length);
|
kread(handle, animbuf, length);
|
||||||
|
|
|
@ -43,14 +43,14 @@ void *ReAllocMem(void *ptr, int size);
|
||||||
void FreeMem(void *ptr);
|
void FreeMem(void *ptr);
|
||||||
|
|
||||||
extern char ds[];
|
extern char ds[];
|
||||||
unsigned char lumplockbyte[11];
|
char lumplockbyte[11];
|
||||||
|
|
||||||
//=============
|
//=============
|
||||||
// STATICS
|
// STATICS
|
||||||
//=============
|
//=============
|
||||||
|
|
||||||
static int32_t numlumps = 0;
|
static int32_t numlumps = 0;
|
||||||
static void **lumpcache = NULL;
|
static intptr_t *lumpcache = NULL;
|
||||||
static lumpinfo_t *lumpinfo = NULL; // location of each lump on disk
|
static lumpinfo_t *lumpinfo = NULL; // location of each lump on disk
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -269,7 +269,7 @@ char *RTS_GetSoundName(int32_t i)
|
||||||
=
|
=
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void RTS_ReadLump(int32_t lump, void *dest)
|
void RTS_ReadLump(int32_t lump, intptr_t dest)
|
||||||
{
|
{
|
||||||
lumpinfo_t *l;
|
lumpinfo_t *l;
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ void RTS_ReadLump(int32_t lump, void *dest)
|
||||||
buildprintf("RTS_ReadLump: %i < 0",lump);
|
buildprintf("RTS_ReadLump: %i < 0",lump);
|
||||||
l = lumpinfo+lump;
|
l = lumpinfo+lump;
|
||||||
klseek(l->handle, l->position, SEEK_SET);
|
klseek(l->handle, l->position, SEEK_SET);
|
||||||
kread(l->handle,dest,l->size);
|
kread(l->handle,(void *)dest,l->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -299,7 +299,7 @@ void *RTS_GetSound(int32_t lump)
|
||||||
if ((uint16_t)lump >= (uint16_t)numlumps)
|
if ((uint16_t)lump >= (uint16_t)numlumps)
|
||||||
buildprintf("RTS_GetSound: %i >= %i\n",lump,numlumps);
|
buildprintf("RTS_GetSound: %i >= %i\n",lump,numlumps);
|
||||||
|
|
||||||
if (lumpcache[lump] == NULL)
|
if (lumpcache[lump] == (intptr_t)NULL)
|
||||||
{
|
{
|
||||||
lumplockbyte[lump] = CACHE_LOCK_START;
|
lumplockbyte[lump] = CACHE_LOCK_START;
|
||||||
allocache(&lumpcache[lump],(int)RTS_SoundLength(lump-1),&lumplockbyte[lump]);
|
allocache(&lumpcache[lump],(int)RTS_SoundLength(lump-1),&lumplockbyte[lump]);
|
||||||
|
@ -312,7 +312,7 @@ void *RTS_GetSound(int32_t lump)
|
||||||
else
|
else
|
||||||
lumplockbyte[lump]++;
|
lumplockbyte[lump]++;
|
||||||
}
|
}
|
||||||
return lumpcache[lump];
|
return (void *)lumpcache[lump];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
|
@ -337,6 +337,6 @@ void *RTS_GetSound(int32_t lump)
|
||||||
lumpcache[lump] = Xmalloc(RTS_SoundLength(lump-1));
|
lumpcache[lump] = Xmalloc(RTS_SoundLength(lump-1));
|
||||||
RTS_ReadLump(lump, lumpcache[lump]);
|
RTS_ReadLump(lump, lumpcache[lump]);
|
||||||
}
|
}
|
||||||
return lumpcache[lump];
|
return (void *)lumpcache[lump];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -382,7 +382,7 @@ void main()
|
||||||
{
|
{
|
||||||
uint8_t *ptr;
|
uint8_t *ptr;
|
||||||
KB_ClearKeyDown(sc_F1+i);
|
KB_ClearKeyDown(sc_F1+i);
|
||||||
ptr = RTS_GetSound(i);
|
ptr = (uint8_t *)RTS_GetSound(i);
|
||||||
FX_PlayVOC(ptr, 0, 255, 255, 255, 255, 0);
|
FX_PlayVOC(ptr, 0, 255, 255, 255, 255, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue