home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / eglobal.c < prev    next >
C/C++ Source or Header  |  1998-06-08  |  7KB  |  202 lines

  1. /*
  2.  * $Source: f:/miner/source/main/editor/rcs/eglobal.c $
  3.  * $Revision: 2.0 $
  4.  * $Author: john $
  5.  * $Date: 1995/02/27 11:35:52 $
  6.  *
  7.  * Globals for editor.
  8.  *
  9.  * $Log: eglobal.c $
  10.  * Revision 2.0  1995/02/27  11:35:52  john
  11.  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
  12.  * for bitmaps.tbl.
  13.  * 
  14.  * Revision 1.35  1994/05/23  14:48:15  mike
  15.  * make current segment be add segment.
  16.  * 
  17.  * Revision 1.34  1994/05/19  12:10:30  matt
  18.  * Use new vecmat macros and globals
  19.  * 
  20.  * Revision 1.33  1994/05/04  19:16:27  mike
  21.  * Add Degenerate_segment_found.
  22.  * 
  23.  * Revision 1.32  1994/05/03  11:02:57  mike
  24.  * Add SegSizeMode.
  25.  * 
  26.  * Revision 1.31  1994/02/16  13:49:12  mike
  27.  * enable editor to compile out.
  28.  * 
  29.  * Revision 1.30  1994/02/10  15:36:35  matt
  30.  * Various changes to make editor compile out.
  31.  * 
  32.  * Revision 1.29  1993/12/16  14:00:33  mike
  33.  * Add Curvert and Curedge.
  34.  * 
  35.  * Revision 1.28  1993/12/10  14:48:28  mike
  36.  * Kill orthogonal views.
  37.  * 
  38.  * Revision 1.27  1993/12/08  10:58:49  mike
  39.  * Add Cur_object_index.
  40.  * 
  41.  * Revision 1.26  1993/12/06  18:45:45  matt
  42.  * Changed object loading & handling
  43.  * 
  44.  * Revision 1.25  1993/12/02  17:51:49  john
  45.  * Changed my variable to match Mike's.
  46.  * 
  47.  * Revision 1.24  1993/12/02  17:36:13  john
  48.  * Added cur_obj_type
  49.  * 
  50.  * Revision 1.23  1993/11/24  14:41:16  mike
  51.  * Add variable Num_tilings.
  52.  * 
  53.  * Revision 1.22  1993/11/12  16:40:55  mike
  54.  * Add Identity_matrix, which is an identity matrix.
  55.  * 
  56.  * Revision 1.21  1993/11/02  13:08:17  mike
  57.  * Add N_warning_segs and Warning_segs
  58.  * 
  59.  * Revision 1.20  1993/11/02  10:31:53  mike
  60.  * Document some variables,
  61.  * Add Been_visited, removing it from editor.c
  62.  * Add Selected_segs[] and N_selected_segs.
  63.  * 
  64.  * Revision 1.19  1993/10/31  18:07:48  mike
  65.  * Add variable Lock_view_to_cursegp.
  66.  * 
  67.  * Revision 1.18  1993/10/19  20:54:51  matt
  68.  * Changed/cleaned up window updates
  69.  * 
  70.  * Revision 1.17  1993/10/18  18:35:43  mike
  71.  * Move Highest_vertex_index and Highest_segment_index here because they need
  72.  * to be globals.
  73.  * 
  74.  * Revision 1.16  1993/10/15  13:10:00  mike
  75.  * Move globals from editor.c to eglobal.c
  76.  * 
  77.  * Revision 1.15  1993/10/14  18:08:55  mike
  78.  * Change use of CONNECTIVITY to MAX_SIDES_PER_SEGMENT
  79.  * 
  80.  * Revision 1.14  1993/10/13  11:11:38  matt
  81.  * Made coordinate axes off by default
  82.  * 
  83.  * Revision 1.13  1993/10/12  09:59:27  mike
  84.  * Remove definition of Side_to_verts, which belongs in the game, not in the editor.
  85.  * 
  86.  * Revision 1.12  1993/10/09  15:48:07  mike
  87.  * Change type of Vertex_active and Side_to_verts from char to byte
  88.  * Move N_found_segs and Found_segs here from render.c
  89.  * Add Show_axes_flag.
  90.  * 
  91.  * Revision 1.11  1993/10/06  11:29:58  mike
  92.  * Add prototype for Side_opposite
  93.  * 
  94.  * Revision 1.10  1993/10/05  17:00:17  mike
  95.  * Add Vertex_active.
  96.  * 
  97.  * Revision 1.9  1993/10/04  17:18:16  mike
  98.  * Add variables Markedsegp, Markedside
  99.  * 
  100.  * Revision 1.8  1993/10/02  18:18:02  mike
  101.  * Added Draw_all_segments.  If !0, then all segments are drawn in draw_world.  If not set, then only those segments which
  102.  * are connected to the first segment are drawn.
  103.  * 
  104.  * Revision 1.7  1993/10/01  10:03:15  mike
  105.  * Fix ordering of vertices on front face: Used to be 0,1,2,3 made it 3,2,1,0
  106.  * 
  107.  * Revision 1.6  1993/09/27  16:04:28  mike
  108.  * Add Side_to_verts to replace _verts, which was local to segment.c
  109.  * 
  110.  * Revision 1.5  1993/09/27  15:20:52  mike
  111.  * Add Curside, which is current side, so we can make a certain side active.
  112.  * 
  113.  * Revision 1.4  1993/09/23  15:01:13  mike
  114.  * Remove game specific variables, put in mglobal.c
  115.  * 
  116.  * Revision 1.3  1993/09/22  10:52:17  mike
  117.  * Add global New_segment
  118.  * 
  119.  * Revision 1.2  1993/09/22  09:41:21  mike
  120.  * Change constand and variable names to conform to coding standards.
  121.  * 
  122.  * Revision 1.1  1993/09/20  17:06:09  mike
  123.  * Initial revision
  124.  * 
  125.  *
  126.  */
  127.  
  128. #pragma off (unreferenced)
  129. static char rcsid[] = "$Id: eglobal.c 2.0 1995/02/27 11:35:52 john Exp $";
  130. #pragma on (unreferenced)
  131.  
  132. #include "inferno.h"
  133. #include "segment.h"
  134. #include "editor.h"
  135.  
  136. // Global pointer to current vertices, right now always Vertices.  Set in create_new_mine.
  137. segment    New_segment;                // The segment which can be added to the mine.
  138. segment    *Cursegp;                    // Pointer to current segment in mine.
  139. int        Curside;                        // Side index in 0..MAX_SIDES_PER_SEGMENT of active side.
  140. int        Curedge;                        //    Current edge on current side, in 0..3
  141. int        Curvert;                        //    Current vertex on current side, in 0..3
  142. int        AttachSide = WFRONT;        //    Side on segment to attach.
  143. segment    *Markedsegp;                // Marked segment, used in conjunction with *Cursegp to form joints.
  144. int        Markedside;                    // Marked side on Markedsegp.
  145.  
  146. int        Draw_all_segments;        // Set to 1 means draw_world draws all segments in Segments, else draw only connected segments
  147.  
  148. byte        Vertex_active[MAX_VERTICES];    // !0 means vertex is in use, 0 means not in use.
  149.  
  150. int        N_selected_segs=0;                            // Number of segments found at Selected_segs
  151. short        Selected_segs[MAX_SELECTED_SEGS];        // List of segment numbers currently selected
  152.  
  153. int        N_warning_segs=0;                                // Number of segments warning-worthy, such as a concave segment
  154. short        Warning_segs[MAX_WARNING_SEGS];            // List of segment numbers currently selected
  155.  
  156. int        N_found_segs=0;                                // Number of segments found with last shift-mouse-click
  157. short        Found_segs[MAX_FOUND_SEGS];                // List of warning-worthy segments
  158.  
  159. int        Show_axes_flag=0;                                // 0 = don't show, !0 = do show coordinate axes in *Cursegp orientation
  160.  
  161. byte        Been_visited[MAX_SEGMENTS];                //    List of segments visited in a recursive search, if element n set, segment n done been visited
  162.  
  163. // Variables global to this editor.c and the k?????.c files.
  164. uint        Update_flags = UF_ALL;  //force total redraw
  165. int            Funky_chase_mode = 0;
  166. vms_angvec    Seg_orientation = {0,0,0};
  167. vms_vector    Seg_scale = {F1_0*20,F1_0*20,F1_0*20};
  168. int         mine_changed = 0;
  169. int         ModeFlag;
  170. editor_view *current_view;
  171.  
  172. int    SegSizeMode = 1;                                    // Mode = 0/1 = not/is legal to move bound vertices, 
  173.  
  174. //the view for the different windows.
  175. editor_view LargeView = {0,1, NULL, i2f(100),{f1_0,0,0,0,f1_0,0,0,0,f1_0},f1_0};
  176. #if ORTHO_VIEWS
  177. editor_view TopView   = {1,1, NULL, i2f(100),{f1_0,0,0,0,0,-f1_0,0,f1_0,0},f1_0};
  178. editor_view FrontView = {2,1, NULL, i2f(100),{f1_0,0,0,0,f1_0,0,0,0,f1_0},f1_0};
  179. editor_view RightView = {3,1, NULL, i2f(100),{0,0,f1_0,0,f1_0,0,f1_0,0,0},f1_0};
  180. #endif
  181.  
  182. editor_view *Views[] = {&LargeView,
  183. #if ORTHO_VIEWS
  184.     &TopView,&FrontView,&RightView
  185. #endif
  186.     };
  187.  
  188. int N_views = (sizeof(Views) / sizeof(*Views));
  189.  
  190. int    Lock_view_to_cursegp = 1;        // !0 means whenever cursegp changes, view it
  191.  
  192. int    Num_tilings = 1;                    // Number of tilings per wall
  193.  
  194. short Cur_object_index = -1;
  195.  
  196. // The current robot type
  197. int Cur_robot_type = 0;
  198.  
  199. //    !0 if a degenerate segment has been found.
  200. int    Degenerate_segment_found=0;
  201.  
  202.