Polymer: Hook ART mapping to rotatesprite.

The visibility calculation relies on the distance, which might not be entirely
accurate in rotatesprite, so maybe it'll be too dark in some cases.

git-svn-id: https://svn.eduke32.com/eduke32@3741 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
Plagman 2013-05-08 06:53:38 +00:00
parent ce76b5a3b8
commit c32401ba51
2 changed files with 21 additions and 12 deletions

View file

@ -1334,7 +1334,7 @@ void polymer_inb4rotatesprite(int16_t tilenum, char pal, int8_t s
{
_prmaterial rotatespritematerial;
polymer_getbuildmaterial(&rotatespritematerial, tilenum, pal, shade, 0, 1337);
polymer_getbuildmaterial(&rotatespritematerial, tilenum, pal, shade, 0, 4);
rotatespritematerialbits = polymer_bindmaterial(rotatespritematerial, NULL, 0);
}
@ -4557,7 +4557,7 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile
loadtile(tilenum);
// PR_BIT_DIFFUSE_MAP
pth = gltexcache(tilenum, pal, cmeth == 1337 ? 4 : cmeth);
pth = gltexcache(tilenum, pal, cmeth);
if (pth)
material->diffusemap = pth->glpic;
@ -4569,7 +4569,7 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile
}
// Lazily fill in all the textures we need, move this to precaching later
if (pr_artmapping && (!pth || !pth->hicr) && cmeth != 1337) {
if (pr_artmapping && (!pth || !pth->hicr)) {
if (!prartmaps[tilenum]) {
char *tilebuffer = (char *)waloff[tilenum];
char *tempbuffer = (char *)Bmalloc(tilesizx[tilenum] * tilesizy[tilenum]);

View file

@ -2210,12 +2210,18 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
pth = pth->ofb;
}
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
// If we aren't rendmode 3, we're in Polymer, which means this code is
// used for rotatesprite only. Polymer handles all the material stuff,
// just submit the geometry and don't mess with textures.
if (rendmode == 3)
{
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
if (srepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
if (trepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
if (srepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
if (trepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
}
// texture scale by parkar request
if (pth && pth->hicr && ((pth->hicr->xscale != 1.0f) || (pth->hicr->yscale != 1.0f)) && !drawingskybox)
@ -2573,10 +2579,13 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
texunits--;
}
if (srepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP);
if (trepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP);
if (rendmode == 3)
{
if (srepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP);
if (trepeat)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,glinfo.clamptoedge?GL_CLAMP_TO_EDGE:GL_CLAMP);
}
if (fullbrightdrawingpass == 1) // tile has fullbright colors ?
{