From 2faf92858a0061fa05aa85d8caaee4855194bc61 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 22 Jan 2012 00:14:02 +0000 Subject: [PATCH] - Fixed: LIGHT2SHADE would overflow with light values larger than 10 bits. SVN r3339 (trunk) --- src/r_defs.h | 14 +++++++------- src/r_main.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/r_defs.h b/src/r_defs.h index 03c2290c2..849b8db16 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -907,13 +907,13 @@ struct line_t side_t *sidedef[2]; //DWORD sidenum[2]; // sidenum[1] will be NO_SIDE if one sided fixed_t bbox[4]; // bounding box, for the extent of the LineDef. - slopetype_t slopetype; // To aid move clipping. - sector_t *frontsector, *backsector; - int validcount; // if == validcount, already checked - int locknumber; // [Dusk] lock number for special -}; - -// phares 3/14/98 + slopetype_t slopetype; // To aid move clipping. + sector_t *frontsector, *backsector; + int validcount; // if == validcount, already checked + int locknumber; // [Dusk] lock number for special +}; + +// phares 3/14/98 // // Sector list node showing all sectors an object appears in. // diff --git a/src/r_main.h b/src/r_main.h index 776d1b162..0126d3906 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -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)