diff --git a/polymer/eduke32/build/include/mdsprite.h b/polymer/eduke32/build/include/mdsprite.h index 0a80df549..1e2735914 100644 --- a/polymer/eduke32/build/include/mdsprite.h +++ b/polymer/eduke32/build/include/mdsprite.h @@ -204,7 +204,7 @@ typedef struct EXTERN mdmodel_t **models; -void updateanimation(md2model_t *m, const spritetype *tspr); +void updateanimation(md2model_t *m, const spritetype *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); diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index a2e69a116..e46097a98 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -919,12 +919,11 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) } //Note: even though it says md2model, it works for both md2model&md3model -void updateanimation(md2model_t *m, const spritetype *tspr) +void updateanimation(md2model_t *m, const spritetype *tspr, uint8_t lpal) { mdanim_t *anim; int32_t i, j, k; int32_t fps; - char lpal = (tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal; if (m->numframes < 2) { @@ -1905,14 +1904,14 @@ static int32_t md3draw(md3model_t *m, const spritetype *tspr) void *vbotemp; point3d *vertexhandle = NULL; uint16_t *indexhandle; - char lpal = (tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal; + uint8_t lpal = (tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal; if (r_vbos && (m->vbos == NULL)) mdloadvbos(m); // if ((tspr->cstat&48) == 32) return 0; - updateanimation((md2model_t *)m,tspr); + updateanimation((md2model_t *)m, tspr, lpal); //create current&next frame's vertex list from whole list diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 31abd61c6..baa8855ab 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -3896,7 +3896,7 @@ static void polymer_drawmdsprite(spritetype *tspr) mdskinmap_t* sk; float *v0, *v1; md3surf_t *s; - char lpal, targetpal, usinghighpal, foundpalskin; + char targetpal, usinghighpal, foundpalskin; float spos2[3], spos[3], tspos[3], lpos[3], tlpos[3], vec[3], mat[4][4]; float ang; float scale; @@ -3909,10 +3909,10 @@ static void polymer_drawmdsprite(spritetype *tspr) char modellightcount; uint8_t curpriority; - m = (md3model_t*)models[tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].modelid]; - updateanimation((md2model_t *)m,tspr); + uint8_t lpal = (tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal; - lpal = (tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal; + m = (md3model_t*)models[tile2model[Ptile2tile(tspr->picnum,lpal)].modelid]; + updateanimation((md2model_t *)m,tspr,lpal); if ((pr_vbos > 1) && (m->indices == NULL)) polymer_loadmodelvbos(m);