From 7a84f4a9a6ee0b3551ca233007f437101b0c835e Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Sat, 2 Dec 2006 12:52:59 +0000 Subject: [PATCH] divide negative light rates of change properly (fix bug #2575) --- ChangeLog | 5 +++++ texmap/scanline.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6788021..1b527b09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-02 Chris Taylor + + * texmap/scanline.c: divide negative light rates of change + properly (fix bug #2575) + 2006-12-01 Chris Taylor * main/weapon.c: only autoselect a secondary weapon if the player diff --git a/texmap/scanline.c b/texmap/scanline.c index 9056fefd..78c258bd 100644 --- a/texmap/scanline.c +++ b/texmap/scanline.c @@ -1,4 +1,4 @@ -/* $Id: scanline.c,v 1.8 2004-08-28 23:17:45 schaffner Exp $ */ +/* $Id: scanline.c,v 1.9 2006-12-02 12:52:41 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -23,7 +23,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: scanline.c,v 1.8 2004-08-28 23:17:45 schaffner Exp $"; +static char rcsid[] = "$Id: scanline.c,v 1.9 2006-12-02 12:52:41 chris Exp $"; #endif #include @@ -116,7 +116,7 @@ void c_tmap_scanline_lin() dvdx = fx_dv_dx*64; l = fx_l>>8; - dldx = fx_dl_dx>>8; + dldx = fx_dl_dx/256; // fx_dl_dx>>8 != fx_dl_dx/256 for negative numbers dest = (ubyte *)(write_buffer + fx_xleft + (bytes_per_row * fx_y) ); if (!Transparency_on) { @@ -218,7 +218,7 @@ void c_tmap_scanline_lin() dvdx = fx_dv_dx*64; l = fx_l>>8; - dldx = fx_dl_dx>>8; + dldx = fx_dl_dx/256; // fx_dl_dx>>8 != fx_dl_dx/256 for negative numbers dest = (ubyte *)(write_buffer + fx_xleft + (bytes_per_row * fx_y) ); if (!Transparency_on) { @@ -805,7 +805,7 @@ void c_tmap_scanline_per() dzdx = fx_dz_dx; l = fx_l>>8; - dldx = fx_dl_dx>>8; + dldx = fx_dl_dx/256; // fx_dl_dx>>8 != fx_dl_dx/256 for negative numbers dest = (ubyte *)(write_buffer + fx_xleft + (bytes_per_row * fx_y) ); if (!Transparency_on) { @@ -813,7 +813,7 @@ void c_tmap_scanline_per() ubyte* fadeTableLocalCopy = gr_fade_table; unsigned long destlong; - x = fx_xright-fx_xleft+1; + x = fx_xright-fx_xleft+1; // x = number of pixels in scanline if ((j = (unsigned long) dest & 3) != 0) { @@ -916,7 +916,7 @@ void c_tmap_scanline_per() dzdx = fx_dz_dx; l = fx_l>>8; - dldx = fx_dl_dx>>8; + dldx = fx_dl_dx/256; // fx_dl_dx>>8 != fx_dl_dx/256 for negative numbers dest = (ubyte *)(write_buffer + fx_xleft + (bytes_per_row * fx_y) ); if (!Transparency_on) { -- 2.39.2