| version 1.3 | | version 1.4 |
|---|
| | |
| * Functions moved from segment.c to make editor separable from game. | | * Functions moved from segment.c to make editor separable from game. |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.4 2000/01/19 04:48:37 sekmu |
| | | * added debug info for illegal side type |
| | | * |
| * Revision 1.3 1999/09/21 07:24:39 sekmu | | * Revision 1.3 1999/09/21 07:24:39 sekmu |
| * remove nonreturnpath warning | | * remove nonreturnpath warning |
| * | | * |
| | |
| //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() | | //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() |
| break; | | break; |
| default: | | 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; | | break; |
| } | | } |
| | | |
| | |
| //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() | | //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() |
| break; | | break; |
| default: | | 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; | | break; |
| } | | } |
| | | |
| | |
| | | |
| // ----- | | // ----- |
| //like create_all_vertex_lists(), but generate absolute point numbers | | //like create_all_vertex_lists(), but generate absolute point numbers |
| void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum) | | 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; | | short *vp = Segments[segnum].verts; |
| side *sidep = &Segments[segnum].sides[sidenum]; | | side *sidep = &Segments[segnum].sides[sidenum]; |
| | |
| //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() | | //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() |
| break; | | break; |
| default: | | 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; | | break; |
| } | | } |
| | | |
| | |
| // Get number of faces on this side, and at vertex_list, store vertices. | | // Get number of faces on this side, and at vertex_list, store vertices. |
| // If one face, then vertex_list indicates a quadrilateral. | | // 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. | | // 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 | | //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, | | //those faces form a concave or convex side. If the side pokes out, |
| | |
| // Get number of faces on this side, and at vertex_list, store vertices. | | // Get number of faces on this side, and at vertex_list, store vertices. |
| // If one face, then vertex_list indicates a quadrilateral. | | // 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. | | // 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 | | //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, | | //those faces form a concave or convex side. If the side pokes out, |
| | |
| | | |
| s = &seg->sides[sidenum]; | | 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]; | | csegnum = seg->children[sidenum]; |
| | | |
| | |
| | | |
| cs = &cseg->sides[csidenum]; | | 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) { | | 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)); | | 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)); |
| | |
| int vertnum; | | int vertnum; |
| side *s; | | 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); | | Assert(num_faces == 2); |
| | | |