1 /* $Id: eglobal.c,v 1.2 2004-12-19 14:52:48 btb Exp $ */
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.
22 static char rcsid[] = "$Id: eglobal.c,v 1.2 2004-12-19 14:52:48 btb Exp $";
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.
40 int Draw_all_segments; // Set to 1 means draw_world draws all segments in Segments, else draw only connected segments
42 sbyte Vertex_active[MAX_VERTICES]; // !0 means vertex is in use, 0 means not in use.
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
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
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
53 int Show_axes_flag=0; // 0 = don't show, !0 = do show coordinate axes in *Cursegp orientation
55 sbyte Been_visited[MAX_SEGMENTS]; // List of segments visited in a recursive search, if element n set, segment n done been visited
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};
64 editor_view *current_view;
66 int SegSizeMode = 1; // Mode = 0/1 = not/is legal to move bound vertices,
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};
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};
77 editor_view *Views[] = {&LargeView,
79 &TopView,&FrontView,&RightView
83 int N_views = (sizeof(Views) / sizeof(*Views));
85 int Lock_view_to_cursegp = 1; // !0 means whenever cursegp changes, view it
87 int Num_tilings = 1; // Number of tilings per wall
89 short Cur_object_index = -1;
91 // The current robot type
92 int Cur_robot_type = 0;
94 // !0 if a degenerate segment has been found.
95 int Degenerate_segment_found=0;