hightile: enable the texture factoring code for all palettes

git-svn-id: https://svn.eduke32.com/eduke32@2799 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
Plagman 2012-07-02 04:24:04 +00:00
parent 5a8d61d479
commit 4055e446c0
2 changed files with 11 additions and 12 deletions

View file

@ -821,17 +821,16 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
if (*texidx) if (*texidx)
return *texidx; return *texidx;
// possibly fetch an already loaded multitexture :_) // possibly fetch an already loaded texture
if (pal >= (MAXPALOOKUPS - RESERVEDPALS)) for (i=0; i<nextmodelid; i++)
for (i=0; i<nextmodelid; i++) for (skzero = ((md2model_t *)models[i])->skinmap; skzero; skzero = skzero->next)
for (skzero = ((md2model_t *)models[i])->skinmap; skzero; skzero = skzero->next) if (!Bstrcasecmp(skzero->fn, sk->fn) && skzero->texid[hicfxmask(pal)])
if (!Bstrcasecmp(skzero->fn, sk->fn) && skzero->texid[hicfxmask(pal)]) {
{ int32_t f = hicfxmask(pal);
int32_t f = hicfxmask(pal);
sk->texid[f] = skzero->texid[f]; sk->texid[f] = skzero->texid[f];
return sk->texid[f]; return sk->texid[f];
} }
*texidx = 0; *texidx = 0;

View file

@ -363,8 +363,8 @@ pthtyp *gltexcache(int32_t dapicnum, int32_t dapalnum, int32_t dameth)
pth = (pthtyp *)Bcalloc(1,sizeof(pthtyp)); pth = (pthtyp *)Bcalloc(1,sizeof(pthtyp));
if (!pth) return NULL; if (!pth) return NULL;
// possibly fetch an already loaded multitexture :_) // possibly fetch an already loaded texture
if (dapalnum >= (MAXPALOOKUPS - RESERVEDPALS)) if (si->filename) // false if skybox; we can probably ignore that for now
for (i = (GLTEXCACHEADSIZ - 1); i >= 0; i--) for (i = (GLTEXCACHEADSIZ - 1); i >= 0; i--)
for (pth2=gltexcachead[i]; pth2; pth2=pth2->next) for (pth2=gltexcachead[i]; pth2; pth2=pth2->next)
{ {