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