Mercurial > mm7
annotate Indoor.h @ 596:b5240254cbbd
Merge
author | Nomad |
---|---|
date | Wed, 06 Mar 2013 16:51:39 +0200 |
parents | 55d6b756e03a |
children | ccf8b4815a1f |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "VectorTypes.h" | |
3 #include "IndoorCameraD3D.h" | |
4 | |
5 | |
6 | |
7 | |
8 /* 319 */ | |
9 enum LEVEL_TYPE | |
10 { | |
11 LEVEL_null = 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 _idx_in_stru123; | |
40 __int16 field_1E; | |
41 }; | |
42 #pragma pack(pop) | |
43 extern LevelDecoration pLevelDecorations[3000]; | |
44 extern size_t uNumLevelDecorations; | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
469
diff
changeset
|
45 extern LevelDecoration* activeLevelDecoration; |
0 | 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; | |
188 __int16 uAtributes; // & 0x08 doesn't light faces | |
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 | |
201 | |
202 | |
203 /* 100 */ | |
204 #pragma pack(push, 1) | |
205 struct BLVDoor | |
206 { | |
207 enum State: unsigned __int16 | |
208 { | |
209 Closed = 0, | |
210 Opening = 1, | |
211 Open = 2, | |
212 Closing = 3 | |
213 }; | |
214 | |
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; | |
234 State uState; | |
235 __int16 field_4E; | |
236 }; | |
237 #pragma pack(pop) | |
238 | |
239 /* 101 */ | |
240 #pragma pack(push, 1) | |
241 struct BLVMapOutline | |
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 | |
253 #define FACE_TWO_SIDED 0x00000001 // portal/two-sided | |
254 // 0x02 color is saturated against lights | |
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 | |
194 | 258 #define FACE_OUTLINED 0x00010000 // outline face edges |
0 | 259 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. |
595 | 260 #define FACE_DO_NOT_LIGHT 0x00400000 |
0 | 261 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet. |
262 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet. | |
263 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it. | |
264 | |
265 /* 93 */ | |
266 #pragma pack(push, 1) | |
267 struct BLVFace | |
268 { | |
269 //----- (0046ED02) -------------------------------------------------------- | |
270 inline BLVFace() | |
271 { | |
272 this->uNumVertices = 0; | |
273 this->uAttributes = 0; | |
274 this->uFaceExtraID = 0; | |
275 this->pVertexIDs = 0; | |
276 this->pZInterceptDisplacements = 0; | |
277 this->pYInterceptDisplacements = 0; | |
278 this->pXInterceptDisplacements = 0; | |
279 } | |
280 | |
281 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
282 struct Texture *GetTexture(); | |
283 void FromODM(struct ODMFace *a2); | |
284 | |
285 inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;} | |
286 inline bool Visible() const {return !Invisible();} | |
287 inline bool TwoSided() const {return uAttributes & FACE_TWO_SIDED;} | |
288 inline bool Animated() const {return uAttributes & FACE_TEXTURE_ANIMATED;} | |
289 inline bool Clickable() const {return uAttributes & FACE_CLICKABLE;} | |
290 | |
291 | |
292 struct Plane_float_ pFacePlane; | |
293 struct Plane_int_ pFacePlane_old; | |
294 int zCalc1; | |
295 int zCalc2; | |
296 int zCalc3; | |
297 unsigned int uAttributes; | |
298 unsigned __int16 *pVertexIDs; | |
299 unsigned __int16 *pXInterceptDisplacements; | |
300 unsigned __int16 *pYInterceptDisplacements; | |
301 unsigned __int16 *pZInterceptDisplacements; | |
302 signed __int16 *pVertexUIDs; | |
303 signed __int16 *pVertexVIDs; | |
304 unsigned __int16 uFaceExtraID; | |
305 unsigned __int16 uBitmapID; | |
306 unsigned __int16 uSectorID; | |
307 __int16 uBackSectorID; | |
308 struct BBox_short_ pBounding; | |
309 PolygonType uPolygonType; | |
310 unsigned __int8 uNumVertices; | |
311 char field_5E; | |
312 char field_5F; | |
313 }; | |
314 #pragma pack(pop) | |
315 | |
316 /* 94 */ | |
317 #pragma pack(push, 1) | |
318 struct BLVFaceExtra | |
319 { | |
428 | 320 bool HasEventint(); |
0 | 321 |
322 __int16 field_0; | |
323 __int16 field_2; | |
324 __int16 field_4; | |
325 __int16 field_6; | |
326 __int16 field_8; | |
327 __int16 field_A; | |
328 __int16 field_C; | |
329 unsigned __int16 uAdditionalBitmapID; | |
330 __int16 field_10; | |
331 __int16 field_12; | |
332 __int16 sTextureDeltaU; | |
333 __int16 sTextureDeltaV; | |
334 __int16 sCogNumber; | |
335 unsigned __int16 uEventID; | |
336 __int16 field_1C; | |
337 __int16 field_1E; | |
338 __int16 field_20; | |
339 __int16 field_22; | |
340 }; | |
341 #pragma pack(pop) | |
342 | |
343 /* 95 */ | |
344 #pragma pack(push, 1) | |
345 struct BLVSector | |
346 { | |
347 int field_0; | |
348 unsigned __int16 uNumFloors; | |
349 __int16 field_6; | |
350 unsigned __int16 *pFloors; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
351 unsigned __int16 uNumWalls; |
0 | 352 __int16 field_E; |
353 unsigned __int16 *pWalls; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
354 unsigned __int16 uNumCeilings; |
0 | 355 __int16 field_16; |
356 unsigned __int16 *pCeilings; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
357 unsigned __int16 uNumFluids; |
0 | 358 __int16 field_1E; |
359 unsigned __int16 *pFluids; | |
360 __int16 uNumPortals; | |
361 __int16 field_26; | |
362 unsigned __int16 *pPortals; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
363 unsigned __int16 uNumFaces; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
364 unsigned __int16 uNumNonBSPFaces; |
0 | 365 unsigned __int16 *pFaceIDs; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
366 unsigned __int16 uNumCylinderFaces; |
0 | 367 __int16 field_36; |
368 int pCylinderFaces; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
369 unsigned __int16 uNumCogs; |
0 | 370 __int16 field_3E; |
371 unsigned __int16 *pCogs; | |
372 unsigned __int16 uNumDecorations; | |
373 __int16 field_46; | |
374 unsigned __int16 *pDecorationIDs; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
375 unsigned __int16 uNumMarkers; |
0 | 376 __int16 field_4E; |
377 unsigned __int16 *pMarkers; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
378 unsigned __int16 uNumLights; |
0 | 379 __int16 field_56; |
380 unsigned __int16 *pLights; | |
381 __int16 uWaterLevel; | |
382 __int16 uMistLevel; | |
383 __int16 uLightDistanceMultiplier; | |
384 __int16 uMinAmbientLightLevel; | |
385 __int16 uFirstBSPNode; | |
386 __int16 exit_tag; | |
387 BBox_short_ pBounding; | |
388 }; | |
389 #pragma pack(pop) | |
390 | |
391 | |
392 #pragma pack(push, 1) | |
393 struct BLVMapOutlines | |
394 { | |
395 uint uNumOutlines; | |
396 BLVMapOutline pOutlines[1]; | |
397 }; | |
398 #pragma pack(pop) | |
399 | |
400 | |
401 | |
402 #pragma pack(push, 1) | |
403 struct IndoorLocation_stru1 | |
404 { | |
405 unsigned __int64 uLastVisitDay; | |
406 char field_2F4[48]; | |
407 }; | |
408 #pragma pack(pop) | |
409 | |
410 | |
411 | |
412 /* 89 */ | |
413 #pragma pack(push, 1) | |
414 struct IndoorLocation | |
415 { | |
416 //----- (00462592) -------------------------------------------------------- | |
417 inline IndoorLocation() | |
418 { | |
419 bLoaded = 0; | |
420 ptr_0002B8_sector_lrdata = 0; | |
421 ptr_0002B4_doors_ddata = 0; | |
422 ptr_0002B0_sector_rdata = 0; | |
423 ptr_2AC = 0; | |
424 pVertices = 0; | |
425 pFaces = 0; | |
426 pFaceExtras = 0; | |
427 pSectors = 0; | |
428 pLights = 0; | |
429 pDoors = 0; | |
430 pNodes = 0; | |
431 pMapOutlines = 0; | |
432 uNumSpawnPoints = 0; | |
433 pSpawnPoints = 0; | |
434 } | |
435 | |
436 int GetSector(int sX, int sY, int sZ); | |
437 void Release(); | |
438 int Alloc(); | |
439 bool Load(char *pFilename, int a3, size_t i, char *pDest); | |
440 void Draw(); | |
441 void ToggleLight(unsigned int uLightID, unsigned int bToggle); | |
442 | |
443 static unsigned int GetLocationIndex(const char *Str1); | |
444 static void ExecDraw(bool bD3D); | |
445 static void ExecDraw_sw(unsigned int uFaceID); | |
446 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *a4); | |
447 | |
448 char pFilename[32]; | |
449 char field_20[48]; | |
450 unsigned int bLoaded; | |
451 char field_54[404]; | |
452 struct BLVHeader blv; | |
453 unsigned int uNumVertices; | |
454 struct Vec3_short_ *pVertices; | |
455 unsigned int uNumFaces; | |
456 struct BLVFace *pFaces; | |
457 unsigned int uNumFaceExtras; | |
458 struct BLVFaceExtra *pFaceExtras; | |
459 int uNumSectors; | |
460 struct BLVSector *pSectors; | |
461 int uNumLights; | |
462 struct BLVLightMM7 *pLights; | |
463 int uNumDoors; | |
464 struct BLVDoor *pDoors; | |
465 unsigned int uNumNodes; | |
466 struct BSPNode *pNodes; | |
467 BLVMapOutlines *pMapOutlines; | |
468 unsigned __int16 *ptr_2AC; | |
469 unsigned __int16 *ptr_0002B0_sector_rdata; | |
470 unsigned __int16 *ptr_0002B4_doors_ddata; | |
471 unsigned __int16 *ptr_0002B8_sector_lrdata; | |
472 unsigned int uNumSpawnPoints; | |
473 struct SpawnPointMM7 *pSpawnPoints; | |
474 struct DDM_DLV_Header dlv; | |
475 IndoorLocation_stru1 stru1; | |
476 char _visible_outlines[876]; | |
477 }; | |
478 #pragma pack(pop) | |
479 | |
480 extern IndoorLocation *pIndoor; | |
481 | |
482 | |
483 | |
484 | |
485 | |
486 | |
487 | |
488 | |
489 | |
490 | |
491 | |
492 | |
493 /* 263 */ | |
494 #pragma pack(push, 1) | |
495 struct IndoorLocation_drawstru | |
496 { | |
497 int field_0_timer; | |
186 | 498 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 499 Vec3_int_ vPosition; |
500 int sRotationY; | |
501 int sRotationX; | |
502 int field_1C_mb_fov; | |
503 unsigned __int16 *pRenderTarget; | |
504 unsigned int uTargetWidth; | |
505 unsigned int uTargetHeight; | |
506 unsigned int uViewportX; | |
507 unsigned int uViewportY; | |
508 unsigned int uViewportZ; | |
509 unsigned int uViewportW; | |
510 int field_3C; | |
511 int *pTargetZ; | |
512 }; | |
513 #pragma pack(pop) | |
514 | |
515 | |
516 | |
517 | |
518 | |
519 | |
520 | |
521 | |
522 | |
523 | |
524 | |
525 | |
526 /* 162 */ | |
527 #pragma pack(push, 1) | |
528 struct BLVRenderParams | |
529 { | |
530 int Reset(struct IndoorLocation_drawstru *a2); | |
531 | |
532 int field_0_timer_; | |
186 | 533 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 534 Vec3_int_ vPartyPos; |
535 int sPartyRotY; | |
536 int sPartyRotX; | |
537 int uPartySectorID; | |
538 int sCosineY; | |
539 int sSineY; | |
540 int sCosineNegX; | |
541 int sSineNegX; | |
542 float fCosineY; | |
543 float fSineY; | |
544 float fCosineNegX; | |
545 float fSineNegX; | |
546 int field_40; | |
547 float field_44; | |
548 unsigned __int16 *pRenderTarget; | |
549 unsigned int uTargetWidth; | |
550 unsigned int uTargetHeight; | |
551 unsigned int uViewportX; | |
552 unsigned int uViewportY; | |
553 unsigned int uViewportZ; | |
554 unsigned int uViewportW; | |
555 int field_64; | |
556 int *pTargetZBuffer; | |
557 int uViewportHeight; | |
558 int field_70; | |
559 int uViewportCenterX; | |
560 int uViewportCenterY; | |
561 struct BspRenderer_stru2 *field_7C; | |
562 unsigned int uNumFacesRenderedThisFrame; | |
563 int field_84; | |
564 int field_88; | |
565 int field_8C; | |
566 int field_90; | |
567 int field_94; | |
568 }; | |
569 #pragma pack(pop) | |
570 | |
571 extern struct BLVRenderParams *pBLVRenderParams; | |
572 | |
573 | |
574 | |
575 | |
576 | |
577 #include "Indoor_stuff.h" |