diff --git a/polymer/eduke32/build/include/mdsprite.h b/polymer/eduke32/build/include/mdsprite.h index edb0ba2d7..18991f9cc 100644 --- a/polymer/eduke32/build/include/mdsprite.h +++ b/polymer/eduke32/build/include/mdsprite.h @@ -208,7 +208,7 @@ void updateanimation(md2model_t *m, const tspritetype *tspr, uint8_t lpal); int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf); void mdinit(void); void freeallmodels(void); -void clearskins(void); +void clearskins(int32_t type); int32_t polymost_mddraw(const tspritetype *tspr); EXTERN void md3_vox_calcmat_common(const tspritetype *tspr, const vec3f_t *a0, float f, float mat[16]); diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 212729943..396e3d5b7 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -181,7 +181,7 @@ static void nullskintexids(GLuint texid) } } -void clearskins() +void clearskins(int32_t type) { int32_t i, j; @@ -200,7 +200,7 @@ void clearskins() v->texid[j] = 0; } } - else if (m->mdnum == 2 || m->mdnum == 3) + else if ((m->mdnum == 2 || m->mdnum == 3) && type == INVALIDATE_ALL) { mdskinmap_t *sk; md2model_t *m2 = (md2model_t *)m; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 477060afe..8a96f51a9 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -197,8 +197,8 @@ void gltexinvalidatetype(int32_t type) } } - if (type == INVALIDATE_ALL) - clearskins(); + clearskins(type); + #ifdef DEBUGGINGAIDS OSD_Printf("gltexinvalidateall()\n"); #endif @@ -316,7 +316,7 @@ void polymost_glreset() texcache.list[i] = NULL; } - clearskins(); + clearskins(INVALIDATE_ALL); } if (polymosttext) diff --git a/polymer/eduke32/build/src/voxmodel.c b/polymer/eduke32/build/src/voxmodel.c index 630f2bcb5..a4ee6f3ce 100644 --- a/polymer/eduke32/build/src/voxmodel.c +++ b/polymer/eduke32/build/src/voxmodel.c @@ -61,11 +61,11 @@ uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, i for (int32_t i=xsiz*ysiz-1; i>=0; i--) { - const int32_t ii = palookup[dapal][pic[i].a] * 3; + const int32_t ii = palookup[dapal][pic[i].a]; - pic2[i].b = cptr[palette[ii+2]]; - pic2[i].g = cptr[palette[ii+1]]; - pic2[i].r = cptr[palette[ii+0]]; + pic2[i].b = cptr[curpalette[ii].b]; + pic2[i].g = cptr[curpalette[ii].g]; + pic2[i].r = cptr[curpalette[ii].r]; pic2[i].a = 255; } }