- moved shadeToLight out of build.h.

This commit is contained in:
Christoph Oelckers 2021-03-25 09:13:16 +01:00
parent 957f7e9487
commit 168b0385cf
11 changed files with 24 additions and 27 deletions

View file

@ -98,4 +98,14 @@ inline int sectorofwall(int wallNum)
return -1;
}
extern int numshades;
// Return type is int because this gets passed to variadic functions where structs may produce undefined behavior.
inline int shadeToLight(int shade)
{
shade = clamp(shade, 0, numshades - 1);
int light = Scale(numshades - 1 - shade, 255, numshades - 1);
return PalEntry(255, light, light, light);
}