| 1 |
/* |
| 2 |
* Descent 3 |
| 3 |
* Copyright (C) 2024 Parallax Software |
| 4 |
* |
| 5 |
* This program is free software: you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation, either version 3 of the License, or |
| 8 |
* (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
--- HISTORICAL COMMENTS FOLLOW --- |
| 19 |
|
| 20 |
* $Logfile: /DescentIII/Main/editor/EDVARS.cpp $ |
| 21 |
* $Revision: 1.1.1.1 $ |
| 22 |
* $Date: 2003-08-26 03:57:38 $ |
| 23 |
* $Author: kevinb $ |
| 24 |
* |
| 25 |
* Misc. variables for the editor |
| 26 |
* |
| 27 |
* $Log: not supported by cvs2svn $ |
| 28 |
* |
| 29 |
* 22 9/04/98 12:29p Matt |
| 30 |
* Added marked edge & vertex in the editor |
| 31 |
* |
| 32 |
* 21 6/17/98 12:30p Samir |
| 33 |
* don't draw wireframe when moving an object. |
| 34 |
* |
| 35 |
* 20 6/09/98 6:11p Matt |
| 36 |
* Removed unused variable |
| 37 |
* |
| 38 |
* 19 1/26/98 4:33p Samir |
| 39 |
* Added ability to copy object ids. |
| 40 |
* |
| 41 |
* 18 1/21/98 12:32p Matt |
| 42 |
* Revamped viewer system |
| 43 |
* |
| 44 |
* 17 1/02/98 6:38p Matt |
| 45 |
* Got rid of Render_viewport |
| 46 |
* |
| 47 |
* 16 12/29/97 5:45p Samir |
| 48 |
* Adder reference to Render viewport. |
| 49 |
* |
| 50 |
* 15 12/02/97 5:30p Samir |
| 51 |
* New file dialog interface implemented. |
| 52 |
* |
| 53 |
* 14 12/02/97 4:43p Samir |
| 54 |
* Repaired EDVARS.cpp |
| 55 |
* |
| 56 |
* 13 12/01/97 6:06p Samir |
| 57 |
* Implemented new FileDialog tracker system. |
| 58 |
* |
| 59 |
* 12 9/17/97 1:01p Matt |
| 60 |
* Ripped out segment code |
| 61 |
* |
| 62 |
* 11 9/17/97 11:16a Matt |
| 63 |
* Ripped out segment code |
| 64 |
* |
| 65 |
* 10 9/11/97 5:38p Jason |
| 66 |
* initial door coding for room engine |
| 67 |
* |
| 68 |
* 9 9/06/97 3:16p Matt |
| 69 |
* Added current portal system |
| 70 |
* |
| 71 |
* 8 9/04/97 4:39p Matt |
| 72 |
* Added includes needed as a result of removing includes from d3edit.h |
| 73 |
* |
| 74 |
* 7 8/29/97 5:23p Matt |
| 75 |
* Added Placed_group |
| 76 |
* |
| 77 |
* 6 8/18/97 6:59p Matt |
| 78 |
* Implemented Place Room/Attach room system |
| 79 |
* |
| 80 |
* 5 7/22/97 7:07p Matt |
| 81 |
* Cleaned up D3EditState, moving some vars in and some out, and renaming |
| 82 |
* and changing a few others |
| 83 |
* |
| 84 |
* 4 !/97 7:21p Matt |
| 85 |
* Added var for current level script |
| 86 |
* |
| 87 |
* 13 4/02/97 8:07p Matt |
| 88 |
* Added variable & button to toggle object move state |
| 89 |
* |
| 90 |
* 12 4/02/97 3:25p Jason |
| 91 |
* got rid of WV_changed and made TV_changed update the textured view and |
| 92 |
* flag "World_changed" |
| 93 |
* |
| 94 |
* 11 3/31/97 5:57p Matt |
| 95 |
* Revamped mine update flags |
| 96 |
* |
| 97 |
* 10 3/31/97 3:47p Matt |
| 98 |
* Added code to keep track of, render, and display current vertex. |
| 99 |
* |
| 100 |
* 9 3/17/97 12:24a Matt |
| 101 |
* Added warning segs list |
| 102 |
* |
| 103 |
* 8 3/12/97 3:27p Matt |
| 104 |
* Added scrap buffer |
| 105 |
* |
| 106 |
* 7 3/11/97 2:54p Samir |
| 107 |
* Add some vars useful for rotation of segments. |
| 108 |
* |
| 109 |
* 6 2/28/97 6:37p Matt |
| 110 |
* Added variable & toggle button for box selection mode |
| 111 |
* |
| 112 |
* 5 2/28/97 12:11p Matt |
| 113 |
* Added vars for selected seg list |
| 114 |
* |
| 115 |
* 4 2/24/97 5:51p Matt |
| 116 |
* Added vars for Markedsegp & Markedside |
| 117 |
* |
| 118 |
* 3 2/10/97 5:36p Matt |
| 119 |
* Added a couple more vars |
| 120 |
* |
| 121 |
* 2 2/07/97 6:01p Matt |
| 122 |
* Added Mine_changed |
| 123 |
* |
| 124 |
*/ |
| 125 |
|
| 126 |
#include "d3edit.h" |
| 127 |
#include "room.h" |
| 128 |
|
| 129 |
// Current room, face, edge, & vert. |
| 130 |
room *Curroomp = NULL; |
| 131 |
int Curface = 0, Curedge = 0, Curvert = 0, Curportal = -1; |
| 132 |
|
| 133 |
// Marked room & face |
| 134 |
room *Markedroomp = NULL; |
| 135 |
int Markedface = 0, Markededge = 0, Markedvert = 0; |
| 136 |
|
| 137 |
// Placed room info |
| 138 |
int Placed_door = -1; |
| 139 |
int Placed_room = -1; |
| 140 |
group *Placed_group = NULL; |
| 141 |
int Placed_room_face; |
| 142 |
float Placed_room_angle; |
| 143 |
vector Placed_room_origin; |
| 144 |
matrix Placed_room_orient; |
| 145 |
matrix Placed_room_rotmat; |
| 146 |
vector Placed_room_attachpoint; |
| 147 |
room *Placed_baseroomp; |
| 148 |
int Placed_baseface; |
| 149 |
|
| 150 |
// flags for the wireframe and textured views changed |
| 151 |
int TV_changed = 1; |
| 152 |
|
| 153 |
// Set this flag if a new world is loaded/created |
| 154 |
int New_mine = 1; // init to 1 for initial redraw |
| 155 |
|
| 156 |
// Set this when the mine has changed |
| 157 |
int World_changed = 0; |
| 158 |
|
| 159 |
// Set this when the editor state (but not the world itself) has changed |
| 160 |
int State_changed = 0; |
| 161 |
|
| 162 |
// Set this when the viewer (i.e., player) has moved |
| 163 |
int Viewer_moved = 0; |
| 164 |
|
| 165 |
// Set this when the editor viewpoint has changed |
| 166 |
int Edview_changed = 0; |
| 167 |
|
| 168 |
// Set this when an object has moved |
| 169 |
int Object_moved = 0; |
| 170 |
|
| 171 |
// Vars for the list of selected rooms |
| 172 |
int N_selected_rooms = 0; |
| 173 |
int Selected_rooms[MAX_ROOMS]; |
| 174 |
|
| 175 |
// Flag for if mine has changed (& thus needs to be saved) |
| 176 |
int Mine_changed; |
| 177 |
|
| 178 |
// Current object |
| 179 |
int Cur_object_index = 0; |
| 180 |
|
| 181 |
// How does object movement work? |
| 182 |
int Object_move_mode = REL_OBJECT; |
| 183 |
|
| 184 |
// The scrap buffer |
| 185 |
group *Scrap = NULL; |
| 186 |
|
| 187 |
// Pointer to the scripts for this level |
| 188 |
char *Current_level_script = NULL; |
| 189 |
|
| 190 |
// What mode we're currently in |
| 191 |
int Editor_view_mode = VM_MINE; |
| 192 |
|
| 193 |
// The ID of the most recent viewer object (not counting room view) |
| 194 |
int Editor_viewer_id = -1; |
| 195 |
|
| 196 |
// current directories for a number of file dialogs |
| 197 |
char Current_files_dir[_MAX_PATH] = ""; |
| 198 |
char Current_bitmap_dir[_MAX_PATH] = ""; |
| 199 |
char Current_room_dir[_MAX_PATH] = ""; |
| 200 |
char Current_scrap_dir[_MAX_PATH] = ""; |
| 201 |
char Current_model_dir[_MAX_PATH] = ""; |
| 202 |
char Current_sounds_dir[_MAX_PATH] = ""; |
| 203 |
char Current_weapon_dir[_MAX_PATH] = ""; |
| 204 |
|
| 205 |
// Object ID clipboard |
| 206 |
int Copied_object_id = 0; |