2006-03-20 16:43:15 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
2010-12-24 04:26:24 +00:00
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
2006-03-20 16:43:15 +00:00
|
|
|
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
2010-12-24 04:26:24 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Globals for editor.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "inferno.h"
|
|
|
|
#include "segment.h"
|
2013-12-26 22:21:16 +00:00
|
|
|
#include "object.h"
|
2006-03-20 16:43:15 +00:00
|
|
|
#include "editor.h"
|
2013-12-11 23:59:36 +00:00
|
|
|
#include "editor/esegment.h"
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
// Global pointer to current vertices, right now always Vertices. Set in create_new_mine.
|
2012-04-16 08:53:32 +00:00
|
|
|
segment *Cursegp = NULL; // Pointer to current segment in mine.
|
2010-12-24 04:26:24 +00:00
|
|
|
int Curside; // Side index in 0..MAX_SIDES_PER_SEGMENT of active side.
|
|
|
|
int Curedge; // Current edge on current side, in 0..3
|
|
|
|
int Curvert; // Current vertex on current side, in 0..3
|
|
|
|
int AttachSide = WFRONT; // Side on segment to attach.
|
2012-04-16 08:53:32 +00:00
|
|
|
segment *Markedsegp = NULL; // Marked segment, used in conjunction with *Cursegp to form joints.
|
2010-12-24 04:26:24 +00:00
|
|
|
int Markedside; // Marked side on Markedsegp.
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2010-12-24 04:26:24 +00:00
|
|
|
int Draw_all_segments; // Set to 1 means draw_world draws all segments in Segments, else draw only connected segments
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2015-02-14 22:48:28 +00:00
|
|
|
array<uint8_t, MAX_VERTICES> Vertex_active; // !0 means vertex is in use, 0 means not in use.
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2013-12-11 23:59:36 +00:00
|
|
|
selected_segment_array_t Selected_segs; // List of segment numbers currently selected
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2013-12-11 23:59:36 +00:00
|
|
|
warning_segment_array_t Warning_segs; // List of segment numbers currently selected
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2013-12-11 23:59:36 +00:00
|
|
|
found_segment_array_t Found_segs; // List of warning-worthy segments
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2010-12-24 04:26:24 +00:00
|
|
|
int Show_axes_flag = 0; // 0 = don't show, !0 = do show coordinate axes in *Cursegp orientation
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
// Variables global to this editor.c and the k?????.c files.
|
|
|
|
uint Update_flags = UF_ALL; //force total redraw
|
2010-12-24 04:26:24 +00:00
|
|
|
int Funky_chase_mode = 0;
|
|
|
|
vms_angvec Seg_orientation = {0,0,0};
|
2014-08-22 02:27:13 +00:00
|
|
|
vms_vector Seg_scale{F1_0*20,F1_0*20,F1_0*20};
|
2006-03-20 16:43:15 +00:00
|
|
|
int mine_changed = 0;
|
|
|
|
int ModeFlag;
|
|
|
|
editor_view *current_view;
|
|
|
|
|
2010-12-24 04:26:24 +00:00
|
|
|
int SegSizeMode = 1; // Mode = 0/1 = not/is legal to move bound vertices,
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
//the view for the different windows.
|
2013-01-12 18:40:53 +00:00
|
|
|
editor_view LargeView = {0,1, NULL, i2f(100),IDENTITY_MATRIX,f1_0};
|
2006-03-20 16:43:15 +00:00
|
|
|
#if ORTHO_VIEWS
|
|
|
|
editor_view TopView = {1,1, NULL, i2f(100),{{f1_0,0,0},{0,0,-f1_0},{0,f1_0,0}},f1_0};
|
|
|
|
editor_view FrontView = {2,1, NULL, i2f(100),{{f1_0,0,0},{0,f1_0,0},{0,0,f1_0}},f1_0};
|
|
|
|
editor_view RightView = {3,1, NULL, i2f(100),{{0,0,f1_0},{0,f1_0,0},{f1_0,0,0}},f1_0};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2012-11-11 00:12:17 +00:00
|
|
|
editor_view *Views[ORTHO_VIEWS ? 4 : 1] = {&LargeView,
|
2006-03-20 16:43:15 +00:00
|
|
|
#if ORTHO_VIEWS
|
|
|
|
&TopView,&FrontView,&RightView
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
int N_views = (sizeof(Views) / sizeof(*Views));
|
|
|
|
|
|
|
|
int Lock_view_to_cursegp = 1; // !0 means whenever cursegp changes, view it
|
|
|
|
|
|
|
|
int Num_tilings = 1; // Number of tilings per wall
|
|
|
|
|
2013-12-29 04:28:07 +00:00
|
|
|
objnum_t Cur_object_index = object_none;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2010-12-24 04:26:24 +00:00
|
|
|
// The current object type and id
|
|
|
|
short Cur_object_type = 4; // OBJ_PLAYER
|
|
|
|
short Cur_object_id = 0;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
// !0 if a degenerate segment has been found.
|
|
|
|
int Degenerate_segment_found=0;
|
|
|
|
|