]> icculus.org git repositories - btb/d2x.git/blob - main/editor/eglobal.c
075a9c8131546cfbdc5e6c861c10c9ca2a48c9a0
[btb/d2x.git] / main / editor / eglobal.c
1 /* $Id: eglobal.c,v 1.2 2004-12-19 14:52:48 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Globals for editor.
18  *
19  */
20
21 #ifdef RCS
22 static char rcsid[] = "$Id: eglobal.c,v 1.2 2004-12-19 14:52:48 btb Exp $";
23 #endif
24
25 #include <stdlib.h>
26 #include "inferno.h"
27 #include "segment.h"
28 #include "editor.h"
29
30 // Global pointer to current vertices, right now always Vertices.  Set in create_new_mine.
31 segment New_segment;                            // The segment which can be added to the mine.
32 segment *Cursegp;                                       // Pointer to current segment in mine.
33 int             Curside;                                                // Side index in 0..MAX_SIDES_PER_SEGMENT of active side.
34 int             Curedge;                                                //      Current edge on current side, in 0..3
35 int             Curvert;                                                //      Current vertex on current side, in 0..3
36 int             AttachSide = WFRONT;            //      Side on segment to attach.
37 segment *Markedsegp;                            // Marked segment, used in conjunction with *Cursegp to form joints.
38 int             Markedside;                                     // Marked side on Markedsegp.
39
40 int             Draw_all_segments;              // Set to 1 means draw_world draws all segments in Segments, else draw only connected segments
41
42 sbyte           Vertex_active[MAX_VERTICES];    // !0 means vertex is in use, 0 means not in use.
43
44 int             N_selected_segs=0;                                                      // Number of segments found at Selected_segs
45 short           Selected_segs[MAX_SELECTED_SEGS];               // List of segment numbers currently selected
46
47 int             N_warning_segs=0;                                                               // Number of segments warning-worthy, such as a concave segment
48 short           Warning_segs[MAX_WARNING_SEGS];                 // List of segment numbers currently selected
49
50 int             N_found_segs=0;                                                         // Number of segments found with last shift-mouse-click
51 short           Found_segs[MAX_FOUND_SEGS];                             // List of warning-worthy segments
52
53 int             Show_axes_flag=0;                                                               // 0 = don't show, !0 = do show coordinate axes in *Cursegp orientation
54
55 sbyte           Been_visited[MAX_SEGMENTS];                             //      List of segments visited in a recursive search, if element n set, segment n done been visited
56
57 // Variables global to this editor.c and the k?????.c files.
58 uint        Update_flags = UF_ALL;  //force total redraw
59 int                     Funky_chase_mode = 0;
60 vms_angvec      Seg_orientation = {0,0,0};
61 vms_vector      Seg_scale = {F1_0*20,F1_0*20,F1_0*20};
62 int         mine_changed = 0;
63 int         ModeFlag;
64 editor_view *current_view;
65
66 int     SegSizeMode = 1;                                                                        // Mode = 0/1 = not/is legal to move bound vertices, 
67
68 //the view for the different windows.
69 editor_view LargeView = {0,1, NULL, i2f(100),{{f1_0,0,0},{0,f1_0,0},{0,0,f1_0}},f1_0};
70 #if ORTHO_VIEWS
71 editor_view TopView   = {1,1, NULL, i2f(100),{{f1_0,0,0},{0,0,-f1_0},{0,f1_0,0}},f1_0};
72 editor_view FrontView = {2,1, NULL, i2f(100),{{f1_0,0,0},{0,f1_0,0},{0,0,f1_0}},f1_0};
73 editor_view RightView = {3,1, NULL, i2f(100),{{0,0,f1_0},{0,f1_0,0},{f1_0,0,0}},f1_0};
74 #endif
75
76
77 editor_view *Views[] = {&LargeView,
78 #if ORTHO_VIEWS
79         &TopView,&FrontView,&RightView
80 #endif
81         };
82
83 int N_views = (sizeof(Views) / sizeof(*Views));
84
85 int     Lock_view_to_cursegp = 1;               // !0 means whenever cursegp changes, view it
86
87 int     Num_tilings = 1;                                        // Number of tilings per wall
88
89 short Cur_object_index = -1;
90
91 // The current robot type
92 int Cur_robot_type = 0;
93
94 //      !0 if a degenerate segment has been found.
95 int     Degenerate_segment_found=0;
96