From 7e51e92a814c89b15c692324f649643edfe7f57a Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 15 May 2013 02:20:35 +0000 Subject: [PATCH] Properly handle shading models with traditional fog when r_usetileshades is also enabled. git-svn-id: https://svn.eduke32.com/eduke32@3766 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/polymost.h | 4 +++- polymer/eduke32/build/src/polymost.c | 3 ++- polymer/eduke32/source/game.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index 8f744d785..cd4f30fbd 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -59,7 +59,9 @@ static inline float getshadefactor(int32_t shade) { int32_t shadebound = (shadescale_unbounded || shade>=numshades) ? numshades : numshades-1; float clamped_shade = min(max(shade*shadescale, 0), shadebound); - if (rendmode == REND_POLYMOST && r_usetileshades && (!usehightile || !hicfindsubst(globalpicnum, globalpal, 0))) return 1.f; + if (rendmode == REND_POLYMOST && r_usetileshades && + (!usehightile || !hicfindsubst(globalpicnum, globalpal, 0)) && + (!usemodels || md_tilehasmodel(globalpicnum, globalpal) < 0)) return 1.f; return ((float)(numshades-clamped_shade))/(float)numshades; } diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 4eb9d7b7d..69946e972 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -527,7 +527,8 @@ static inline void fogcalc(int32_t tile, int32_t shade, int32_t vis, int32_t pal Bmemcpy(fogcol, &fogtable[pal<<2], sizeof(fogcol)); if (getrendermode() == REND_POLYMOST && r_usetileshades && shade > 0 && - (!usehightile || !hicfindsubst(tile, pal, 0))) + (!usehightile || !hicfindsubst(tile, pal, 0)) && + (!usemodels || md_tilehasmodel(tile, pal) < 0)) shade >>= 1; if (r_usenewshading!=2) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 7536ec496..0c6921d3a 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3197,7 +3197,7 @@ void G_DrawBackground(void) } else { - const int32_t MENUTILE = (getrendermode() == REND_CLASSIC ? MENUSCREEN : LOADSCREEN); + const int32_t MENUTILE = MENUSCREEN;//(getrendermode() == REND_CLASSIC ? MENUSCREEN : LOADSCREEN); const int32_t fstilep = tilesizx[MENUTILE]==320 && tilesizy[MENUTILE]==200; int32_t bgtile = (fstilep ? MENUTILE : BIGHOLE);