| version 1.1 | | version 1.2 |
|---|
| | |
| * AI path forming stuff. | | * AI path forming stuff. |
| * | | * |
| * $Log$ | | * $Log$ |
| * Revision 1.1 1999/06/14 22:05:15 donut | | * Revision 1.2 2003/03/09 06:34:09 donut |
| * Initial revision | | * change byte typedef to sbyte to avoid conflict with win32 byte which is unsigned |
| | | * |
| | | * Revision 1.1.1.1 1999/06/14 22:05:15 donut |
| | | * Import of d1x 1.37 source. |
| * | | * |
| * Revision 2.0 1995/02/27 11:30:48 john | | * Revision 2.0 1995/02/27 11:30:48 john |
| * New version 2.0, which has no anonymous unions, builds with | | * New version 2.0, which has no anonymous unions, builds with |
| | |
| // Length in segments of avoidance path | | // Length in segments of avoidance path |
| #define AVOID_SEG_LENGTH 7 | | #define AVOID_SEG_LENGTH 7 |
| | | |
| void create_random_xlate(byte *xt) | | void create_random_xlate(sbyte *xt) |
| { | | { |
| int i; | | int i; |
| | | |
| | |
| | | |
| for (i=0; i<MAX_SIDES_PER_SEGMENT; i++) { | | for (i=0; i<MAX_SIDES_PER_SEGMENT; i++) { |
| int j = (d_rand()*MAX_SIDES_PER_SEGMENT)/(D_RAND_MAX+1); | | int j = (d_rand()*MAX_SIDES_PER_SEGMENT)/(D_RAND_MAX+1); |
| byte temp_byte; | | sbyte temp_byte; |
| Assert((j >= 0) && (j < MAX_SIDES_PER_SEGMENT)); | | Assert((j >= 0) && (j < MAX_SIDES_PER_SEGMENT)); |
| | | |
| temp_byte = xt[j]; | | temp_byte = xt[j]; |
| | |
| int sidenum; | | int sidenum; |
| int qtail = 0, qhead = 0; | | int qtail = 0, qhead = 0; |
| int i; | | int i; |
| byte visited[MAX_SEGMENTS]; | | sbyte visited[MAX_SEGMENTS]; |
| seg_seg seg_queue[MAX_SEGMENTS]; | | seg_seg seg_queue[MAX_SEGMENTS]; |
| short depth[MAX_SEGMENTS]; | | short depth[MAX_SEGMENTS]; |
| int cur_depth; | | int cur_depth; |
| byte random_xlate[MAX_SIDES_PER_SEGMENT]; | | sbyte random_xlate[MAX_SIDES_PER_SEGMENT]; |
| point_seg *original_psegs = psegs; | | point_seg *original_psegs = psegs; |
| #ifndef NDEBUG | | #ifndef NDEBUG |
| point_seg *other_original_psegs = psegs; | | point_seg *other_original_psegs = psegs; |