diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index a4df9ef62..89f5870b7 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -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); diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index aaa91308a..855be9002 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -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]; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index e4e011392..1cbd10d02 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -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; diff --git a/polymer/eduke32/source/jmact/animlib.c b/polymer/eduke32/source/jmact/animlib.c index fffa742d6..7f03d4a1e 100644 --- a/polymer/eduke32/source/jmact/animlib.c +++ b/polymer/eduke32/source/jmact/animlib.c @@ -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);