Mercurial > mm7
annotate Indoor.h @ 1100:b82375804b5d
arrow damage fixed
author | zipi |
---|---|
date | Mon, 27 May 2013 11:19:14 +0100 |
parents | 1c10b24a4159 |
children | 39eaa6b00141 |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "VectorTypes.h" | |
810 | 3 #include "Weather.h" |
0 | 4 |
5 | |
6 | |
7 /* 319 */ | |
8 enum LEVEL_TYPE | |
9 { | |
10 LEVEL_null = 0, | |
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 _idx_in_stru123; | |
39 __int16 field_1E; | |
40 }; | |
41 #pragma pack(pop) | |
42 extern LevelDecoration pLevelDecorations[3000]; | |
43 extern size_t uNumLevelDecorations; | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
469
diff
changeset
|
44 extern LevelDecoration* activeLevelDecoration; |
0 | 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) | |
711 | 179 struct BLVLightMM7 //10h |
0 | 180 { |
181 struct Vec3_short_ vPosition; | |
182 __int16 uRadius; | |
183 char uRed; | |
184 char uGreen; | |
185 char uBlue; | |
186 char uType; | |
187 __int16 uAtributes; // & 0x08 doesn't light faces | |
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 | |
201 | |
202 /* 100 */ | |
203 #pragma pack(push, 1) | |
711 | 204 struct BLVDoor //50h |
0 | 205 { |
206 enum State: unsigned __int16 | |
207 { | |
208 Closed = 0, | |
209 Opening = 1, | |
210 Open = 2, | |
211 Closing = 3 | |
212 }; | |
213 | |
214 unsigned int uAttributes; | |
215 unsigned int uDoorID; | |
216 unsigned int uTimeSinceTriggered; | |
217 Vec3_int_ vDirection; | |
218 int uMoveLength; | |
219 int uOpenSpeed; | |
220 int uCloseSpeed; | |
221 unsigned __int16 *pVertexIDs; | |
222 unsigned __int16 *pFaceIDs; | |
223 unsigned __int16 *pSectorIDs; | |
224 __int16 *pDeltaUs; | |
225 __int16 *pDeltaVs; | |
226 unsigned __int16 *pXOffsets; | |
227 unsigned __int16 *pYOffsets; | |
228 unsigned __int16 *pZOffsets; | |
229 unsigned __int16 uNumVertices; | |
230 unsigned __int16 uNumFaces; | |
231 __int16 field_48; | |
232 unsigned __int16 uNumOffsets; | |
233 State uState; | |
234 __int16 field_4E; | |
235 }; | |
236 #pragma pack(pop) | |
237 | |
238 /* 101 */ | |
239 #pragma pack(push, 1) | |
711 | 240 struct BLVMapOutline //0C |
0 | 241 { |
242 unsigned __int16 uVertex1ID; | |
243 unsigned __int16 uVertex2ID; | |
244 unsigned __int16 uFace1ID; | |
245 unsigned __int16 uFace2ID; | |
246 __int16 sZ; | |
247 unsigned __int16 uFlags; | |
248 }; | |
249 #pragma pack(pop) | |
250 | |
251 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
252 #define FACE_PORTAL 0x00000001 // portal/two-sided |
638 | 253 #define FACE_CAN_SATURATE_COLOR 0x00000002 |
791 | 254 #define FACE_FLUID 0x00000010 // wavy animated water or lava |
1030 | 255 #define FACE_DONT_CACHE_TEXTURE 0x00000040 // do not load face texture if it isn't loaded already |
795 | 256 #define FACE_XY_PLANE 0x00000100 |
257 #define FACE_XZ_PLANE 0x00000200 | |
258 #define FACE_YZ_PLANE 0x00000400 | |
638 | 259 #define FACE_INVISIBLE 0x00002000 |
260 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID | |
261 #define FACE_OUTLINED 0x00010000 // outline face edges | |
262 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. | |
263 #define FACE_DO_NOT_LIGHT 0x00400000 | |
264 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet. | |
265 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet. | |
266 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it. | |
1053 | 267 #define FACE_PICKED 0x80000000 |
0 | 268 |
269 /* 93 */ | |
270 #pragma pack(push, 1) | |
711 | 271 struct BLVFace //60h |
0 | 272 { |
273 //----- (0046ED02) -------------------------------------------------------- | |
274 inline BLVFace() | |
275 { | |
276 this->uNumVertices = 0; | |
277 this->uAttributes = 0; | |
278 this->uFaceExtraID = 0; | |
279 this->pVertexIDs = 0; | |
280 this->pZInterceptDisplacements = 0; | |
281 this->pYInterceptDisplacements = 0; | |
282 this->pXInterceptDisplacements = 0; | |
283 } | |
284 | |
285 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
286 struct Texture *GetTexture(); | |
1025 | 287 void FromODM(struct ODMFace *face); |
0 | 288 |
289 inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;} | |
290 inline bool Visible() const {return !Invisible();} | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
291 inline bool Portal() const {return uAttributes & FACE_PORTAL;} |
791 | 292 inline bool Fluid() const {return uAttributes & FACE_FLUID;} |
0 | 293 inline bool Clickable() const {return uAttributes & FACE_CLICKABLE;} |
294 | |
295 | |
296 struct Plane_float_ pFacePlane; | |
297 struct Plane_int_ pFacePlane_old; | |
298 int zCalc1; | |
299 int zCalc2; | |
300 int zCalc3; | |
301 unsigned int uAttributes; | |
302 unsigned __int16 *pVertexIDs; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
303 signed __int16 *pXInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
304 signed __int16 *pYInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
305 signed __int16 *pZInterceptDisplacements; |
0 | 306 signed __int16 *pVertexUIDs; |
307 signed __int16 *pVertexVIDs; | |
308 unsigned __int16 uFaceExtraID; | |
309 unsigned __int16 uBitmapID; | |
310 unsigned __int16 uSectorID; | |
311 __int16 uBackSectorID; | |
312 struct BBox_short_ pBounding; | |
313 PolygonType uPolygonType; | |
314 unsigned __int8 uNumVertices; | |
315 char field_5E; | |
316 char field_5F; | |
317 }; | |
318 #pragma pack(pop) | |
319 | |
320 /* 94 */ | |
321 #pragma pack(push, 1) | |
711 | 322 struct BLVFaceExtra //24h |
0 | 323 { |
428 | 324 bool HasEventint(); |
0 | 325 |
326 __int16 field_0; | |
327 __int16 field_2; | |
328 __int16 field_4; | |
329 __int16 field_6; | |
330 __int16 field_8; | |
331 __int16 field_A; | |
332 __int16 field_C; | |
333 unsigned __int16 uAdditionalBitmapID; | |
334 __int16 field_10; | |
335 __int16 field_12; | |
336 __int16 sTextureDeltaU; | |
337 __int16 sTextureDeltaV; | |
338 __int16 sCogNumber; | |
339 unsigned __int16 uEventID; | |
340 __int16 field_1C; | |
341 __int16 field_1E; | |
342 __int16 field_20; | |
343 __int16 field_22; | |
344 }; | |
345 #pragma pack(pop) | |
346 | |
347 /* 95 */ | |
348 #pragma pack(push, 1) | |
711 | 349 struct BLVSector //0x74 |
0 | 350 { |
351 int field_0; | |
352 unsigned __int16 uNumFloors; | |
353 __int16 field_6; | |
354 unsigned __int16 *pFloors; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
355 unsigned __int16 uNumWalls; |
0 | 356 __int16 field_E; |
357 unsigned __int16 *pWalls; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
358 unsigned __int16 uNumCeilings; |
0 | 359 __int16 field_16; |
360 unsigned __int16 *pCeilings; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
361 unsigned __int16 uNumFluids; |
0 | 362 __int16 field_1E; |
363 unsigned __int16 *pFluids; | |
364 __int16 uNumPortals; | |
365 __int16 field_26; | |
366 unsigned __int16 *pPortals; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
367 unsigned __int16 uNumFaces; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
368 unsigned __int16 uNumNonBSPFaces; |
0 | 369 unsigned __int16 *pFaceIDs; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
370 unsigned __int16 uNumCylinderFaces; |
0 | 371 __int16 field_36; |
372 int pCylinderFaces; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
373 unsigned __int16 uNumCogs; |
0 | 374 __int16 field_3E; |
375 unsigned __int16 *pCogs; | |
376 unsigned __int16 uNumDecorations; | |
377 __int16 field_46; | |
378 unsigned __int16 *pDecorationIDs; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
379 unsigned __int16 uNumMarkers; |
0 | 380 __int16 field_4E; |
381 unsigned __int16 *pMarkers; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
382 unsigned __int16 uNumLights; |
0 | 383 __int16 field_56; |
384 unsigned __int16 *pLights; | |
385 __int16 uWaterLevel; | |
386 __int16 uMistLevel; | |
387 __int16 uLightDistanceMultiplier; | |
388 __int16 uMinAmbientLightLevel; | |
389 __int16 uFirstBSPNode; | |
390 __int16 exit_tag; | |
391 BBox_short_ pBounding; | |
392 }; | |
393 #pragma pack(pop) | |
394 | |
395 | |
396 #pragma pack(push, 1) | |
397 struct BLVMapOutlines | |
398 { | |
711 | 399 int uNumOutlines; |
400 BLVMapOutline pOutlines[7000]; | |
0 | 401 }; |
402 #pragma pack(pop) | |
403 | |
404 | |
405 | |
810 | 406 |
0 | 407 |
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; | |
1006 | 421 pLFaces = 0; |
0 | 422 pVertices = 0; |
423 pFaces = 0; | |
424 pFaceExtras = 0; | |
425 pSectors = 0; | |
426 pLights = 0; | |
427 pDoors = 0; | |
428 pNodes = 0; | |
429 pMapOutlines = 0; | |
430 uNumSpawnPoints = 0; | |
431 pSpawnPoints = 0; | |
432 } | |
433 | |
434 int GetSector(int sX, int sY, int sZ); | |
435 void Release(); | |
711 | 436 bool Alloc(); |
0 | 437 bool Load(char *pFilename, int a3, size_t i, char *pDest); |
438 void Draw(); | |
711 | 439 void ToggleLight(signed int uLightID, unsigned int bToggle); |
0 | 440 |
441 static unsigned int GetLocationIndex(const char *Str1); | |
442 static void ExecDraw(bool bD3D); | |
443 static void ExecDraw_sw(unsigned int uFaceID); | |
794 | 444 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding); |
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; | |
465 BLVMapOutlines *pMapOutlines; | |
1006 | 466 unsigned __int16 *pLFaces; |
0 | 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; | |
810 | 473 LocationTime_stru1 stru1; |
837 | 474 char _visible_outlines[875]; |
475 char padding; | |
0 | 476 }; |
477 #pragma pack(pop) | |
478 | |
479 extern IndoorLocation *pIndoor; | |
480 | |
481 | |
482 | |
483 | |
484 | |
485 | |
486 | |
487 | |
488 | |
489 | |
490 | |
491 | |
492 /* 263 */ | |
493 #pragma pack(push, 1) | |
494 struct IndoorLocation_drawstru | |
495 { | |
496 int field_0_timer; | |
186 | 497 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 498 Vec3_int_ vPosition; |
499 int sRotationY; | |
500 int sRotationX; | |
501 int field_1C_mb_fov; | |
502 unsigned __int16 *pRenderTarget; | |
503 unsigned int uTargetWidth; | |
504 unsigned int uTargetHeight; | |
711 | 505 signed int uViewportX; |
506 signed int uViewportY; | |
507 signed int uViewportZ; | |
508 signed int uViewportW; | |
0 | 509 int field_3C; |
510 int *pTargetZ; | |
511 }; | |
512 #pragma pack(pop) | |
513 | |
514 | |
515 | |
516 | |
517 | |
518 | |
519 | |
520 | |
521 | |
522 | |
523 | |
524 | |
525 /* 162 */ | |
526 #pragma pack(push, 1) | |
527 struct BLVRenderParams | |
528 { | |
791 | 529 inline BLVRenderParams(): |
530 uFlags(0) | |
531 {} | |
532 | |
0 | 533 int Reset(struct IndoorLocation_drawstru *a2); |
534 | |
535 int field_0_timer_; | |
186 | 536 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 537 Vec3_int_ vPartyPos; |
538 int sPartyRotY; | |
539 int sPartyRotX; | |
540 int uPartySectorID; | |
541 int sCosineY; | |
542 int sSineY; | |
543 int sCosineNegX; | |
544 int sSineNegX; | |
545 float fCosineY; | |
546 float fSineY; | |
547 float fCosineNegX; | |
548 float fSineNegX; | |
549 int field_40; | |
1006 | 550 int field_44;//float |
0 | 551 unsigned __int16 *pRenderTarget; |
552 unsigned int uTargetWidth; | |
553 unsigned int uTargetHeight; | |
554 unsigned int uViewportX; | |
555 unsigned int uViewportY; | |
556 unsigned int uViewportZ; | |
557 unsigned int uViewportW; | |
558 int field_64; | |
559 int *pTargetZBuffer; | |
560 int uViewportHeight; | |
561 int field_70; | |
562 int uViewportCenterX; | |
563 int uViewportCenterY; | |
564 struct BspRenderer_stru2 *field_7C; | |
565 unsigned int uNumFacesRenderedThisFrame; | |
566 int field_84; | |
567 int field_88; | |
568 int field_8C; | |
569 int field_90; | |
570 int field_94; | |
571 }; | |
572 #pragma pack(pop) | |
573 | |
574 extern struct BLVRenderParams *pBLVRenderParams; | |
575 | |
576 | |
577 | |
578 | |
579 | |
580 #include "Indoor_stuff.h" |