comparison Indoor.h @ 0:8b8875f5b359

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