mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
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:
parent
872ea59160
commit
7e51e92a81
3 changed files with 6 additions and 3 deletions
|
@ -59,7 +59,9 @@ static inline float getshadefactor(int32_t shade)
|
||||||
{
|
{
|
||||||
int32_t shadebound = (shadescale_unbounded || shade>=numshades) ? numshades : numshades-1;
|
int32_t shadebound = (shadescale_unbounded || shade>=numshades) ? numshades : numshades-1;
|
||||||
float clamped_shade = min(max(shade*shadescale, 0), shadebound);
|
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;
|
return ((float)(numshades-clamped_shade))/(float)numshades;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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));
|
Bmemcpy(fogcol, &fogtable[pal<<2], sizeof(fogcol));
|
||||||
|
|
||||||
if (getrendermode() == REND_POLYMOST && r_usetileshades && shade > 0 &&
|
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;
|
shade >>= 1;
|
||||||
|
|
||||||
if (r_usenewshading!=2)
|
if (r_usenewshading!=2)
|
||||||
|
|
|
@ -3197,7 +3197,7 @@ void G_DrawBackground(void)
|
||||||
}
|
}
|
||||||
else
|
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;
|
const int32_t fstilep = tilesizx[MENUTILE]==320 && tilesizy[MENUTILE]==200;
|
||||||
int32_t bgtile = (fstilep ? MENUTILE : BIGHOLE);
|
int32_t bgtile = (fstilep ? MENUTILE : BIGHOLE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue