From a822a683cdb1f8904503807ba123fbcf986d9120 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 12 Jul 2012 18:15:45 +0900 Subject: [PATCH] Fix the inverted lighting for sw32. LordHavoc had made lighting positive for sw32, but I had done something in the plugin code that broke that (probably something to do with the colormap loading). Going back to id's original code fixes the issue. --- libs/video/renderer/sw32/sw32_rsurf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libs/video/renderer/sw32/sw32_rsurf.c b/libs/video/renderer/sw32/sw32_rsurf.c index 32c2b892a..a62cfc95f 100644 --- a/libs/video/renderer/sw32/sw32_rsurf.c +++ b/libs/video/renderer/sw32/sw32_rsurf.c @@ -193,13 +193,12 @@ R_BuildLightMap (void) if (surf->dlightframe == r_framecount) R_AddDynamicLights (); - // LordHavoc: changed to positive (not inverse) lighting - for (i = 0; i < size; i++) { - t = bound(256, blocklights[i] >> (8 - VID_CBITS), - 256 * (VID_GRADES - 1)); - blocklights[i] = t; - } -/* +// // LordHavoc: changed to positive (not inverse) lighting +// for (i = 0; i < size; i++) { +// t = bound(256, blocklights[i] >> (8 - VID_CBITS), +// 256 * (VID_GRADES - 1)); +// blocklights[i] = t; +// } // bound, invert, and shift for (i = 0; i < size; i++) { t = (255 * 256 - blocklights[i]) >> (8 - VID_CBITS); @@ -209,7 +208,6 @@ R_BuildLightMap (void) blocklights[i] = t; } -*/ } void