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
This commit is contained in:
terminx 2013-05-15 02:20:35 +00:00
parent 872ea59160
commit 7e51e92a81
3 changed files with 6 additions and 3 deletions

View file

@ -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;
}

View file

@ -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)

View file

@ -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);