Polymost: Make voxels take on the current basepalette, like they should.

git-svn-id: https://svn.eduke32.com/eduke32@5494 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-12-26 15:42:09 +00:00
parent 223e67983d
commit 7f5a8f9a23
4 changed files with 10 additions and 10 deletions

View file

@ -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); int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf);
void mdinit(void); void mdinit(void);
void freeallmodels(void); void freeallmodels(void);
void clearskins(void); void clearskins(int32_t type);
int32_t polymost_mddraw(const tspritetype *tspr); 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]); EXTERN void md3_vox_calcmat_common(const tspritetype *tspr, const vec3f_t *a0, float f, float mat[16]);

View file

@ -181,7 +181,7 @@ static void nullskintexids(GLuint texid)
} }
} }
void clearskins() void clearskins(int32_t type)
{ {
int32_t i, j; int32_t i, j;
@ -200,7 +200,7 @@ void clearskins()
v->texid[j] = 0; 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; mdskinmap_t *sk;
md2model_t *m2 = (md2model_t *)m; md2model_t *m2 = (md2model_t *)m;

View file

@ -197,8 +197,8 @@ void gltexinvalidatetype(int32_t type)
} }
} }
if (type == INVALIDATE_ALL) clearskins(type);
clearskins();
#ifdef DEBUGGINGAIDS #ifdef DEBUGGINGAIDS
OSD_Printf("gltexinvalidateall()\n"); OSD_Printf("gltexinvalidateall()\n");
#endif #endif
@ -316,7 +316,7 @@ void polymost_glreset()
texcache.list[i] = NULL; texcache.list[i] = NULL;
} }
clearskins(); clearskins(INVALIDATE_ALL);
} }
if (polymosttext) if (polymosttext)

View file

@ -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--) 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].b = cptr[curpalette[ii].b];
pic2[i].g = cptr[palette[ii+1]]; pic2[i].g = cptr[curpalette[ii].g];
pic2[i].r = cptr[palette[ii+0]]; pic2[i].r = cptr[curpalette[ii].r];
pic2[i].a = 255; pic2[i].a = 255;
} }
} }