Commit b9f31def authored by Richard Gobeille's avatar Richard Gobeille Committed by Richard Gobeille
Browse files

engine: revise 5857f70f

parent d14a3c39
......@@ -4918,7 +4918,7 @@ static void polymer_getscratchmaterial(_prmaterial* material)
material->mdspritespace = GL_FALSE;
}
static void polymer_setupartmap(int16_t tilenum, char pal)
static void polymer_setupartmap(int16_t tilenum, char pal, int32_t meth)
{
if (!prartmaps[tilenum]) {
char *tilebuffer = (char *) waloff[tilenum];
......@@ -4949,8 +4949,8 @@ static void polymer_setupartmap(int16_t tilenum, char pal)
tempbuffer);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, meth & DAMETH_CLAMPED ? glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP : GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, meth & DAMETH_CLAMPED ? glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP : GL_REPEAT);
polymost_bindTexture(GL_TEXTURE_2D, 0);
Xfree(tempbuffer);
}
......@@ -5032,7 +5032,7 @@ static _prbucket* polymer_getbuildmaterial(_prmaterial* material, int16_t tile
}
if (!prartmaps[tilenum] || !prbasepalmaps[curbasepal] || !prlookups[pal])
polymer_setupartmap(tilenum, pal);
polymer_setupartmap(tilenum, pal, cmeth);
material->artmap = prartmaps[tilenum];
material->basepalmap = prbasepalmaps[curbasepal];
......
......@@ -3261,7 +3261,6 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
Bassert(pth);
const GLuint clamp_mode = glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP;
// 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,
......@@ -3281,11 +3280,6 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
if (drawpoly_trepeat)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
}
else if (method & DAMETH_CLAMPED)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_mode);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp_mode);
}
// texture scale by parkar request
if (pth->hicr && !drawingskybox && ((pth->hicr->scale.x != 1.0f) || (pth->hicr->scale.y != 1.0f)))
......@@ -3674,6 +3668,8 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
else if (!nofog)
polymost_setFogEnabled(true);
const GLuint clamp_mode = glinfo.clamptoedge ? GL_CLAMP_TO_EDGE : GL_CLAMP;
if (drawpoly_srepeat)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp_mode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment