From 47e9e0be3c3c4d77f9ec93c350d26a8ea5a36e55 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 12 Aug 2013 15:18:12 +0000 Subject: [PATCH] Polymost: fix my r_usetileshades==2 sub-method. Don't touch TerminX's r_usetileshades==1 or it being the default. git-svn-id: https://svn.eduke32.com/eduke32@4010 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index e58061f31..9ee795132 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -1294,6 +1294,13 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp static int32_t pow2xsplit = 0, skyclamphack = 0; static float alpha = 0.f; +static pthtyp *our_texcache_fetch(int32_t dameth) +{ + // r_usetileshades 1 is TX's method. + int32_t vis = (r_usetileshades == 1) ? globvis>>2 : 0; + return texcache_fetch(globalpicnum, globalpal, getpalookup(vis,globalshade), dameth); +} + void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) { double ngdx = 0.0, ngdy = 0.0, ngdo = 0.0, ngux = 0.0, nguy = 0.0, nguo = 0.0; @@ -1390,7 +1397,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) float hackscx, hackscy; if (skyclamphack) method |= 4; - pth = texcache_fetch(globalpicnum,globalpal,getpalookup(globvis>>2, globalshade),method&(~3)); + pth = our_texcache_fetch(method&(~3)); if (!pth) { @@ -4715,7 +4722,7 @@ void polymost_fillpolygon(int32_t npoints) if (gloy1 != -1) setpolymost2dview(); //disables blending, texturing, and depth testing bglEnable(GL_ALPHA_TEST); bglEnable(GL_TEXTURE_2D); - pth = texcache_fetch(globalpicnum,globalpal,getpalookup(r_usetileshades != 1 ? 0 : globvis>>2, globalshade),0); + pth = our_texcache_fetch(0); bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); f = getshadefactor(globalshade);