2496
|
1 #pragma once
|
|
2 #include <array>
|
|
3
|
|
4 #include "Render.h"
|
|
5 #include "IndoorCameraD3D.h"
|
2499
|
6 #include "../mm7_data.h"
|
2496
|
7
|
|
8 /* 358 */
|
|
9 #pragma pack(push, 1)
|
|
10 struct stru320
|
|
11 {
|
|
12 int field_0;
|
|
13 Plane_int_ plane_4;
|
|
14 Vec3_int_ vec_14;
|
|
15 Vec3_int_ vec_20;
|
|
16 unsigned int uCurrentAmbientLightLevel;
|
|
17 int field_30;
|
|
18 int field_34;
|
|
19 int field_38;
|
|
20 int pDeltaUV[2];
|
|
21 int field_44;
|
|
22 int field_48;
|
|
23 char field_4C[8];
|
|
24 Vec3_int_ rotated_normal;
|
|
25 Vec3_int_ vec_60;
|
|
26 int field_6C;
|
|
27 Vec3_int_ vec_70;
|
|
28 int field_7C;
|
|
29 Vec3_int_ vec_80;
|
|
30 Vec3_int_ vec_8C;
|
|
31 int field_98;
|
|
32 Vec3_int_ vec_9C;
|
|
33 int field_A8;
|
|
34 unsigned int uNumLightsApplied;
|
|
35 int _blv_lights_radii[20];
|
|
36 int _blv_lights_inv_radii[20];
|
|
37 int _blv_lights_xs[20];
|
|
38 int _blv_lights_ys[20];
|
|
39 int _blv_lights_light_dot_faces[20];
|
|
40 int field_240;
|
|
41 int field_244;
|
|
42 int field_248;
|
|
43 int field_24C;
|
|
44 int field_250;
|
|
45 int field_254;
|
|
46 int field_258;
|
|
47 int field_25C;
|
|
48 int field_260;
|
|
49 int field_264;
|
|
50 int field_268;
|
|
51 int field_26C;
|
|
52 int field_270;
|
|
53 int field_274;
|
|
54 int field_278;
|
|
55 int field_27C;
|
|
56 int field_280;
|
|
57 int field_284;
|
|
58 int field_288;
|
|
59 int field_28C;
|
|
60 int _blv_lights_zs[20];
|
|
61 float _blv_lights_rs[20];
|
|
62 float _blv_lights_gs[20];
|
|
63 float _blv_lights_bs[20];
|
|
64 char _blv_lights_types[20];
|
|
65 int field_3E4;
|
|
66 int field_3E8;
|
|
67 int field_3EC;
|
|
68 int field_3F0;
|
|
69 int field_3F4;
|
|
70 unsigned int uDefaultAmbientLightLevel;
|
|
71 };
|
|
72 #pragma pack(pop)
|
|
73
|
|
74 extern stru320 stru_F8AD28; // idb
|
|
75
|
|
76
|
|
77
|
|
78
|
|
79
|
|
80
|
|
81
|
|
82
|
|
83 /* 345 */
|
|
84 #pragma pack(push, 1)
|
|
85 struct stru315
|
|
86 {
|
|
87 int field_0;
|
|
88 int field_4;
|
|
89 int field_8;
|
|
90 int field_C;
|
|
91 int field_10;
|
|
92 int field_14;
|
|
93 int field_18;
|
|
94 int field_1C;
|
|
95 int field_20;
|
|
96 int field_24;
|
|
97 int field_28;
|
|
98 int field_2C;
|
|
99 int field_30;
|
|
100 unsigned __int16 *field_34_palette;
|
|
101 unsigned __int16 *pTextureLOD;
|
|
102 unsigned int *pDepthBuffer;
|
|
103 unsigned __int16 *pColorBuffer;
|
|
104 };
|
|
105 #pragma pack(pop)
|
|
106
|
|
107
|
|
108
|
|
109
|
|
110
|
|
111 /* 346 */
|
|
112 #pragma pack(push, 1)
|
|
113 struct stru316
|
|
114 {
|
|
115 int field_0;
|
|
116 int field_4;
|
|
117 int field_8;
|
|
118 int field_C;
|
|
119 int field_10;
|
|
120 int field_14;
|
|
121 int field_18;
|
|
122 int field_1C;
|
|
123 int field_20;
|
|
124 unsigned __int16 *field_24_palette;
|
|
125 };
|
|
126 #pragma pack(pop)
|
|
127
|
|
128
|
|
129
|
|
130
|
|
131
|
|
132
|
|
133 /* 134 */
|
|
134 #pragma pack(push, 1)
|
|
135 struct stru141_actor_collision_object
|
|
136 {
|
|
137 int _47050A(int a2);
|
|
138
|
|
139 int field_0;
|
|
140 int prolly_normal_d;
|
|
141 int field_8_radius;
|
|
142 int height;
|
|
143 int field_10;
|
|
144 int field_14;
|
|
145 int field_18;
|
|
146 Vec3_int_ velocity;
|
|
147 Vec3_int_ normal;
|
|
148 Vec3_int_ position;
|
|
149 Vec3_int_ normal2;
|
|
150 int field_4C;
|
|
151 int field_50;
|
|
152 int field_54;
|
|
153 Vec3_int_ direction; // velocity's unit vector
|
|
154 int speed;
|
|
155 int inv_speed;
|
|
156 int field_6C;
|
|
157 int field_70;
|
|
158 unsigned int uSectorID;
|
|
159 unsigned int uFaceID;
|
|
160 int field_7C;
|
|
161 int field_80;
|
|
162 int field_84;
|
|
163 int field_88;
|
|
164 int sMaxX;
|
|
165 int sMinX;
|
|
166 int sMaxY;
|
|
167 int sMinY;
|
|
168 int sMaxZ;
|
|
169 int sMinZ;
|
|
170 int field_A4;
|
|
171 };
|
|
172 #pragma pack(pop)
|
|
173 extern stru141_actor_collision_object stru_721530;
|
|
174
|
|
175
|
|
176
|
|
177
|
|
178
|
|
179
|
|
180 /* 378 */
|
|
181 #pragma pack(push, 1)
|
|
182 struct stru337_stru0
|
|
183 {
|
|
184 int field_0;
|
|
185 int field_4;
|
|
186 int field_8;
|
|
187 int field_C;
|
|
188 int field_10;
|
|
189 };
|
|
190 #pragma pack(pop)
|
|
191
|
|
192
|
|
193
|
|
194 /* 377 */
|
|
195 #pragma pack(push, 1)
|
|
196 struct stru337
|
|
197 {
|
|
198 stru337_stru0 field_0;
|
|
199 int field_14;
|
|
200 int field_18;
|
|
201 int field_1C;
|
|
202 int field_20;
|
|
203 int field_24;
|
|
204 int field_28;
|
|
205 int field_2C;
|
|
206 int field_30;
|
|
207 stru337_stru0 field_34;
|
|
208 };
|
|
209 #pragma pack(pop)
|
|
210 extern stru337 stru_F81018;
|
|
211
|
|
212
|
|
213 /* 291 */
|
|
214 enum PolygonType : __int8
|
|
215 {
|
|
216 POLYGON_Invalid = 0x0,
|
|
217 POLYGON_VerticalWall = 0x1,
|
|
218 POLYGON_unk = 0x2,
|
|
219 POLYGON_Floor = 0x3,
|
|
220 POLYGON_InBetweenFloorAndWall = 0x4,
|
|
221 POLYGON_Ceiling = 0x5,
|
|
222 POLYGON_InBetweenCeilingAndWall = 0x6,
|
|
223 };
|
|
224
|
|
225
|
|
226 /* 147 */
|
|
227 #pragma pack(push, 1)
|
|
228
|
|
229 struct stru154
|
|
230 {
|
|
231 //----- (0049B001) --------------------------------------------------------
|
|
232 inline stru154()
|
|
233 {}
|
|
234
|
|
235 //----- (0049B027) --------------------------------------------------------
|
|
236 inline ~stru154()
|
|
237 {}
|
|
238
|
|
239 void GetFacePlaneAndClassify(struct ODMFace *a2, struct BSPVertexBuffer *a3);
|
|
240 void ClassifyPolygon(struct Vec3_float_ *pNormal, float dist);
|
|
241 void GetFacePlane(struct ODMFace *pFace, struct BSPVertexBuffer *pVertices, struct Vec3_float_ *pOutNormal, float *pOutDist);
|
|
242
|
|
243
|
|
244 void(***vdestructor_ptr)(stru154 *, bool);
|
|
245 Plane_float_ face_plane;
|
|
246 PolygonType polygonType;
|
|
247 char field_15;
|
|
248 char field_16;
|
|
249 char field_17;
|
|
250 };
|
|
251 #pragma pack(pop)
|
|
252
|
|
253
|
|
254
|
|
255
|
|
256
|
|
257 /* 392 */
|
|
258 #pragma pack(push, 1)
|
|
259 struct stru352
|
|
260 {
|
|
261 int field_0;
|
|
262 int field_4;
|
|
263 int field_8;
|
|
264 int field_C;
|
|
265 int field_10;
|
|
266 int field_14;
|
|
267 int field_18;
|
|
268 int field_1C;
|
|
269 int field_20;
|
|
270 int field_24;
|
|
271 int field_28;
|
|
272 int field_2C;
|
|
273 int field_30;
|
|
274 int field_34;
|
|
275 };
|
|
276 #pragma pack(pop)
|
|
277 //extern std::array<stru352, 480> stru_F83B80;
|
|
278
|
|
279 #pragma pack(push, 1)
|
|
280 struct LocationTime_stru1
|
|
281 {
|
|
282 unsigned __int64 uLastVisitDay;
|
|
283 char sky_texture_name[12];
|
|
284 int day_attrib;
|
|
285 int day_fogrange_1;
|
|
286 int day_fogrange_2;
|
|
287 char field_2F4[24];
|
|
288 };
|
|
289 #pragma pack(pop)
|
|
290
|
|
291 /* 319 */
|
|
292 enum LEVEL_TYPE
|
|
293 {
|
|
294 LEVEL_null = 0,
|
|
295 LEVEL_Indoor = 0x1,
|
|
296 LEVEL_Outdoor = 0x2,
|
|
297 };
|
|
298 extern LEVEL_TYPE uCurrentlyLoadedLevelType;
|
|
299
|
|
300
|
|
301
|
|
302
|
|
303
|
|
304
|
|
305
|
|
306
|
|
307
|
|
308
|
|
309
|
|
310
|
|
311
|
|
312 /* 86 */
|
|
313 #pragma pack(push, 1)
|
|
314 struct SpawnPointMM6
|
|
315 {
|
|
316 Vec3_int_ vPosition;
|
|
317 unsigned __int16 uRadius;
|
|
318 unsigned __int16 uKind;
|
|
319 unsigned __int16 uIndex;
|
|
320 unsigned __int16 uAttributes;
|
|
321 };
|
|
322 #pragma pack(pop)
|
|
323
|
|
324
|
|
325
|
|
326 /* 102 */
|
|
327 #pragma pack(push, 1)
|
|
328 struct SpawnPointMM7
|
|
329 {
|
|
330 //----- (00448DD6) --------------------------------------------------------
|
|
331 SpawnPointMM7()
|
|
332 {
|
|
333 uRadius = 32;
|
|
334 uAttributes = 0;
|
|
335 uIndex = 0;
|
|
336 uKind = 0;
|
|
337 uGroup = 0;
|
|
338 }
|
|
339
|
|
340
|
|
341 Vec3_int_ vPosition;
|
|
342 unsigned __int16 uRadius;
|
|
343 unsigned __int16 uKind;
|
|
344 unsigned __int16 uIndex;
|
|
345 unsigned __int16 uAttributes;
|
|
346 unsigned int uGroup;
|
|
347 };
|
|
348 #pragma pack(pop)
|
|
349
|
|
350
|
|
351
|
|
352
|
|
353
|
|
354
|
|
355 /* 90 */
|
|
356 #pragma pack(push, 1)
|
|
357 struct BLVHeader
|
|
358 {
|
|
359 char field_0[104];
|
|
360 unsigned int uFaces_fdata_Size;
|
|
361 unsigned int uSector_rdata_Size;
|
|
362 unsigned int uSector_lrdata_Size;
|
|
363 unsigned int uDoors_ddata_Size;
|
|
364 char field_78[16];
|
|
365 };
|
|
366 #pragma pack(pop)
|
|
367
|
|
368
|
|
369
|
|
370 /* 96 */
|
|
371 #pragma pack(push, 1)
|
|
372 struct BLVSectorMM8
|
|
373 {
|
|
374 int dword_000074;
|
|
375 };
|
|
376 #pragma pack(pop)
|
|
377
|
|
378 /* 97 */
|
|
379 #pragma pack(push, 1)
|
|
380 struct BLVLightMM6
|
|
381 {
|
|
382 Vec3_short_ vPosition;
|
|
383 __int16 uRadius;
|
|
384 __int16 uAttributes;
|
|
385 unsigned __int16 uBrightness;
|
|
386 };
|
|
387 #pragma pack(pop)
|
|
388
|
|
389 /* 98 */
|
|
390 #pragma pack(push, 1)
|
|
391 struct BLVLightMM7 //10h
|
|
392 {
|
|
393 struct Vec3_short_ vPosition;
|
|
394 __int16 uRadius;
|
|
395 char uRed;
|
|
396 char uGreen;
|
|
397 char uBlue;
|
|
398 char uType;
|
|
399 __int16 uAtributes; // & 0x08 doesn't light faces
|
|
400 __int16 uBrightness;
|
|
401 };
|
|
402 #pragma pack(pop)
|
|
403
|
|
404 /* 99 */
|
|
405 #pragma pack(push, 1)
|
|
406 struct BLVLightMM8
|
|
407 {
|
|
408 int uID;
|
|
409 };
|
|
410 #pragma pack(pop)
|
|
411
|
|
412
|
|
413
|
|
414 /* 100 */
|
|
415 #pragma pack(push, 1)
|
|
416 struct BLVDoor //50h
|
|
417 {
|
|
418 enum State: unsigned __int16
|
|
419 {
|
|
420 Closed = 0,
|
|
421 Opening = 1,
|
|
422 Open = 2,
|
|
423 Closing = 3
|
|
424 };
|
|
425
|
|
426 unsigned int uAttributes;
|
|
427 unsigned int uDoorID;
|
|
428 unsigned int uTimeSinceTriggered;
|
|
429 Vec3_int_ vDirection;
|
|
430 int uMoveLength;
|
|
431 int uOpenSpeed;
|
|
432 int uCloseSpeed;
|
|
433 unsigned __int16 *pVertexIDs;
|
|
434 unsigned __int16 *pFaceIDs;
|
|
435 unsigned __int16 *pSectorIDs;
|
|
436 __int16 *pDeltaUs;
|
|
437 __int16 *pDeltaVs;
|
|
438 unsigned __int16 *pXOffsets;
|
|
439 unsigned __int16 *pYOffsets;
|
|
440 unsigned __int16 *pZOffsets;
|
|
441 unsigned __int16 uNumVertices;
|
|
442 unsigned __int16 uNumFaces;
|
|
443 __int16 field_48;
|
|
444 unsigned __int16 uNumOffsets;
|
|
445 State uState;
|
|
446 __int16 field_4E;
|
|
447 };
|
|
448 #pragma pack(pop)
|
|
449
|
|
450 /* 101 */
|
|
451 #pragma pack(push, 1)
|
|
452 struct BLVMapOutline //0C
|
|
453 {
|
|
454 unsigned __int16 uVertex1ID;
|
|
455 unsigned __int16 uVertex2ID;
|
|
456 unsigned __int16 uFace1ID;
|
|
457 unsigned __int16 uFace2ID;
|
|
458 __int16 sZ;
|
|
459 unsigned __int16 uFlags;
|
|
460 };
|
|
461 #pragma pack(pop)
|
|
462
|
|
463
|
|
464 #define FACE_PORTAL 0x00000001 // portal/two-sided
|
|
465 #define FACE_CAN_SATURATE_COLOR 0x00000002
|
|
466 #define FACE_FLOW_DIAGONAL 0x00000004 // Diagonal flow of the lava or water
|
|
467 #define FACE_UNKNOW5 0x00000006
|
|
468 #define FACE_UNKNOW6 0x00000008
|
|
469 #define FACE_FLUID 0x00000010 // wavy animated water or lava
|
|
470 #define FACE_FLOW_VERTICAL 0x00000020 // Vertical flow of the lava or water
|
|
471 #define FACE_DONT_CACHE_TEXTURE 0x00000040 // do not load face texture if it isn't loaded already
|
2508
|
472 #define FACE_UNKNOW7 0x00000080
|
2496
|
473 #define FACE_XY_PLANE 0x00000100
|
|
474 #define FACE_XZ_PLANE 0x00000200
|
|
475 #define FACE_YZ_PLANE 0x00000400
|
|
476 #define FACE_FLOW_HORIZONTAL 0x00000800 // Horizontal flow of the lava or water
|
|
477 #define FACE_HAS_EVENT_HINT 0x00001000
|
|
478 #define FACE_INVISIBLE 0x00002000
|
|
479 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID
|
|
480 #define FACE_OUTLINED 0x00010000 // outline face edges
|
|
481 #define FACE_INDOOR_DOOR 0x00020000
|
|
482 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only.
|
|
483 #define FACE_HAS_EVENT 0x00100000
|
|
484 #define FACE_INDOOR_CARPET 0x00200000
|
|
485 #define FACE_INDOOR_SKY 0x00400000
|
|
486 #define FACE_UNKNOW3 0x00800000
|
|
487 #define FACE_UNKNOW4 0x01000000
|
|
488 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet.
|
|
489 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet.
|
|
490 #define FACE_INDICATE 0x06000000 // Event can be triggered by indicating on the facet.
|
|
491 #define FACE_UNKNOW1 0x08000000
|
|
492 #define FACE_UNKNOW2 0x10000000
|
|
493 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it.
|
|
494 #define FACE_INDOOR_LAVA 0x40000000
|
|
495 #define FACE_PICKED 0x80000000
|
|
496
|
|
497 /* 93 */
|
|
498 #pragma pack(push, 1)
|
|
499 struct BLVFace //60h
|
|
500 {
|
|
501 //----- (0046ED02) --------------------------------------------------------
|
|
502 inline BLVFace()
|
|
503 {
|
|
504 this->uNumVertices = 0;
|
|
505 this->uAttributes = 0;
|
|
506 this->uFaceExtraID = 0;
|
|
507 this->pVertexIDs = nullptr;
|
|
508 this->pZInterceptDisplacements = nullptr;
|
|
509 this->pYInterceptDisplacements = nullptr;
|
|
510 this->pXInterceptDisplacements = nullptr;
|
|
511 }
|
|
512
|
|
513 void _get_normals(Vec3_int_ *a2, Vec3_int_ *a3);
|
|
514 struct Texture *GetTexture();
|
|
515 void FromODM(struct ODMFace *face);
|
|
516
|
|
517 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;}
|
|
518 inline bool Visible() const {return !Invisible();}
|
|
519 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;}
|
|
520 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;}
|
|
521 inline bool Indoor_sky() const {return (uAttributes & FACE_INDOOR_SKY) != 0;}
|
|
522 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;}
|
|
523 inline bool Pressure_Plate() const {return (uAttributes & FACE_PRESSURE_PLATE) != 0;}
|
|
524 inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;}
|
|
525
|
|
526 struct Plane_float_ pFacePlane;
|
|
527 struct Plane_int_ pFacePlane_old;
|
|
528 int zCalc1;
|
|
529 int zCalc2;
|
|
530 int zCalc3;
|
|
531 unsigned int uAttributes;
|
|
532 unsigned __int16 *pVertexIDs;
|
|
533 signed __int16 *pXInterceptDisplacements;
|
|
534 signed __int16 *pYInterceptDisplacements;
|
|
535 signed __int16 *pZInterceptDisplacements;
|
|
536 signed __int16 *pVertexUIDs;
|
|
537 signed __int16 *pVertexVIDs;
|
|
538 unsigned __int16 uFaceExtraID;
|
|
539 unsigned __int16 uBitmapID;
|
|
540 unsigned __int16 uSectorID;
|
|
541 __int16 uBackSectorID;
|
|
542 struct BBox_short_ pBounding;
|
|
543 PolygonType uPolygonType;
|
|
544 unsigned __int8 uNumVertices;
|
|
545 char field_5E;
|
|
546 char field_5F;
|
|
547 };
|
|
548 #pragma pack(pop)
|
|
549
|
|
550 /* 94 */
|
|
551 #pragma pack(push, 1)
|
|
552 struct BLVFaceExtra //24h
|
|
553 {
|
|
554 bool HasEventint();
|
|
555
|
|
556 __int16 field_0;
|
|
557 __int16 field_2;
|
|
558 __int16 field_4;
|
|
559 __int16 field_6;
|
|
560 __int16 field_8;
|
|
561 __int16 field_A;
|
|
562 __int16 field_C;
|
|
563 unsigned __int16 uAdditionalBitmapID;
|
|
564 __int16 field_10;
|
|
565 __int16 field_12;
|
|
566 __int16 sTextureDeltaU;
|
|
567 __int16 sTextureDeltaV;
|
|
568 __int16 sCogNumber;
|
|
569 unsigned __int16 uEventID;
|
|
570 __int16 field_1C;
|
|
571 __int16 field_1E;
|
|
572 __int16 field_20;
|
|
573 __int16 field_22;
|
|
574 };
|
|
575 #pragma pack(pop)
|
|
576
|
|
577 /* 95 */
|
|
578 #pragma pack(push, 1)
|
|
579 struct BLVSector //0x74
|
|
580 {
|
|
581 int field_0;
|
|
582 unsigned __int16 uNumFloors;
|
|
583 __int16 field_6;
|
|
584 unsigned __int16 *pFloors;
|
|
585 unsigned __int16 uNumWalls;
|
|
586 __int16 field_E;
|
|
587 unsigned __int16 *pWalls;
|
|
588 unsigned __int16 uNumCeilings;
|
|
589 __int16 field_16;
|
|
590 unsigned __int16 *pCeilings;
|
|
591 unsigned __int16 uNumFluids;
|
|
592 __int16 field_1E;
|
|
593 unsigned __int16 *pFluids;
|
|
594 __int16 uNumPortals;
|
|
595 __int16 field_26;
|
|
596 unsigned __int16 *pPortals;
|
|
597 unsigned __int16 uNumFaces;
|
|
598 unsigned __int16 uNumNonBSPFaces;
|
|
599 unsigned __int16 *pFaceIDs;
|
|
600 unsigned __int16 uNumCylinderFaces;
|
|
601 __int16 field_36;
|
|
602 int pCylinderFaces;
|
|
603 unsigned __int16 uNumCogs;
|
|
604 __int16 field_3E;
|
|
605 unsigned __int16 *pCogs;
|
|
606 unsigned __int16 uNumDecorations;
|
|
607 __int16 field_46;
|
|
608 unsigned __int16 *pDecorationIDs;
|
|
609 unsigned __int16 uNumMarkers;
|
|
610 __int16 field_4E;
|
|
611 unsigned __int16 *pMarkers;
|
|
612 unsigned __int16 uNumLights;
|
|
613 __int16 field_56;
|
|
614 unsigned __int16 *pLights;
|
|
615 __int16 uWaterLevel;
|
|
616 __int16 uMistLevel;
|
|
617 __int16 uLightDistanceMultiplier;
|
|
618 __int16 uMinAmbientLightLevel;
|
|
619 __int16 uFirstBSPNode;
|
|
620 __int16 exit_tag;
|
|
621 BBox_short_ pBounding;
|
|
622 };
|
|
623 #pragma pack(pop)
|
|
624
|
|
625
|
|
626 #pragma pack(push, 1)
|
|
627 struct BLVMapOutlines
|
|
628 {
|
|
629 int uNumOutlines;
|
|
630 BLVMapOutline pOutlines[7000];
|
|
631 };
|
|
632 #pragma pack(pop)
|
|
633
|
|
634
|
|
635
|
|
636
|
|
637
|
|
638
|
|
639
|
|
640 /* 89 */
|
|
641 #pragma pack(push, 1)
|
|
642 struct IndoorLocation
|
|
643 {
|
|
644 //----- (00462592) --------------------------------------------------------
|
|
645 inline IndoorLocation()
|
|
646 {
|
|
647 bLoaded = 0;
|
|
648 ptr_0002B8_sector_lrdata = 0;
|
|
649 ptr_0002B4_doors_ddata = 0;
|
|
650 ptr_0002B0_sector_rdata = 0;
|
|
651 pLFaces = 0;
|
|
652 pVertices = 0;
|
|
653 pFaces = 0;
|
|
654 pFaceExtras = 0;
|
|
655 pSectors = 0;
|
|
656 pLights = 0;
|
|
657 pDoors = 0;
|
|
658 pNodes = 0;
|
|
659 pMapOutlines = 0;
|
|
660 uNumSpawnPoints = 0;
|
|
661 pSpawnPoints = 0;
|
|
662 uNumSectors = 0;
|
|
663 }
|
|
664
|
|
665 int GetSector(int sX, int sY, int sZ);
|
|
666 void Release();
|
|
667 bool Alloc();
|
|
668 bool Load(char *pFilename, int a3, size_t i, char *pDest);
|
|
669 void Draw();
|
|
670 void ToggleLight(signed int uLightID, unsigned int bToggle);
|
|
671
|
|
672 static unsigned int GetLocationIndex(const char *Str1);
|
|
673 static void ExecDraw(bool bD3D);
|
|
674 //static void ExecDraw_sw(unsigned int uFaceID);
|
|
675 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding);
|
|
676
|
|
677 char pFilename[32];
|
|
678 char field_20[48];
|
|
679 unsigned int bLoaded;
|
|
680 char field_54[404];
|
|
681 struct BLVHeader blv;
|
|
682 unsigned int uNumVertices;
|
|
683 struct Vec3_short_ *pVertices;
|
|
684 unsigned int uNumFaces;
|
|
685 struct BLVFace *pFaces;
|
|
686 unsigned int uNumFaceExtras;
|
|
687 struct BLVFaceExtra *pFaceExtras;
|
|
688 int uNumSectors;
|
|
689 struct BLVSector *pSectors;
|
|
690 int uNumLights;
|
|
691 struct BLVLightMM7 *pLights;
|
|
692 int uNumDoors;
|
|
693 struct BLVDoor *pDoors;
|
|
694 unsigned int uNumNodes;
|
|
695 struct BSPNode *pNodes;
|
|
696 BLVMapOutlines *pMapOutlines;
|
|
697 unsigned __int16 *pLFaces;
|
|
698 unsigned __int16 *ptr_0002B0_sector_rdata;
|
|
699 unsigned __int16 *ptr_0002B4_doors_ddata;
|
|
700 unsigned __int16 *ptr_0002B8_sector_lrdata;
|
|
701 unsigned int uNumSpawnPoints;
|
|
702 struct SpawnPointMM7 *pSpawnPoints;
|
|
703 struct DDM_DLV_Header dlv;
|
|
704 LocationTime_stru1 stru1;
|
|
705 char _visible_outlines[875];
|
|
706 char padding;
|
|
707 };
|
|
708 #pragma pack(pop)
|
|
709
|
|
710 extern IndoorLocation *pIndoor;
|
|
711
|
|
712
|
|
713
|
|
714
|
|
715
|
|
716
|
|
717
|
|
718
|
|
719
|
|
720
|
|
721
|
|
722
|
|
723
|
|
724 /* 162 */
|
|
725 #pragma pack(push, 1)
|
|
726 struct BLVRenderParams
|
|
727 {
|
|
728 inline BLVRenderParams()
|
|
729 {
|
|
730 uViewportX = 0;
|
|
731 uViewportY = 0;
|
|
732 uViewportZ = 0;
|
|
733 uViewportW = 0;
|
|
734 }
|
|
735
|
|
736 void Reset();
|
|
737
|
|
738 int field_0_timer_;
|
|
739 int _unused_uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines
|
|
740 Vec3_int_ _unused_vPartyPos;
|
|
741 int _unused_sPartyRotY;
|
|
742 int _unused_sPartyRotX;
|
|
743 int uPartySectorID;
|
|
744 int _unused_sCosineY; // matches ODMRenderParams::int sines and cosines
|
|
745 int _unused_sSineY; // computed in 0048600E
|
|
746 int _unused_sCosineNegX; // merged into IndoorCameraD3D
|
|
747 int _unused_sSineNegX; // --//--
|
|
748 float _unused_fCosineY; // matches old IndoorCamera::fRotationCosineY (new IndoorCameraD3D::fRotationCosineY)
|
|
749 float _unused_fSineY; // matches old IndoorCamera::fRotationSineY (new IndoorCameraD3D::fRotationSineY)
|
|
750 float _unused_fCosineNegX; // the same
|
|
751 float _unused_fSineNegX; // the same
|
|
752 int fov_rad_fixpoint;
|
|
753 int fov_rad_inv_fixpoint;//float
|
|
754 void *pRenderTarget;
|
|
755 unsigned int uTargetWidth;
|
|
756 unsigned int uTargetHeight;
|
|
757 unsigned int uViewportX;
|
|
758 unsigned int uViewportY;
|
|
759 unsigned int uViewportZ;
|
|
760 unsigned int uViewportW;
|
|
761 int field_64;
|
|
762 int *pTargetZBuffer;
|
|
763 int uViewportHeight;
|
|
764 int uViewportWidth;
|
|
765 int uViewportCenterX;
|
|
766 int uViewportCenterY;
|
|
767 struct BspRenderer_PortalViewportData *field_7C;
|
|
768 unsigned int uNumFacesRenderedThisFrame;
|
|
769 int field_84;
|
|
770 int field_88;
|
|
771 int field_8C;
|
|
772 int field_90;
|
|
773 int field_94;
|
|
774 };
|
|
775 #pragma pack(pop)
|
|
776 extern BLVRenderParams *pBLVRenderParams;
|
|
777
|
|
778
|
|
779
|
|
780
|
|
781
|
|
782 int __fastcall GetPortalScreenCoord(unsigned int uFaceID);
|
|
783 bool PortalFrustrum(int pNumVertices, struct BspRenderer_PortalViewportData *a2, struct BspRenderer_PortalViewportData *near_portal, int uFaceID);
|
|
784 void PrepareBspRenderList_BLV();
|
|
785 void PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID);
|
|
786 void PrepareActorRenderList_BLV();
|
|
787 void PrepareItemsRenderList_BLV();
|
|
788 void AddBspNodeToRenderList(unsigned int node_id);
|
|
789 void __fastcall sub_4406BC(unsigned int node_id, unsigned int uFirstNode); // idb
|
|
790 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2);
|
|
791 int __fastcall sub_4AAEA6_transform(struct RenderVertexSoft *a1);
|
|
792 unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb
|
|
793 void BLV_UpdateUserInputAndOther();
|
|
794 int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID);
|
|
795 void BLV_UpdateDoors();
|
|
796 void UpdateActors_BLV();
|
|
797 void BLV_ProcessPartyActions();
|
|
798 void Door_switch_animation(unsigned int uDoorID, int a2); // idb: sub_449A49
|
|
799 int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6);
|
|
800 void __fastcall PrepareDrawLists_BLV();
|
|
801 void PrepareToLoadBLV(unsigned int bLoading);
|
|
802 int GetAlertStatus();
|
|
803 int __fastcall _45063B_spawn_some_monster(struct MapInfo *a1, int a2);
|
|
804 int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6);
|
|
805
|
|
806 bool __fastcall sub_4075DB(int a1, int a2, int a3, struct BLVFace *face);
|
|
807 bool __fastcall sub_4077F1(int a1, int a2, int a3, struct ODMFace *face, struct BSPVertexBuffer *a5);
|
|
808
|
|
809 #pragma once
|
|
810
|
|
811
|
|
812
|
|
813
|
|
814
|
|
815 /* 165 */
|
|
816 #pragma pack(push, 1)
|
|
817 struct BspRenderer_PortalViewportData
|
|
818 {
|
|
819 void GetViewportData(__int16 x, int y, __int16 z, int w);
|
|
820
|
|
821 int _viewport_space_y;
|
|
822 int _viewport_space_w;
|
|
823 int _viewport_space_x;
|
|
824 int _viewport_space_z;
|
|
825 int _viewport_x_minID;
|
|
826 int _viewport_z_maxID;
|
|
827 __int16 viewport_left_side[480];
|
|
828 __int16 viewport_right_side[480];
|
|
829 };
|
|
830 #pragma pack(pop)
|
|
831 extern BspRenderer_PortalViewportData stru_F8A590;
|
|
832
|
|
833
|
|
834
|
|
835
|
|
836 /* 164 */
|
|
837 #pragma pack(push, 1)
|
|
838 struct BspRenderer_stru0
|
|
839 {
|
|
840 //----- (0043F2BF) --------------------------------------------------------
|
|
841 inline BspRenderer_stru0()
|
|
842 {
|
|
843 //_eh_vector_constructor_iterator_(std__vector_0007AC, 24, 4,
|
|
844 // (void ( *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4,
|
|
845 // (void ( *)(void *))IndoorCameraD3D_Vec4::dtor);
|
|
846 //for (int i = 0; i < 4; ++i)
|
|
847 // pVertices[i].flt_2C = 0.0f;
|
|
848 }
|
|
849
|
|
850 //----- (0043F2A9) --------------------------------------------------------
|
|
851 ~BspRenderer_stru0()
|
|
852 {
|
|
853 //_eh_vector_destructor_iterator_(this->std__vector_0007AC, 24, 4, IndoorCameraD3D_Vec4::dtor);
|
|
854 }
|
|
855
|
|
856 unsigned __int16 uSectorID;
|
|
857 unsigned __int16 uViewportX;
|
|
858 unsigned __int16 uViewportY;
|
|
859 unsigned __int16 uViewportZ;
|
|
860 unsigned __int16 uViewportW;
|
|
861 __int16 field_A;
|
|
862 BspRenderer_PortalViewportData PortalScreenData;
|
|
863 unsigned __int16 uFaceID;
|
|
864 __int16 field_7A6;
|
|
865 unsigned int viewing_portal_id; // portal through which we're seeing this node
|
|
866 IndoorCameraD3D_Vec4 std__vector_0007AC[4];
|
|
867 RenderVertexSoft pPortalBounding[4];
|
|
868 };
|
|
869 #pragma pack(pop)
|
|
870
|
|
871
|
|
872
|
|
873
|
|
874 #pragma pack(push, 1)
|
|
875 struct BspFace
|
|
876 {
|
|
877 unsigned __int16 uFaceID;
|
|
878 unsigned __int16 uNodeID;
|
|
879 };
|
|
880 #pragma pack(pop)
|
|
881
|
|
882
|
|
883 /* 163 */
|
|
884 #pragma pack(push, 1)
|
|
885 struct BspRenderer // stru170
|
|
886 {
|
|
887 //----- (0043F282) --------------------------------------------------------
|
|
888 inline BspRenderer()
|
|
889 {
|
|
890 // _eh_vector_constructor_iterator_(field_FA8, 2252, 150,
|
|
891 // (void ( *)(void *))stru170_stru0::stru170_stru0,
|
|
892 // (void ( *)(void *))stru170_stru0::dtor);
|
|
893 num_faces = 0;
|
|
894 num_nodes = 0;
|
|
895 uNumVisibleNotEmptySectors = 0;
|
|
896 }
|
|
897
|
|
898 //void AddFaceToRenderList_sw(unsigned int node_id, unsigned int uFaceID);
|
|
899 void AddFaceToRenderList_d3d(unsigned int node_id, unsigned int uFaceID);
|
|
900 void MakeVisibleSectorList();
|
|
901 //void DrawFaceOutlines();
|
|
902
|
|
903 unsigned int num_faces;
|
|
904 //__int16 pFaceIDs[2000];
|
|
905 BspFace faces[1000];
|
|
906 //char field_130[3700];
|
|
907 unsigned int num_nodes;
|
|
908 BspRenderer_stru0 nodes[150];
|
|
909 unsigned int uNumVisibleNotEmptySectors;
|
|
910 unsigned __int16 pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[6];
|
|
911 };
|
|
912 #pragma pack(pop)
|
|
913
|
|
914
|
|
915 extern struct BspRenderer *pBspRenderer; // idb
|
|
916
|
|
917 void FindBillboardsLightLevels_BLV();
|
|
918
|
|
919 int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb
|
|
920
|
|
921 bool __fastcall sub_407A1C(int x, int z, int y, struct Vec3_int_ v); // idb
|