added debug info for illegal side type (d1x r1.2, r1.4, r1.2, r1.2)

This commit is contained in:
Bradley Bell 2004-05-21 00:02:38 +00:00
parent 4e862e361b
commit 8fa23687cc
5 changed files with 28 additions and 22 deletions

View file

@ -1,3 +1,9 @@
2004-05-20 Victor Rachels <sekmu@tisiphone.dhs.org>
* main/fvi.c, main/gameseg.c, main/gameseg.h, main/physics.c:
added debug info for illegal side type (d1x r1.2, r1.4, r1.2,
r1.2)
2004-05-20 Bradley Bell <btb@icculus.org>
* arch/ogl/gr.c, main/menu.c: fix a couple of defines

View file

@ -1,4 +1,4 @@
/* $Id: fvi.c,v 1.3 2003-10-10 09:36:35 btb Exp $ */
/* $Id: fvi.c,v 1.4 2004-05-21 00:02:34 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -497,7 +497,7 @@ int check_line_to_face(vms_vector *newp,vms_vector *p0,vms_vector *p1,segment *s
if ((seg-Segments)==-1)
Error("segnum == -1 in check_line_to_face()");
create_abs_vertex_lists(&num_faces,vertex_list,seg-Segments,side);
create_abs_vertex_lists(&num_faces, vertex_list, seg - Segments, side, __FILE__, __LINE__);
//use lowest point number
if (num_faces==2) {
@ -597,7 +597,7 @@ int special_check_line_to_face(vms_vector *newp,vms_vector *p0,vms_vector *p1,se
if ((seg-Segments)==-1)
Error("segnum == -1 in special_check_line_to_face()");
create_abs_vertex_lists(&num_faces,vertex_list,seg-Segments,side);
create_abs_vertex_lists(&num_faces, vertex_list, seg - Segments, side, __FILE__, __LINE__);
vm_vec_sub(&move_vec,p1,p0);
//figure out which edge(s) to check against
@ -1389,7 +1389,7 @@ void find_hitpoint_uv(fix *u,fix *v,fix *l,vms_vector *pnt,segment *seg,int side
if (segnum==-1)
Error("segnum == -1 in find_hitpoint_uv()");
create_abs_vertex_lists(&num_faces,vertex_list,segnum,sidenum);
create_abs_vertex_lists(&num_faces, vertex_list, segnum, sidenum, __FILE__, __LINE__);
create_all_vertnum_lists(&num_faces,vertnum_list,segnum,sidenum);
//now the hard work.
@ -1524,7 +1524,7 @@ int sphere_intersects_wall(vms_vector *pnt,int segnum,fix rad)
if ((seg-Segments)==-1)
Error("segnum == -1 in sphere_intersects_wall()");
create_abs_vertex_lists(&num_faces,vertex_list,seg-Segments,side);
create_abs_vertex_lists(&num_faces, vertex_list, seg - Segments, side, __FILE__, __LINE__);
face_hit_type = check_sphere_to_face( pnt,&seg->sides[side],
face,((num_faces==1)?4:3),rad,vertex_list);

View file

@ -1,4 +1,4 @@
/* $Id: gameseg.c,v 1.6 2004-05-15 18:07:12 schaffner Exp $ */
/* $Id: gameseg.c,v 1.7 2004-05-21 00:02:35 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -249,7 +249,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "byteswap.h"
#ifdef RCS
static char rcsid[] = "$Id: gameseg.c,v 1.6 2004-05-15 18:07:12 schaffner Exp $";
static char rcsid[] = "$Id: gameseg.c,v 1.7 2004-05-21 00:02:35 btb Exp $";
#endif
// How far a point can be from a plane, and still be "in" the plane
@ -399,7 +399,7 @@ void create_all_vertex_lists(int *num_faces, int *vertices, int segnum, int side
//CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS()
break;
default:
Error("Illegal side type (1), type = %i, segment # = %i, side # = %i\n", sidep->type, segnum, sidenum);
Error("Illegal side type (1), type = %i, segment # = %i, side # = %i\n Please report this bug.\n", sidep->type, segnum, sidenum);
break;
}
@ -457,15 +457,15 @@ void create_all_vertnum_lists(int *num_faces, int *vertnums, int segnum, int sid
//CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS()
break;
default:
Error("Illegal side type (2), type = %i, segment # = %i, side # = %i\n", sidep->type, segnum, sidenum);
Error("Illegal side type (2), type = %i, segment # = %i, side # = %i\n Please report this bug.\n", sidep->type, segnum, sidenum);
break;
}
}
// -----
//like create_all_vertex_lists(), but generate absolute point numbers
void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum)
// like create_all_vertex_lists(), but generate absolute point numbers
void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum, char *calling_file, int calling_linenum)
{
short *vp = Segments[segnum].verts;
side *sidep = &Segments[segnum].sides[sidenum];
@ -512,7 +512,7 @@ void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int side
//CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS()
break;
default:
Error("Illegal side type (3), type = %i, segment # = %i, side # = %i\n", sidep->type, segnum, sidenum);
Error("Illegal side type (3), type = %i, segment # = %i, side # = %i caller:%s:%i\n Please report this bug.\n", sidep->type, segnum, sidenum, calling_file, calling_linenum);
break;
}
@ -550,7 +550,7 @@ segmasks get_seg_masks(vms_vector *checkp,int segnum,fix rad)
// Get number of faces on this side, and at vertex_list, store vertices.
// If one face, then vertex_list indicates a quadrilateral.
// If two faces, then 0,1,2 define one triangle, 3,4,5 define the second.
create_abs_vertex_lists( &num_faces, vertex_list, segnum, sn);
create_abs_vertex_lists(&num_faces, vertex_list, segnum, sn, __FILE__, __LINE__);
//ok...this is important. If a side has 2 faces, we need to know if
//those faces form a concave or convex side. If the side pokes out,
@ -698,7 +698,7 @@ ubyte get_side_dists(vms_vector *checkp,int segnum,fix *side_dists)
// Get number of faces on this side, and at vertex_list, store vertices.
// If one face, then vertex_list indicates a quadrilateral.
// If two faces, then 0,1,2 define one triangle, 3,4,5 define the second.
create_abs_vertex_lists( &num_faces, vertex_list, segnum, sn);
create_abs_vertex_lists(&num_faces, vertex_list, segnum, sn, __FILE__, __LINE__);
//ok...this is important. If a side has 2 faces, we need to know if
//those faces form a concave or convex side. If the side pokes out,
@ -850,7 +850,7 @@ int check_segment_connections(void)
s = &seg->sides[sidenum];
create_abs_vertex_lists( &num_faces, vertex_list, segnum, sidenum);
create_abs_vertex_lists(&num_faces, vertex_list, segnum, sidenum, __FILE__, __LINE__);
csegnum = seg->children[sidenum];
@ -866,7 +866,7 @@ int check_segment_connections(void)
cs = &cseg->sides[csidenum];
create_abs_vertex_lists( &con_num_faces, con_vertex_list, csegnum, csidenum);
create_abs_vertex_lists(&con_num_faces, con_vertex_list, csegnum, csidenum, __FILE__, __LINE__);
if (con_num_faces != num_faces) {
mprintf((0,"Seg %x, side %d: num_faces (%d) mismatch with seg %x, side %d (%d)\n",segnum,sidenum,num_faces,csegnum,csidenum,con_num_faces));
@ -1753,7 +1753,7 @@ void create_walls_on_side(segment *sp, int sidenum)
int vertnum;
side *s;
create_abs_vertex_lists( &num_faces, vertex_list, sp-Segments, sidenum);
create_abs_vertex_lists(&num_faces, vertex_list, sp - Segments, sidenum, __FILE__, __LINE__);
Assert(num_faces == 2);

View file

@ -1,4 +1,4 @@
/* $Id: gameseg.h,v 1.2 2003-10-04 03:14:47 btb Exp $ */
/* $Id: gameseg.h,v 1.3 2004-05-21 00:02:37 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -143,7 +143,7 @@ void get_side_verts(short *vertlist,int segnum,int sidenum);
extern void create_all_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum);
//like create_all_vertex_lists(), but generate absolute point numbers
extern void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum);
extern void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum, char *calling_file, int calling_linenum);
// -----------------------------------------------------------------------------------
// Like create all vertex lists, but returns the vertnums (relative to

View file

@ -1,4 +1,4 @@
/* $Id: physics.c,v 1.4 2003-10-10 09:36:35 btb Exp $ */
/* $Id: physics.c,v 1.5 2004-05-21 00:02:38 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -258,7 +258,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#ifdef RCS
static char rcsid[] = "$Id: physics.c,v 1.4 2003-10-10 09:36:35 btb Exp $";
static char rcsid[] = "$Id: physics.c,v 1.5 2004-05-21 00:02:38 btb Exp $";
#endif
#include <stdio.h>
@ -1154,7 +1154,7 @@ save_p1 = *fq.p1;
if (orig_segnum==-1)
Error("orig_segnum == -1 in physics");
create_abs_vertex_lists( &num_faces, vertex_list, orig_segnum, sidenum);
create_abs_vertex_lists(&num_faces, vertex_list, orig_segnum, sidenum, __FILE__, __LINE__);
//let's pretend this wall is not triangulated
vertnum = vertex_list[0];