mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
Polymodes: Slight optimizations in getshadefactor.
git-svn-id: https://svn.eduke32.com/eduke32@5439 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
7d3cbf4f83
commit
34bf6443ce
1 changed files with 4 additions and 3 deletions
|
@ -72,9 +72,6 @@ static inline int32_t eligible_for_tileshades(int32_t const picnum, int32_t cons
|
|||
|
||||
static inline float getshadefactor(int32_t const shade)
|
||||
{
|
||||
int32_t const shadebound = (shadescale_unbounded || shade>=numshades) ? numshades : numshades-1;
|
||||
float const clamped_shade = min(max(shade*shadescale, 0), shadebound);
|
||||
|
||||
// 8-bit tiles, i.e. non-hightiles and non-models, don't get additional
|
||||
// glColor() shading with r_usetileshades!
|
||||
if (getrendermode() == REND_POLYMOST && r_usetileshades &&
|
||||
|
@ -82,6 +79,10 @@ static inline float getshadefactor(int32_t const shade)
|
|||
eligible_for_tileshades(globalpicnum, globalpal))
|
||||
return 1.f;
|
||||
|
||||
float const shadebound = (float)((shadescale_unbounded || shade>=numshades) ? numshades : numshades-1);
|
||||
float const scaled_shade = (float)shade*shadescale;
|
||||
float const clamped_shade = min(max(scaled_shade, 0.f), shadebound);
|
||||
|
||||
return ((float)(numshades-clamped_shade))/(float)numshades;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue