]> icculus.org git repositories - btb/d2x.git/blob - main/editor/eglobal.c
more header cleanup
[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
26 #include "inferno.h"
27 #include "editor.h"
28
29
30 // Global pointer to current vertices, right now always Vertices.  Set in create_new_mine.
31 // segment New_segment;  // segment which can be added to the mine. // replaced by a macro
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 object type and id
92 short Cur_object_type = 4;      // OBJ_PLAYER
93 short Cur_object_id = 0;
94
95 //      !0 if a degenerate segment has been found.
96 int     Degenerate_segment_found=0;
97