git-svn-id: https://svn.eduke32.com/eduke32@1615 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2010-03-14 11:42:13 +00:00
parent 150678ce7b
commit 3515f603af
4 changed files with 12 additions and 22 deletions

View file

@ -203,8 +203,7 @@ void endanimvol43(int32_t fr)
void G_PlayAnim(const char *fn,char t)
{
char *animbuf;
uint8_t *palptr;
int32_t i, j, length=0, numframes=0;
int32_t i, length=0, numframes=0;
#if defined(POLYMOST) && defined(USE_OPENGL)
int32_t ogltexfiltermode=gltexfiltermode;
#endif
@ -239,14 +238,7 @@ void G_PlayAnim(const char *fn,char t)
ANIM_LoadAnim(animbuf);
numframes = ANIM_NumFrames();
palptr = ANIM_GetPalette();
for (i=0; i<256; i++)
{
j = i*3;
animpal[j+0] = (palptr[j+0]>>2);
animpal[j+1] = (palptr[j+1]>>2);
animpal[j+2] = (palptr[j+2]>>2);
}
animpal = ANIM_GetPalette();
//setpalette(0L,256L,tempbuf);
//setbrightness(ud.brightness>>2,tempbuf,2);

View file

@ -648,7 +648,7 @@ extern int32_t g_restorePalette;
extern int32_t cachecount;
extern char boardfilename[BMAX_PATH];
extern uint8_t waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],animpal[768];
extern uint8_t waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],*animpal;
extern char currentboardfilename[BMAX_PATH];
extern char cachedebug,g_earthquakeTime;
extern char lumplockbyte[11];

View file

@ -108,7 +108,7 @@ char boardfilename[BMAX_PATH] = {0}, currentboardfilename[BMAX_PATH] = {0};
static char g_rootDir[BMAX_PATH];
char g_modDir[BMAX_PATH] = "/";
uint8_t waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768], animpal[768];
uint8_t waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768], *animpal;
static char firstdemofile[80] = { '\0' };
static int32_t g_skipDefaultCons = 0;

View file

@ -246,7 +246,6 @@ void drawframe(uint16_t framenumber)
void ANIM_LoadAnim(char * buffer)
{
uint16_t i;
int32_t size;
if (!Anim_Started)
{
@ -257,8 +256,7 @@ void ANIM_LoadAnim(char * buffer)
anim->buffer = (uint8_t *)buffer;
anim->curlpnum = 0xffff;
anim->currentframe = -1;
size = sizeof(lpfileheader);
Bmemcpy(&anim->lpheader, buffer, size);
Bmemcpy(&anim->lpheader, buffer, sizeof(lpfileheader));
anim->lpheader.id = B_LITTLE32(anim->lpheader.id);
anim->lpheader.maxLps = B_LITTLE16(anim->lpheader.maxLps);
@ -272,20 +270,20 @@ void ANIM_LoadAnim(char * buffer)
anim->lpheader.nFrames = B_LITTLE32(anim->lpheader.nFrames);
anim->lpheader.framesPerSecond = B_LITTLE16(anim->lpheader.framesPerSecond);
buffer += size+128;
buffer += sizeof(lpfileheader)+128;
// load the color palette
for (i = 0; i < 768; i += 3)
{
anim->pal[i+2] = *buffer++;
anim->pal[i+1] = *buffer++;
anim->pal[i] = *buffer++;
anim->pal[i+2] = (*buffer++)>>2;
anim->pal[i+1] = (*buffer++)>>2;
anim->pal[i] = (*buffer++)>>2;
buffer++;
}
// read in large page descriptors
size = sizeof(anim->LpArray);
Bmemcpy(&anim->LpArray,buffer,size);
Bmemcpy(&anim->LpArray, buffer,sizeof(anim->LpArray));
for (i = 0; i < size/sizeof(lp_descriptor); i++)
for (i = 0; i < sizeof(anim->LpArray)/sizeof(lp_descriptor); i++)
{
anim->LpArray[i].baseRecord = B_LITTLE16(anim->LpArray[i].baseRecord);
anim->LpArray[i].nRecords = B_LITTLE16(anim->LpArray[i].nRecords);