Debian Codegraph @

Descent3/room_external.h

raw symbols SCIP
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/room_external.h $
21 * $Revision: 21 $
22 * $Date: 10/21/99 1:32p $
23 * $Author: Jeff $
24 *
25 * Defines and structs for room definitions (for DLL export)
26 *
27 * $Log: /DescentIII/main/room_external.h $
28 *
29 * 21 10/21/99 1:32p Jeff
30 * added checkbox to prevent certain rooms from lighting
31 *
32 * 20 4/28/99 1:39p Chris
33 * Added the ability to block portals
34 *
35 * 19 4/26/99 11:11a Chris
36 * Updated Bnode system
37 *
38 * 18 4/18/99 5:39a Chris
39 * Vastly improved the path node system
40 *
41 * 17 4/15/99 5:49p Chris
42 * Fixed a bug with rendering the BOAPath nodes
43 *
44 * 16 4/15/99 12:20p Jason
45 * made mirrors more robust and able to have multiple mirrored faces in
46 * the same room (as long as they are all on the same plane)
47 *
48 * 15 4/14/99 3:13p Chris
49 * Beginning to add BoaNode stuff
50 *
51 * 14 4/14/99 11:40a Jason
52 * added secret flag
53 *
54 * 13 4/05/99 10:54a Matt
55 * Added auto-waypoint system
56 *
57 * 12 3/31/99 5:14p Matt
58 * Added shell flag for faces
59 *
60 * 11 3/11/99 1:08p Jason
61 * more fixes for smooth specular lighting
62 *
63 * 10 3/01/99 8:10p Matt
64 * Added flag for manually-set path points
65 *
66 * 9 2/21/99 4:35p Chris
67 * Improving the level goal system... Not done.
68 *
69 * 8 2/19/99 4:26p Jason
70 * more work on Katmai support
71 *
72 * 7 2/09/99 9:59a Chris
73 * Massive BOA update :) Terrain happy now. Vis happy now. Sound happy
74 * now.
75 *
76 * 6 2/03/99 5:49p Matt
77 * Added room damage system
78 *
79 * 5 2/03/99 4:26p Jason
80 * made multiplayer coop actually work!
81 *
82 * 4 2/01/99 4:17p Jason
83 * more changes for multisafe
84 *
85 * 3 1/29/99 12:48p Matt
86 * Rewrote the doorway system
87 *
88 * 2 1/21/99 11:15p Jeff
89 * pulled out some structs and defines from header files and moved them
90 * into seperate header files so that multiplayer dlls don't require major
91 * game headers, just those new headers. Side effect is a shorter build
92 * time. Also cleaned up some header file #includes that weren't needed.
93 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
94 * manage.h and multi.h
95 *
96 * $NoKeywords: $
97 */
98
99 #ifndef _ROOM_EXTERNAL_H_
100 #define _ROOM_EXTERNAL_H_cxx . . $ `Descent3/room_external.h:100:9`!
101
102 #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/
103 #include "vecmat_external.h"cxx . . $ `<file>/lib/vecmat_external.h`/
104 #include "bnode.h"cxx . . $ `<file>/Descent3/bnode.h`/
105
106 #define MAX_FACES_PER_ROOMcxx . . $ `Descent3/room_external.h:106:9`! 3000 // max number of faces per room
107 #define MAX_VERTS_PER_ROOMcxx . . $ `Descent3/room_external.h:107:9`! 10000 // max vertices per room
108 #define MAX_VERTS_PER_FACEcxx . . $ `Descent3/room_external.h:108:9`! 64 // max vertices per face
109
110 // Face flags
111 // NOTE: If you add a flag here, please check the function CopyFaceFlags()
112 #define FF_LIGHTMAPcxx . . $ `Descent3/room_external.h:112:9`! 0x0001 // Render this face with a lightmap on top
113 #define FF_VERTEX_ALPHAcxx . . $ `Descent3/room_external.h:113:9`! 0x0002 // This face has vertex alpha blending
114 #define FF_CORONAcxx . . $ `Descent3/room_external.h:114:9`! 0x0004 // This face has a lighting corona
115 #define FF_TEXTURE_CHANGEDcxx . . $ `Descent3/room_external.h:115:9`! 0x0008 // The texture on this face has changed
116 #define FF_HAS_TRIGGERcxx . . $ `Descent3/room_external.h:116:9`! 0x0010 // This face has a trigger
117 #define FF_SPEC_INVISIBLEcxx . . $ `Descent3/room_external.h:117:9`! 0x0020 // This face needs to be not rendered during specularity pass
118 #define FF_FLOATING_TRIGcxx . . $ `Descent3/room_external.h:118:9`! 0x0040 // This face only exists as a floating trigger
119 #define FF_DESTROYEDcxx . . $ `Descent3/room_external.h:119:9`! 0x0080 // This face has been blown up
120 #define FF_VOLUMETRICcxx . . $ `Descent3/room_external.h:120:9`! 0x0100 // This face is a volumetric face
121 #define FF_TRIANGULATEDcxx . . $ `Descent3/room_external.h:121:9`! 0x0200 // ??
122 #define FF_VISIBLEcxx . . $ `Descent3/room_external.h:122:9`! 0x0400 // This face is visible this frame (Valid only during render)
123 #define FF_NOT_SHELLcxx . . $ `Descent3/room_external.h:123:9`! 0x0800 // This face is not part of the room shell
124 #define FF_TOUCHEDcxx . . $ `Descent3/room_external.h:124:9`! 0x1000 // This face has been touched by fvi_QuickDistFaceList
125 #define FF_GOALFACEcxx . . $ `Descent3/room_external.h:125:9`! 0x2000 // This face is a goal texture face
126 #define FF_NOT_FACINGcxx . . $ `Descent3/room_external.h:126:9`! 0x4000 // This face is not facing us this frame (Valid only during render)
127 #define FF_SCORCHEDcxx . . $ `Descent3/room_external.h:127:9`! 0x8000 // This face has one or more scorch marks
128 // NOTE: If you add a flag here, please check the function CopyFaceFlags()
129
130 // UVLs for room verts
131 struct roomUVLcxx . . $ roomUVL# {
132 float ucxx . . $ roomUVL#u., vcxx . . $ roomUVL#v.; // texture coordinates
133 float u2cxx . . $ roomUVL#u2., v2cxx . . $ roomUVL#v2.;
134 uint8_tcxx . . $ uint8_t# alphacxx . . $ roomUVL#alpha.; // alpha for this vertex
135 };
136
137 // an n-sided polygon used as part of a room or portal
138 struct facecxx . . $ face# {
139 uint16_tcxx . . $ uint16_t# flagscxx . . $ face#flags.; // flags for this face (see above)
140 uint8_tcxx . . $ uint8_t# num_vertscxx . . $ face#num_verts.; // how many vertices in this face
141 int8_tcxx . . $ int8_t# portal_numcxx . . $ face#portal_num.; // which portal this face is part of, or -1 if none
142
143 int16_tcxx . . $ int16_t# *face_vertscxx . . $ face#face_verts.; // index into list of vertices for this face
144 roomUVLcxx . . $ roomUVL# *face_uvlscxx . . $ face#face_uvls.; // index into list of uvls for this face
145 vectorcxx . . $ vector# normalcxx . . $ face#normal.; // the surface normal of this face
146 int16_tcxx . . $ int16_t# tmapcxx . . $ face#tmap.; // texture numbers for this face
147 uint16_tcxx . . $ uint16_t# lmi_handlecxx . . $ face#lmi_handle.; // the lightmap info number for this face
148 int16_tcxx . . $ int16_t# special_handlecxx . . $ face#special_handle.; // the index into the special_faces array
149 uint8_tcxx . . $ uint8_t# renderframecxx . . $ face#renderframe.; // what frame this face was last rendered (for lighting)
150 uint8_tcxx . . $ uint8_t# light_multiplecxx . . $ face#light_multiple.; // what multiple to times by
151 vectorcxx . . $ vector# min_xyzcxx . . $ face#min_xyz., max_xyzcxx . . $ face#max_xyz.; // min & max extents of this face (for FVI)
152 };
153
154 // Portal flags
155 #define PF_RENDER_FACEScxx . . $ `Descent3/room_external.h:155:9`! 1 // render the face(s) in the portal
156 #define PF_RENDERED_FLYTHROUGHcxx . . $ `Descent3/room_external.h:156:9`! 2 // allow flythrough of rendered faces
157 #define PF_TOO_SMALL_FOR_ROBOTcxx . . $ `Descent3/room_external.h:157:9`! 4 // Too small for a robot to use for path following (like a small window)
158 #define PF_COMBINEDcxx . . $ `Descent3/room_external.h:158:9`! 8 // This portal has been combined with another for rendering purposes
159 #define PF_CHANGEDcxx . . $ `Descent3/room_external.h:159:9`! 16 // Used for multiplayer - this portal has been changed
160 #define PF_BLOCKcxx . . $ `Descent3/room_external.h:160:9`! 32
161 #define PF_BLOCK_REMOVABLEcxx . . $ `Descent3/room_external.h:161:9`! 64
162
163 // a connection between two rooms
164 struct portalcxx . . $ portal# {
165 int flagscxx . . $ portal#flags.; // flags for this portal
166 int16_tcxx . . $ int16_t# portal_facecxx . . $ portal#portal_face.; // the face for this portal
167 int16_tcxx . . $ int16_t# croomcxx . . $ portal#croom.; // the room this portal connects to
168 int16_tcxx . . $ int16_t# cportalcxx . . $ portal#cportal.; // the portal in croom this portal connects to
169 int16_tcxx . . $ int16_t# bnode_indexcxx . . $ portal#bnode_index.;
170 int combine_mastercxx . . $ portal#combine_master.; // For rendering combined portals
171 vectorcxx . . $ vector# path_pntcxx . . $ portal#path_pnt.; // Point used by the path system
172 };
173
174 // Room flags
175 #define RF_FUELCENcxx . . $ `Descent3/room_external.h:175:9`! 1 // room is a refueling center
176 #define RF_DOORcxx . . $ `Descent3/room_external.h:176:9`! (1 << 1) // a 3d door is here.
177 #define RF_EXTERNALcxx . . $ `Descent3/room_external.h:177:9`! (1 << 2) // this is an external room (i.e. a building)
178 #define RF_GOAL1cxx . . $ `Descent3/room_external.h:178:9`! (1 << 3) // this room is goal 1
179 #define RF_GOAL2cxx . . $ `Descent3/room_external.h:179:9`! (1 << 4) // this room is goal 2
180 #define RF_TOUCHES_TERRAINcxx . . $ `Descent3/room_external.h:180:9`! (1 << 5) // this room should recieve lighting from satellites
181 #define RF_SORTED_INC_Ycxx . . $ `Descent3/room_external.h:181:9`! (1 << 6) // Faces are sorted with increasing y
182 #define RF_GOAL3cxx . . $ `Descent3/room_external.h:182:9`! (1 << 7) // this room is goal 3
183 #define RF_GOAL4cxx . . $ `Descent3/room_external.h:183:9`! (1 << 8) // this room is goal 4
184 #define RF_FOGcxx . . $ `Descent3/room_external.h:184:9`! (1 << 9) // this room is fogged
185 #define RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`! (1 << 10) // This room is a special room
186 #define RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`! (1 << 11) // This room is a special room
187 #define RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`! (1 << 12) // This room is a special room
188 #define RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`! (1 << 13) // This room is a special room
189 #define RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`! (1 << 14) // This room is a special room
190 #define RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`! (1 << 15) // This room is a special room
191 #define RF_MIRROR_VISIBLEcxx . . $ `Descent3/room_external.h:191:9`! (1 << 16) // The mirror is this room is visible
192 #define RF_TRIANGULATEcxx . . $ `Descent3/room_external.h:192:9`! (1 << 17) // All the faces in this room should be drawn with triagulation on
193 #define RF_STROBEcxx . . $ `Descent3/room_external.h:193:9`! (1 << 18) // This room strobes with pulse lighting
194 #define RF_FLICKERcxx . . $ `Descent3/room_external.h:194:9`! (1 << 19) // This room flickers with pulse lighting
195 #define RFM_MINEcxx . . $ `Descent3/room_external.h:195:9`! \
196 ((1 << 20) | (1 << 21) | (1 << 22) | (1 << 23) | \
197 (1 << 24)) // Mine index of this room (we support up to 32 individual mines without a problem)
198 #define RF_INFORM_RELINK_TO_LGcxx . . $ `Descent3/room_external.h:198:9`! (1 << 25) // Informs the level goal system on player relinking to this room
199 #define RF_MANUAL_PATH_PNTcxx . . $ `Descent3/room_external.h:199:9`! (1 << 26) // The room path_pnt has been set manually (i.e. by the designer)
200 #define RF_WAYPOINTcxx . . $ `Descent3/room_external.h:200:9`! (1 << 27) // This room has a waypoint in it
201 #define RF_SECRETcxx . . $ `Descent3/room_external.h:201:9`! (1 << 28) // This room is a secret room
202 #define RF_NO_LIGHTcxx . . $ `Descent3/room_external.h:202:9`! (1 << 29) // This room does not get lit
203
204 #define GOALROOMcxx . . $ `Descent3/room_external.h:204:9`! (RF_GOAL1 | RF_GOAL2 | RF_GOAL3 | RF_GOAL4)
205
206 #define ROOM_NAME_LENcxx . . $ `Descent3/room_external.h:206:9`! 19 // how long a room name can be (not counting null terminator)
207
208 struct doorwaycxx . . $ doorway#;
209
210 // the basic building-block of a Descent 3 level
211 struct roomcxx . . $ room# {
212 int flagscxx . . $ room#flags.; // various room flags
213
214 int num_facescxx . . $ room#num_faces.; // how many poygons in this room
215 int num_portalscxx . . $ room#num_portals.; // how many connections in this room
216 int num_vertscxx . . $ room#num_verts.; // how many verts in the room
217 facecxx . . $ face# *facescxx . . $ room#faces.; // pointer to list of faces
218 portalcxx . . $ portal# *portalscxx . . $ room#portals.; // pointer to list of portals
219 vectorcxx . . $ vector# *vertscxx . . $ room#verts.; // array of vertices for this room
220 vector4cxx . . $ vector4# *verts4cxx . . $ room#verts4.; // array of 16byte vertices for this room
221
222 doorwaycxx . . $ doorway# *doorway_datacxx . . $ room#doorway_data.; // pointer to this room's doorway data, or NULL if not a doorway
223 char *namecxx . . $ room#name.; // name of this room, or NULL
224 int objectscxx . . $ room#objects.; // index of first object in this room
225 vectorcxx . . $ vector# max_xyzcxx . . $ room#max_xyz., min_xyzcxx . . $ room#min_xyz.; // for external room visibility checking
226
227 float last_render_timecxx . . $ room#last_render_time.; // Last time we rendered this room
228
229 // Hierarchical bounding boxes for this room
230 vectorcxx . . $ vector# bbf_min_xyzcxx . . $ room#bbf_min_xyz.;
231 vectorcxx . . $ vector# bbf_max_xyzcxx . . $ room#bbf_max_xyz.;
232 int16_tcxx . . $ int16_t# num_bbf_regionscxx . . $ room#num_bbf_regions.;
233 int16_tcxx . . $ int16_t# pad1cxx . . $ room#pad1.;
234 int16_tcxx . . $ int16_t# **bbf_listcxx . . $ room#bbf_list.;
235 int16_tcxx . . $ int16_t# *num_bbfcxx . . $ room#num_bbf.;
236 vectorcxx . . $ vector# *bbf_list_min_xyzcxx . . $ room#bbf_list_min_xyz.;
237 vectorcxx . . $ vector# *bbf_list_max_xyzcxx . . $ room#bbf_list_max_xyz.;
238 uint8_tcxx . . $ uint8_t# *bbf_list_sectorcxx . . $ room#bbf_list_sector.;
239
240 bn_listcxx . . $ bn_list# bn_infocxx . . $ room#bn_info.;
241
242 int16_tcxx . . $ int16_t# wpb_indexcxx . . $ room#wpb_index.; // world point buffer index - where this room starts
243 uint8_tcxx . . $ uint8_t# pulse_timecxx . . $ room#pulse_time.; // each room can has a pulse time
244 uint8_tcxx . . $ uint8_t# pulse_offsetcxx . . $ room#pulse_offset.; // each room has a timer offset for which it pulses
245 vectorcxx . . $ vector# windcxx . . $ room#wind.; // Wind vector for the room
246 int ambient_soundcxx . . $ room#ambient_sound.; // Index of ambient sound pattern for this room, or -1 if none
247 int16_tcxx . . $ int16_t# vis_effectscxx . . $ room#vis_effects.; // index of first visual effect in this room
248 int16_tcxx . . $ int16_t# mirror_facecxx . . $ room#mirror_face.; // Index of face that this room is to be mirrored by
249 uint8_tcxx . . $ uint8_t# num_mirror_facescxx . . $ room#num_mirror_faces.; // Number of faces in this room that have the same texture as the mirror
250 uint16_tcxx . . $ uint16_t# *mirror_faces_listcxx . . $ room#mirror_faces_list.; // the list of faces in this room that have the same texture as the mirror
251 float damagecxx . . $ room#damage.; // The damage per second applied to players (& maybe others) in room
252
253 vectorcxx . . $ vector# path_pntcxx . . $ room#path_pnt.; // Point used by the path system
254 uint8_tcxx . . $ uint8_t# *volume_lightscxx . . $ room#volume_lights.; // Pointer to memory for our volumetric lighting
255 int16_tcxx . . $ int16_t# volume_widthcxx . . $ room#volume_width.; // The dimensions of our volumetric room
256 int16_tcxx . . $ int16_t# volume_heightcxx . . $ room#volume_height.;
257 int16_tcxx . . $ int16_t# volume_depthcxx . . $ room#volume_depth.;
258 float fog_depthcxx . . $ room#fog_depth.; // How far until fog is totally opaque
259 float fog_rcxx . . $ room#fog_r., fog_gcxx . . $ room#fog_g., fog_bcxx . . $ room#fog_b.; // Fog color
260
261 uint8_tcxx . . $ uint8_t# env_reverbcxx . . $ room#env_reverb.; // environmental reverb preset
262 uint8_tcxx . . $ uint8_t# room_change_flagscxx . . $ room#room_change_flags.; // For multiplayer, detects what characteristics have to be sent
263 uint8_tcxx . . $ uint8_t# damage_typecxx . . $ room#damage_type.; // What type of damage this rooms does (for sound) if damage > 0
264 uint8_tcxx . . $ uint8_t# usedcxx . . $ room#used.; // is this room holding data?
265
266 };
267
268 #endif