0
|
1 #pragma once
|
|
2 #include "VectorTypes.h"
|
|
3 #include "IndoorCameraD3D.h"
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8 /* 319 */
|
|
9 enum LEVEL_TYPE
|
|
10 {
|
3
|
11 LEVEL_null = 0,
|
0
|
12 LEVEL_Indoor = 0x1,
|
|
13 LEVEL_Outdoor = 0x2,
|
|
14 };
|
|
15 extern LEVEL_TYPE uCurrentlyLoadedLevelType;
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21 /* 74 */
|
|
22 #pragma pack(push, 1)
|
|
23 struct LevelDecoration
|
|
24 {
|
|
25 LevelDecoration();
|
|
26 int GetGlobalEvent();
|
|
27 int IsInteractive();
|
|
28 bool _47A825();
|
|
29
|
|
30
|
|
31 unsigned __int16 uDecorationDescID;
|
|
32 __int16 field_2;
|
|
33 struct Vec3_int_ vPosition;
|
|
34 int field_10_y_rot;
|
|
35 __int16 uCog;
|
|
36 __int16 field_16_event_id;
|
|
37 __int16 field_18;
|
|
38 __int16 field_1A;
|
|
39 __int16 field_1C;
|
|
40 __int16 field_1E;
|
|
41 };
|
|
42 #pragma pack(pop)
|
|
43 extern LevelDecoration pLevelDecorations[3000];
|
|
44 extern size_t uNumLevelDecorations;
|
|
45 extern LevelDecoration *_5C3420_pDecoration;
|
|
46
|
|
47
|
|
48
|
|
49
|
|
50
|
|
51
|
|
52
|
|
53
|
|
54 /* 86 */
|
|
55 #pragma pack(push, 1)
|
|
56 struct SpawnPointMM6
|
|
57 {
|
|
58 Vec3_int_ vPosition;
|
|
59 unsigned __int16 uRadius;
|
|
60 unsigned __int16 uKind;
|
|
61 unsigned __int16 uIndex;
|
|
62 unsigned __int16 uAttributes;
|
|
63 };
|
|
64 #pragma pack(pop)
|
|
65
|
|
66
|
|
67
|
|
68 /* 102 */
|
|
69 #pragma pack(push, 1)
|
|
70 struct SpawnPointMM7
|
|
71 {
|
|
72 //----- (00448DD6) --------------------------------------------------------
|
|
73 SpawnPointMM7()
|
|
74 {
|
|
75 uRadius = 32;
|
|
76 uAttributes = 0;
|
|
77 uIndex = 0;
|
|
78 uKind = 0;
|
|
79 uGroup = 0;
|
|
80 }
|
|
81
|
|
82
|
|
83 Vec3_int_ vPosition;
|
|
84 unsigned __int16 uRadius;
|
|
85 unsigned __int16 uKind;
|
|
86 unsigned __int16 uIndex;
|
|
87 unsigned __int16 uAttributes;
|
|
88 unsigned int uGroup;
|
|
89 };
|
|
90 #pragma pack(pop)
|
|
91
|
|
92
|
|
93
|
|
94
|
|
95
|
|
96
|
|
97
|
|
98
|
|
99
|
|
100
|
|
101 #pragma pack(push, 1)
|
|
102 struct DDM_DLV_Header
|
|
103 {
|
|
104 //----- (00462607) --------------------------------------------------------
|
|
105 inline DDM_DLV_Header()
|
|
106 {
|
|
107 this->uLastRepawnDay = 0;
|
|
108 this->uNumRespawns = 0;
|
|
109 this->uReputation = 0;
|
|
110 this->field_C_alert = 0;
|
|
111 this->uNumFacesInBModels = 0;
|
|
112 this->uNumDecorations = 0;
|
|
113 this->uNumBModels = 0;
|
|
114 }
|
|
115
|
|
116
|
|
117 int uNumRespawns;
|
|
118 int uLastRepawnDay;
|
|
119 int uReputation;
|
|
120 int field_C_alert;
|
|
121 unsigned int uNumFacesInBModels;
|
|
122 unsigned int uNumDecorations;
|
|
123 unsigned int uNumBModels;
|
|
124 int field_1C;
|
|
125 int field_20;
|
|
126 int field_24;
|
|
127 };
|
|
128 #pragma pack(pop)
|
|
129
|
|
130
|
|
131
|
|
132 /* 291 */
|
|
133 enum PolygonType : __int8
|
|
134 {
|
|
135 POLYGON_Invalid = 0x0,
|
|
136 POLYGON_VerticalWall = 0x1,
|
|
137 POLYGON_unk = 0x2,
|
|
138 POLYGON_Floor = 0x3,
|
|
139 POLYGON_InBetweenFloorAndWall = 0x4,
|
|
140 POLYGON_Ceiling = 0x5,
|
|
141 POLYGON_InBetweenCeilingAndWall = 0x6,
|
|
142 };
|
|
143
|
|
144 /* 90 */
|
|
145 #pragma pack(push, 1)
|
|
146 struct BLVHeader
|
|
147 {
|
|
148 char field_0[104];
|
|
149 unsigned int uFaces_fdata_Size;
|
|
150 unsigned int uSector_rdata_Size;
|
|
151 unsigned int uSector_lrdata_Size;
|
|
152 unsigned int uDoors_ddata_Size;
|
|
153 char field_78[16];
|
|
154 };
|
|
155 #pragma pack(pop)
|
|
156
|
|
157
|
|
158
|
|
159 /* 96 */
|
|
160 #pragma pack(push, 1)
|
|
161 struct BLVSectorMM8
|
|
162 {
|
|
163 int dword_000074;
|
|
164 };
|
|
165 #pragma pack(pop)
|
|
166
|
|
167 /* 97 */
|
|
168 #pragma pack(push, 1)
|
|
169 struct BLVLightMM6
|
|
170 {
|
|
171 Vec3_short_ vPosition;
|
|
172 __int16 uRadius;
|
|
173 __int16 uAttributes;
|
|
174 unsigned __int16 uBrightness;
|
|
175 };
|
|
176 #pragma pack(pop)
|
|
177
|
|
178 /* 98 */
|
|
179 #pragma pack(push, 1)
|
|
180 struct BLVLightMM7
|
|
181 {
|
|
182 struct Vec3_short_ vPosition;
|
|
183 __int16 uRadius;
|
|
184 char uRed;
|
|
185 char uGreen;
|
|
186 char uBlue;
|
|
187 char uType;
|
59
|
188 __int16 uAtributes; // & 0x08 doesn't light faces
|
0
|
189 __int16 uBrightness;
|
|
190 };
|
|
191 #pragma pack(pop)
|
|
192
|
|
193 /* 99 */
|
|
194 #pragma pack(push, 1)
|
|
195 struct BLVLightMM8
|
|
196 {
|
|
197 int uID;
|
|
198 };
|
|
199 #pragma pack(pop)
|
|
200
|
29
|
201
|
|
202
|
0
|
203 /* 100 */
|
|
204 #pragma pack(push, 1)
|
|
205 struct BLVDoor
|
|
206 {
|
29
|
207 enum State: unsigned __int16
|
|
208 {
|
|
209 Closed = 0,
|
|
210 Opening = 1,
|
|
211 Open = 2,
|
|
212 Closing = 3
|
|
213 };
|
|
214
|
0
|
215 unsigned int uAttributes;
|
|
216 unsigned int uDoorID;
|
|
217 unsigned int uTimeSinceTriggered;
|
|
218 Vec3_int_ vDirection;
|
|
219 int uMoveLength;
|
|
220 int uOpenSpeed;
|
|
221 int uCloseSpeed;
|
|
222 unsigned __int16 *pVertexIDs;
|
|
223 unsigned __int16 *pFaceIDs;
|
|
224 unsigned __int16 *pSectorIDs;
|
|
225 __int16 *pDeltaUs;
|
|
226 __int16 *pDeltaVs;
|
|
227 unsigned __int16 *pXOffsets;
|
|
228 unsigned __int16 *pYOffsets;
|
|
229 unsigned __int16 *pZOffsets;
|
|
230 unsigned __int16 uNumVertices;
|
|
231 unsigned __int16 uNumFaces;
|
|
232 __int16 field_48;
|
|
233 unsigned __int16 uNumOffsets;
|
29
|
234 State uState;
|
0
|
235 __int16 field_4E;
|
|
236 };
|
|
237 #pragma pack(pop)
|
|
238
|
|
239 /* 101 */
|
|
240 #pragma pack(push, 1)
|
53
|
241 struct BLVMapOutline
|
0
|
242 {
|
|
243 unsigned __int16 uVertex1ID;
|
|
244 unsigned __int16 uVertex2ID;
|
|
245 unsigned __int16 uFace1ID;
|
|
246 unsigned __int16 uFace2ID;
|
|
247 __int16 sZ;
|
|
248 unsigned __int16 uFlags;
|
|
249 };
|
|
250 #pragma pack(pop)
|
|
251
|
|
252
|
59
|
253 #define FACE_TWO_SIDED 0x00000001 // portal/two-sided
|
68
|
254 // 0x02 color is saturated against lights
|
59
|
255 #define FACE_TEXTURE_ANIMATED 0x00000010 // like wavy water
|
|
256 #define FACE_INVISIBLE 0x00002000
|
|
257 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID
|
|
258 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only.
|
|
259 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet.
|
|
260 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet.
|
|
261 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it.
|
0
|
262
|
|
263 /* 93 */
|
|
264 #pragma pack(push, 1)
|
|
265 struct BLVFace
|
|
266 {
|
|
267 //----- (0046ED02) --------------------------------------------------------
|
|
268 inline BLVFace()
|
|
269 {
|
|
270 this->uNumVertices = 0;
|
|
271 this->uAttributes = 0;
|
|
272 this->uFaceExtraID = 0;
|
|
273 this->pVertexIDs = 0;
|
|
274 this->pZInterceptDisplacements = 0;
|
|
275 this->pYInterceptDisplacements = 0;
|
|
276 this->pXInterceptDisplacements = 0;
|
|
277 }
|
|
278
|
|
279 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3);
|
|
280 struct Texture *GetTexture();
|
|
281 void FromODM(struct ODMFace *a2);
|
|
282
|
59
|
283 inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;}
|
|
284 inline bool Visible() const {return !Invisible();}
|
|
285 inline bool TwoSided() const {return uAttributes & FACE_TWO_SIDED;}
|
|
286 inline bool Animated() const {return uAttributes & FACE_TEXTURE_ANIMATED;}
|
77
|
287 inline bool Clickable() const {return uAttributes & FACE_CLICKABLE;}
|
59
|
288
|
0
|
289
|
|
290 struct Plane_float_ pFacePlane;
|
|
291 struct Plane_int_ pFacePlane_old;
|
|
292 int zCalc1;
|
|
293 int zCalc2;
|
|
294 int zCalc3;
|
|
295 unsigned int uAttributes;
|
|
296 unsigned __int16 *pVertexIDs;
|
|
297 unsigned __int16 *pXInterceptDisplacements;
|
|
298 unsigned __int16 *pYInterceptDisplacements;
|
|
299 unsigned __int16 *pZInterceptDisplacements;
|
|
300 unsigned __int16 *pVertexUIDs;
|
|
301 unsigned __int16 *pVertexVIDs;
|
|
302 unsigned __int16 uFaceExtraID;
|
|
303 unsigned __int16 uBitmapID;
|
|
304 unsigned __int16 uSectorID;
|
|
305 __int16 uBackSectorID;
|
|
306 struct BBox_short_ pBounding;
|
|
307 PolygonType uPolygonType;
|
|
308 unsigned __int8 uNumVertices;
|
|
309 char field_5E;
|
|
310 char field_5F;
|
|
311 };
|
|
312 #pragma pack(pop)
|
|
313
|
|
314 /* 94 */
|
|
315 #pragma pack(push, 1)
|
|
316 struct BLVFaceExtra
|
|
317 {
|
|
318 int HasEventint();
|
|
319
|
|
320 __int16 field_0;
|
|
321 __int16 field_2;
|
|
322 __int16 field_4;
|
|
323 __int16 field_6;
|
|
324 __int16 field_8;
|
|
325 __int16 field_A;
|
|
326 __int16 field_C;
|
|
327 unsigned __int16 uAdditionalBitmapID;
|
|
328 __int16 field_10;
|
|
329 __int16 field_12;
|
|
330 __int16 sTextureDeltaU;
|
|
331 __int16 sTextureDeltaV;
|
|
332 __int16 sCogNumber;
|
|
333 unsigned __int16 uEventID;
|
|
334 __int16 field_1C;
|
|
335 __int16 field_1E;
|
|
336 __int16 field_20;
|
|
337 __int16 field_22;
|
|
338 };
|
|
339 #pragma pack(pop)
|
|
340
|
|
341 /* 95 */
|
|
342 #pragma pack(push, 1)
|
|
343 struct BLVSector
|
|
344 {
|
|
345 int field_0;
|
58
|
346 unsigned __int16 uNumFloors;
|
0
|
347 __int16 field_6;
|
|
348 unsigned __int16 *pFloors;
|
|
349 __int16 field_C;
|
|
350 __int16 field_E;
|
|
351 unsigned __int16 *pWalls;
|
|
352 __int16 field_14;
|
|
353 __int16 field_16;
|
|
354 unsigned __int16 *pCeilings;
|
|
355 __int16 field_1C;
|
|
356 __int16 field_1E;
|
|
357 unsigned __int16 *pFluids;
|
|
358 __int16 uNumPortals;
|
|
359 __int16 field_26;
|
|
360 unsigned __int16 *pPortals;
|
|
361 __int16 field_2C;
|
|
362 __int16 uNumNonBSPFaces;
|
|
363 unsigned __int16 *pFaceIDs;
|
|
364 __int16 uNumCylinderFaces;
|
|
365 __int16 field_36;
|
|
366 int pCylinderFaces;
|
|
367 __int16 field_3C;
|
|
368 __int16 field_3E;
|
|
369 unsigned __int16 *pCogs;
|
|
370 unsigned __int16 uNumDecorations;
|
|
371 __int16 field_46;
|
|
372 unsigned __int16 *pDecorationIDs;
|
|
373 __int16 field_4C;
|
|
374 __int16 field_4E;
|
|
375 unsigned __int16 *pMarkers;
|
|
376 __int16 uNumLights;
|
|
377 __int16 field_56;
|
59
|
378 unsigned __int16 *pLights;
|
0
|
379 __int16 uWaterLevel;
|
|
380 __int16 uMistLevel;
|
|
381 __int16 uLightDistanceMultiplier;
|
|
382 __int16 uMinAmbientLightLevel;
|
|
383 __int16 uFirstBSPNode;
|
|
384 __int16 exit_tag;
|
|
385 BBox_short_ pBounding;
|
|
386 };
|
|
387 #pragma pack(pop)
|
|
388
|
|
389
|
28
|
390 #pragma pack(push, 1)
|
53
|
391 struct BLVMapOutlines
|
28
|
392 {
|
53
|
393 uint uNumOutlines;
|
|
394 BLVMapOutline pOutlines[1];
|
28
|
395 };
|
|
396 #pragma pack(pop)
|
0
|
397
|
|
398
|
|
399
|
28
|
400 #pragma pack(push, 1)
|
|
401 struct IndoorLocation_stru1
|
|
402 {
|
|
403 unsigned __int64 uLastVisitDay;
|
|
404 char field_2F4[48];
|
|
405 };
|
|
406 #pragma pack(pop)
|
|
407
|
0
|
408
|
|
409
|
|
410 /* 89 */
|
|
411 #pragma pack(push, 1)
|
|
412 struct IndoorLocation
|
|
413 {
|
|
414 //----- (00462592) --------------------------------------------------------
|
|
415 inline IndoorLocation()
|
|
416 {
|
|
417 bLoaded = 0;
|
|
418 ptr_0002B8_sector_lrdata = 0;
|
|
419 ptr_0002B4_doors_ddata = 0;
|
|
420 ptr_0002B0_sector_rdata = 0;
|
|
421 ptr_2AC = 0;
|
|
422 pVertices = 0;
|
|
423 pFaces = 0;
|
|
424 pFaceExtras = 0;
|
|
425 pSectors = 0;
|
|
426 pLights = 0;
|
|
427 pDoors = 0;
|
|
428 pNodes = 0;
|
53
|
429 pMapOutlines = 0;
|
0
|
430 uNumSpawnPoints = 0;
|
|
431 pSpawnPoints = 0;
|
|
432 }
|
|
433
|
|
434 int GetSector(int sX, int sY, int sZ);
|
|
435 void Release();
|
|
436 int Alloc();
|
|
437 bool Load(char *pFilename, int a3, size_t i, char *pDest);
|
|
438 void Draw();
|
|
439 void ToggleLight(unsigned int uLightID, unsigned int bToggle);
|
|
440
|
|
441 static unsigned int GetLocationIndex(const char *Str1);
|
50
|
442 static void ExecDraw(bool bD3D);
|
|
443 static void ExecDraw_sw(unsigned int uFaceID);
|
|
444 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *a4);
|
0
|
445
|
|
446 char pFilename[32];
|
|
447 char field_20[48];
|
|
448 unsigned int bLoaded;
|
|
449 char field_54[404];
|
|
450 struct BLVHeader blv;
|
|
451 unsigned int uNumVertices;
|
|
452 struct Vec3_short_ *pVertices;
|
|
453 unsigned int uNumFaces;
|
|
454 struct BLVFace *pFaces;
|
|
455 unsigned int uNumFaceExtras;
|
|
456 struct BLVFaceExtra *pFaceExtras;
|
|
457 int uNumSectors;
|
|
458 struct BLVSector *pSectors;
|
|
459 int uNumLights;
|
|
460 struct BLVLightMM7 *pLights;
|
|
461 int uNumDoors;
|
|
462 struct BLVDoor *pDoors;
|
|
463 unsigned int uNumNodes;
|
|
464 struct BSPNode *pNodes;
|
53
|
465 BLVMapOutlines *pMapOutlines;
|
0
|
466 unsigned __int16 *ptr_2AC;
|
|
467 unsigned __int16 *ptr_0002B0_sector_rdata;
|
|
468 unsigned __int16 *ptr_0002B4_doors_ddata;
|
|
469 unsigned __int16 *ptr_0002B8_sector_lrdata;
|
|
470 unsigned int uNumSpawnPoints;
|
|
471 struct SpawnPointMM7 *pSpawnPoints;
|
|
472 struct DDM_DLV_Header dlv;
|
28
|
473 IndoorLocation_stru1 stru1;
|
0
|
474 char _visible_outlines[876];
|
|
475 };
|
|
476 #pragma pack(pop)
|
|
477
|
|
478 extern IndoorLocation *pIndoor;
|
|
479
|
|
480
|
|
481
|
|
482
|
|
483
|
|
484
|
|
485
|
|
486
|
|
487
|
|
488
|
|
489
|
|
490
|
|
491 /* 263 */
|
|
492 #pragma pack(push, 1)
|
|
493 struct IndoorLocation_drawstru
|
|
494 {
|
|
495 int field_0_timer;
|
|
496 int uFlags;
|
|
497 Vec3_int_ vPosition;
|
|
498 int sRotationY;
|
|
499 int sRotationX;
|
|
500 int field_1C_mb_fov;
|
|
501 unsigned __int16 *pRenderTarget;
|
|
502 unsigned int uTargetWidth;
|
|
503 unsigned int uTargetHeight;
|
|
504 unsigned int uViewportX;
|
|
505 unsigned int uViewportY;
|
|
506 unsigned int uViewportZ;
|
|
507 unsigned int uViewportW;
|
|
508 int field_3C;
|
|
509 int *pTargetZ;
|
|
510 };
|
|
511 #pragma pack(pop)
|
|
512
|
|
513
|
|
514
|
|
515
|
|
516
|
|
517
|
|
518
|
|
519
|
|
520
|
|
521
|
|
522
|
|
523
|
|
524 /* 162 */
|
|
525 #pragma pack(push, 1)
|
|
526 struct BLVRenderParams
|
|
527 {
|
59
|
528 int Reset(struct IndoorLocation_drawstru *a2);
|
0
|
529
|
|
530 int field_0_timer_;
|
|
531 int uFlags;
|
|
532 Vec3_int_ vPartyPos;
|
|
533 int sPartyRotY;
|
|
534 int sPartyRotX;
|
58
|
535 int uPartySectorID;
|
0
|
536 int sCosineY;
|
|
537 int sSineY;
|
|
538 int sCosineNegX;
|
|
539 int sSineNegX;
|
|
540 float fCosineY;
|
|
541 float fSineY;
|
|
542 float fCosineNegX;
|
|
543 float fSineNegX;
|
|
544 int field_40;
|
|
545 float field_44;
|
|
546 unsigned __int16 *pRenderTarget;
|
|
547 unsigned int uTargetWidth;
|
|
548 unsigned int uTargetHeight;
|
|
549 unsigned int uViewportX;
|
|
550 unsigned int uViewportY;
|
|
551 unsigned int uViewportZ;
|
|
552 unsigned int uViewportW;
|
|
553 int field_64;
|
|
554 int *pTargetZBuffer;
|
|
555 int uViewportHeight;
|
|
556 int field_70;
|
|
557 int uViewportCenterX;
|
|
558 int uViewportCenterY;
|
|
559 struct stru170_stru2 *field_7C;
|
59
|
560 unsigned int uNumFacesRenderedThisFrame;
|
0
|
561 int field_84;
|
|
562 int field_88;
|
|
563 int field_8C;
|
|
564 int field_90;
|
|
565 int field_94;
|
|
566 };
|
|
567 #pragma pack(pop)
|
|
568
|
|
569 extern struct BLVRenderParams *pBLVRenderParams;
|
|
570
|
|
571
|
|
572
|
|
573
|
|
574
|
|
575 #include "Indoor_stuff.h" |