- Fixed: LIGHT2SHADE would overflow with light values larger than 10 bits.

SVN r3339 (trunk)
This commit is contained in:
Randy Heit 2012-01-22 00:14:02 +00:00
parent 1bdbfb360e
commit 2faf92858a
2 changed files with 8 additions and 8 deletions

View file

@ -74,7 +74,7 @@ extern bool r_dontmaplines;
// Convert a light level into an unbounded colormap index (shade). Result is
// fixed point. Why the +12? I wish I knew, but experimentation indicates it
// is necessary in order to best reproduce Doom's original lighting.
#define LIGHT2SHADE(l) ((NUMCOLORMAPS*2*FRACUNIT)-(((l)+12)*FRACUNIT*NUMCOLORMAPS/128))
#define LIGHT2SHADE(l) ((NUMCOLORMAPS*2*FRACUNIT)-(((l)+12)*(FRACUNIT*NUMCOLORMAPS/128)))
// MAXLIGHTSCALE from original DOOM, divided by 2.
#define MAXLIGHTVIS (24*FRACUNIT)