From c4c93e5cf144203331e624534d6be85dd2206adb Mon Sep 17 00:00:00 2001 From: zicodxx Date: Sun, 10 Jul 2011 01:09:40 +0200 Subject: [PATCH] Added complex error output if illegal segnum passed to get_seg_masks(); Fixed warning about set but unused variables --- CHANGELOG.txt | 9 ++++++++- main/gameseg.c | 9 +++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6e11e3073..b969aa8c5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,10 +1,17 @@ D1X-Rebirth Changelog +20110710 +-------- +main/gameseg.c: Added complex error output if illegal segnum passed to get_seg_masks(); Fixed warning about set but unused variables + +20110709 +-------- +main/lighting.c: Added new dynamic light calculation which works with find_connected_distance() preventing vertecies to be lit up without connection to light source but still maintaining illumination. Still deactivated as it needs more optimization - planned for 0.58. Removed old alternative dynamic lighting which was suppoed to work via fvi but way slower than the new one + 20110708 -------- main/net_udp.c: Slight improvement for Packet Loss Prevention: Be able to send to 35 packets per call of net_udp_noloss_process_queue() and also let counter only increase if a packet was actually sent, making sure the queue is not stuck on the first 5 packets in the list arch/sdl/digi.c: Make sure hmp_reset() is only executed if a song was playing -main/lighting.c: Added new dynamic light calculation which works with find_connected_distance() preventing vertecies to be lit up without connection to light source but still maintaining illumination. Still deactivated as it needs more optimization - planned for 0.58. Removed old alternative dynamic lighting which was suppoed to work via fvi but way slower than the new one 20110704 -------- diff --git a/main/gameseg.c b/main/gameseg.c index d08e4d151..54acda6a9 100644 --- a/main/gameseg.c +++ b/main/gameseg.c @@ -305,6 +305,9 @@ segmasks get_seg_masks(vms_vector *checkp,int segnum,fix rad,char *calling_file, int vertex_list[6]; segment *seg; + if (segnum < 0 || segnum > Highest_segment_index) + Error("segnum == %i (%i) in get_seg_masks()\ncheckp: %i,%i,%i, rad: %i\nfrom file: %s, line: %i\nPlease report this bug.\n",segnum,Highest_segment_index,checkp->x,checkp->y,checkp->z,rad,calling_file,calling_linenum); + Assert((segnum <= Highest_segment_index) && (segnum >= 0)); seg = &Segments[segnum]; @@ -607,14 +610,10 @@ int check_segment_connections(void) seg = &Segments[segnum]; for (sidenum=0;sidenum<6;sidenum++) { - side *s; segment *cseg; - side *cs; int num_faces,csegnum,csidenum,con_num_faces; int vertex_list[6],con_vertex_list[6]; - s = &seg->sides[sidenum]; - create_abs_vertex_lists( &num_faces, vertex_list, segnum, sidenum, __FILE__, __LINE__); csegnum = seg->children[sidenum]; @@ -628,8 +627,6 @@ int check_segment_connections(void) continue; } - cs = &cseg->sides[csidenum]; - create_abs_vertex_lists( &con_num_faces, con_vertex_list, csegnum, csidenum, __FILE__, __LINE__); if (con_num_faces != num_faces) {