Mercurial > mm7
annotate Indoor.h @ 1280:89210052dbb4
bugfix PID_ID(v2->spell_caster_pid)==1000
author | Gloval |
---|---|
date | Sat, 15 Jun 2013 21:23:33 +0400 |
parents | 0aeac0b9ca30 |
children | bfde0563ecdc |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "VectorTypes.h" | |
810 | 3 #include "Weather.h" |
1262 | 4 #include "Indoor_stuff.h" |
0 | 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(); | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
27 bool IsInteractive(); |
0 | 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) | |
1202 | 43 extern std::array<LevelDecoration, 3000> pLevelDecorations; |
0 | 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 | |
133 /* 90 */ | |
134 #pragma pack(push, 1) | |
135 struct BLVHeader | |
136 { | |
137 char field_0[104]; | |
138 unsigned int uFaces_fdata_Size; | |
139 unsigned int uSector_rdata_Size; | |
140 unsigned int uSector_lrdata_Size; | |
141 unsigned int uDoors_ddata_Size; | |
142 char field_78[16]; | |
143 }; | |
144 #pragma pack(pop) | |
145 | |
146 | |
147 | |
148 /* 96 */ | |
149 #pragma pack(push, 1) | |
150 struct BLVSectorMM8 | |
151 { | |
152 int dword_000074; | |
153 }; | |
154 #pragma pack(pop) | |
155 | |
156 /* 97 */ | |
157 #pragma pack(push, 1) | |
158 struct BLVLightMM6 | |
159 { | |
160 Vec3_short_ vPosition; | |
161 __int16 uRadius; | |
162 __int16 uAttributes; | |
163 unsigned __int16 uBrightness; | |
164 }; | |
165 #pragma pack(pop) | |
166 | |
167 /* 98 */ | |
168 #pragma pack(push, 1) | |
711 | 169 struct BLVLightMM7 //10h |
0 | 170 { |
171 struct Vec3_short_ vPosition; | |
172 __int16 uRadius; | |
173 char uRed; | |
174 char uGreen; | |
175 char uBlue; | |
176 char uType; | |
177 __int16 uAtributes; // & 0x08 doesn't light faces | |
178 __int16 uBrightness; | |
179 }; | |
180 #pragma pack(pop) | |
181 | |
182 /* 99 */ | |
183 #pragma pack(push, 1) | |
184 struct BLVLightMM8 | |
185 { | |
186 int uID; | |
187 }; | |
188 #pragma pack(pop) | |
189 | |
190 | |
191 | |
192 /* 100 */ | |
193 #pragma pack(push, 1) | |
711 | 194 struct BLVDoor //50h |
0 | 195 { |
196 enum State: unsigned __int16 | |
197 { | |
198 Closed = 0, | |
199 Opening = 1, | |
200 Open = 2, | |
201 Closing = 3 | |
202 }; | |
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 State uState; | |
224 __int16 field_4E; | |
225 }; | |
226 #pragma pack(pop) | |
227 | |
228 /* 101 */ | |
229 #pragma pack(push, 1) | |
711 | 230 struct BLVMapOutline //0C |
0 | 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 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
242 #define FACE_PORTAL 0x00000001 // portal/two-sided |
638 | 243 #define FACE_CAN_SATURATE_COLOR 0x00000002 |
791 | 244 #define FACE_FLUID 0x00000010 // wavy animated water or lava |
1030 | 245 #define FACE_DONT_CACHE_TEXTURE 0x00000040 // do not load face texture if it isn't loaded already |
795 | 246 #define FACE_XY_PLANE 0x00000100 |
247 #define FACE_XZ_PLANE 0x00000200 | |
248 #define FACE_YZ_PLANE 0x00000400 | |
638 | 249 #define FACE_INVISIBLE 0x00002000 |
250 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID | |
251 #define FACE_OUTLINED 0x00010000 // outline face edges | |
252 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. | |
253 #define FACE_DO_NOT_LIGHT 0x00400000 | |
254 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet. | |
255 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet. | |
256 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it. | |
1053 | 257 #define FACE_PICKED 0x80000000 |
0 | 258 |
259 /* 93 */ | |
260 #pragma pack(push, 1) | |
711 | 261 struct BLVFace //60h |
0 | 262 { |
263 //----- (0046ED02) -------------------------------------------------------- | |
264 inline BLVFace() | |
265 { | |
266 this->uNumVertices = 0; | |
267 this->uAttributes = 0; | |
268 this->uFaceExtraID = 0; | |
269 this->pVertexIDs = 0; | |
270 this->pZInterceptDisplacements = 0; | |
271 this->pYInterceptDisplacements = 0; | |
272 this->pXInterceptDisplacements = 0; | |
273 } | |
274 | |
275 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
276 struct Texture *GetTexture(); | |
1025 | 277 void FromODM(struct ODMFace *face); |
0 | 278 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
279 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} |
0 | 280 inline bool Visible() const {return !Invisible();} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
281 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
282 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
283 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;} |
0 | 284 |
285 | |
286 struct Plane_float_ pFacePlane; | |
287 struct Plane_int_ pFacePlane_old; | |
288 int zCalc1; | |
289 int zCalc2; | |
290 int zCalc3; | |
291 unsigned int uAttributes; | |
292 unsigned __int16 *pVertexIDs; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
293 signed __int16 *pXInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
294 signed __int16 *pYInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
295 signed __int16 *pZInterceptDisplacements; |
0 | 296 signed __int16 *pVertexUIDs; |
297 signed __int16 *pVertexVIDs; | |
298 unsigned __int16 uFaceExtraID; | |
299 unsigned __int16 uBitmapID; | |
300 unsigned __int16 uSectorID; | |
301 __int16 uBackSectorID; | |
302 struct BBox_short_ pBounding; | |
303 PolygonType uPolygonType; | |
304 unsigned __int8 uNumVertices; | |
305 char field_5E; | |
306 char field_5F; | |
307 }; | |
308 #pragma pack(pop) | |
309 | |
310 /* 94 */ | |
311 #pragma pack(push, 1) | |
711 | 312 struct BLVFaceExtra //24h |
0 | 313 { |
428 | 314 bool HasEventint(); |
0 | 315 |
316 __int16 field_0; | |
317 __int16 field_2; | |
318 __int16 field_4; | |
319 __int16 field_6; | |
320 __int16 field_8; | |
321 __int16 field_A; | |
322 __int16 field_C; | |
323 unsigned __int16 uAdditionalBitmapID; | |
324 __int16 field_10; | |
325 __int16 field_12; | |
326 __int16 sTextureDeltaU; | |
327 __int16 sTextureDeltaV; | |
328 __int16 sCogNumber; | |
329 unsigned __int16 uEventID; | |
330 __int16 field_1C; | |
331 __int16 field_1E; | |
332 __int16 field_20; | |
333 __int16 field_22; | |
334 }; | |
335 #pragma pack(pop) | |
336 | |
337 /* 95 */ | |
338 #pragma pack(push, 1) | |
711 | 339 struct BLVSector //0x74 |
0 | 340 { |
341 int field_0; | |
342 unsigned __int16 uNumFloors; | |
343 __int16 field_6; | |
344 unsigned __int16 *pFloors; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
345 unsigned __int16 uNumWalls; |
0 | 346 __int16 field_E; |
347 unsigned __int16 *pWalls; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
348 unsigned __int16 uNumCeilings; |
0 | 349 __int16 field_16; |
350 unsigned __int16 *pCeilings; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
351 unsigned __int16 uNumFluids; |
0 | 352 __int16 field_1E; |
353 unsigned __int16 *pFluids; | |
354 __int16 uNumPortals; | |
355 __int16 field_26; | |
356 unsigned __int16 *pPortals; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
357 unsigned __int16 uNumFaces; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
358 unsigned __int16 uNumNonBSPFaces; |
0 | 359 unsigned __int16 *pFaceIDs; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
360 unsigned __int16 uNumCylinderFaces; |
0 | 361 __int16 field_36; |
362 int pCylinderFaces; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
363 unsigned __int16 uNumCogs; |
0 | 364 __int16 field_3E; |
365 unsigned __int16 *pCogs; | |
366 unsigned __int16 uNumDecorations; | |
367 __int16 field_46; | |
368 unsigned __int16 *pDecorationIDs; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
369 unsigned __int16 uNumMarkers; |
0 | 370 __int16 field_4E; |
371 unsigned __int16 *pMarkers; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
372 unsigned __int16 uNumLights; |
0 | 373 __int16 field_56; |
374 unsigned __int16 *pLights; | |
375 __int16 uWaterLevel; | |
376 __int16 uMistLevel; | |
377 __int16 uLightDistanceMultiplier; | |
378 __int16 uMinAmbientLightLevel; | |
379 __int16 uFirstBSPNode; | |
380 __int16 exit_tag; | |
381 BBox_short_ pBounding; | |
382 }; | |
383 #pragma pack(pop) | |
384 | |
385 | |
386 #pragma pack(push, 1) | |
387 struct BLVMapOutlines | |
388 { | |
711 | 389 int uNumOutlines; |
390 BLVMapOutline pOutlines[7000]; | |
0 | 391 }; |
392 #pragma pack(pop) | |
393 | |
394 | |
395 | |
810 | 396 |
0 | 397 |
398 | |
399 | |
400 /* 89 */ | |
401 #pragma pack(push, 1) | |
402 struct IndoorLocation | |
403 { | |
404 //----- (00462592) -------------------------------------------------------- | |
405 inline IndoorLocation() | |
406 { | |
407 bLoaded = 0; | |
408 ptr_0002B8_sector_lrdata = 0; | |
409 ptr_0002B4_doors_ddata = 0; | |
410 ptr_0002B0_sector_rdata = 0; | |
1006 | 411 pLFaces = 0; |
0 | 412 pVertices = 0; |
413 pFaces = 0; | |
414 pFaceExtras = 0; | |
415 pSectors = 0; | |
416 pLights = 0; | |
417 pDoors = 0; | |
418 pNodes = 0; | |
419 pMapOutlines = 0; | |
420 uNumSpawnPoints = 0; | |
421 pSpawnPoints = 0; | |
422 } | |
423 | |
424 int GetSector(int sX, int sY, int sZ); | |
425 void Release(); | |
711 | 426 bool Alloc(); |
0 | 427 bool Load(char *pFilename, int a3, size_t i, char *pDest); |
428 void Draw(); | |
711 | 429 void ToggleLight(signed int uLightID, unsigned int bToggle); |
0 | 430 |
431 static unsigned int GetLocationIndex(const char *Str1); | |
432 static void ExecDraw(bool bD3D); | |
433 static void ExecDraw_sw(unsigned int uFaceID); | |
794 | 434 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding); |
0 | 435 |
436 char pFilename[32]; | |
437 char field_20[48]; | |
438 unsigned int bLoaded; | |
439 char field_54[404]; | |
440 struct BLVHeader blv; | |
441 unsigned int uNumVertices; | |
442 struct Vec3_short_ *pVertices; | |
443 unsigned int uNumFaces; | |
444 struct BLVFace *pFaces; | |
445 unsigned int uNumFaceExtras; | |
446 struct BLVFaceExtra *pFaceExtras; | |
447 int uNumSectors; | |
448 struct BLVSector *pSectors; | |
449 int uNumLights; | |
450 struct BLVLightMM7 *pLights; | |
451 int uNumDoors; | |
452 struct BLVDoor *pDoors; | |
453 unsigned int uNumNodes; | |
454 struct BSPNode *pNodes; | |
455 BLVMapOutlines *pMapOutlines; | |
1006 | 456 unsigned __int16 *pLFaces; |
0 | 457 unsigned __int16 *ptr_0002B0_sector_rdata; |
458 unsigned __int16 *ptr_0002B4_doors_ddata; | |
459 unsigned __int16 *ptr_0002B8_sector_lrdata; | |
460 unsigned int uNumSpawnPoints; | |
461 struct SpawnPointMM7 *pSpawnPoints; | |
462 struct DDM_DLV_Header dlv; | |
810 | 463 LocationTime_stru1 stru1; |
837 | 464 char _visible_outlines[875]; |
465 char padding; | |
0 | 466 }; |
467 #pragma pack(pop) | |
468 | |
469 extern IndoorLocation *pIndoor; | |
470 | |
471 | |
472 | |
473 | |
474 | |
475 | |
476 | |
477 | |
478 | |
479 | |
480 | |
481 | |
482 /* 263 */ | |
483 #pragma pack(push, 1) | |
484 struct IndoorLocation_drawstru | |
485 { | |
486 int field_0_timer; | |
186 | 487 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 488 Vec3_int_ vPosition; |
489 int sRotationY; | |
490 int sRotationX; | |
491 int field_1C_mb_fov; | |
492 unsigned __int16 *pRenderTarget; | |
493 unsigned int uTargetWidth; | |
494 unsigned int uTargetHeight; | |
711 | 495 signed int uViewportX; |
496 signed int uViewportY; | |
497 signed int uViewportZ; | |
498 signed int uViewportW; | |
0 | 499 int field_3C; |
500 int *pTargetZ; | |
501 }; | |
502 #pragma pack(pop) | |
503 | |
504 | |
505 | |
506 | |
507 | |
508 | |
509 | |
510 | |
511 | |
512 | |
513 | |
514 | |
515 /* 162 */ | |
516 #pragma pack(push, 1) | |
517 struct BLVRenderParams | |
518 { | |
791 | 519 inline BLVRenderParams(): |
520 uFlags(0) | |
521 {} | |
522 | |
0 | 523 int Reset(struct IndoorLocation_drawstru *a2); |
524 | |
525 int field_0_timer_; | |
186 | 526 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 527 Vec3_int_ vPartyPos; |
528 int sPartyRotY; | |
529 int sPartyRotX; | |
530 int uPartySectorID; | |
531 int sCosineY; | |
532 int sSineY; | |
533 int sCosineNegX; | |
534 int sSineNegX; | |
535 float fCosineY; | |
536 float fSineY; | |
537 float fCosineNegX; | |
538 float fSineNegX; | |
539 int field_40; | |
1006 | 540 int field_44;//float |
0 | 541 unsigned __int16 *pRenderTarget; |
542 unsigned int uTargetWidth; | |
543 unsigned int uTargetHeight; | |
544 unsigned int uViewportX; | |
545 unsigned int uViewportY; | |
546 unsigned int uViewportZ; | |
547 unsigned int uViewportW; | |
548 int field_64; | |
549 int *pTargetZBuffer; | |
550 int uViewportHeight; | |
551 int field_70; | |
552 int uViewportCenterX; | |
553 int uViewportCenterY; | |
554 struct BspRenderer_stru2 *field_7C; | |
555 unsigned int uNumFacesRenderedThisFrame; | |
556 int field_84; | |
557 int field_88; | |
558 int field_8C; | |
559 int field_90; | |
560 int field_94; | |
561 }; | |
562 #pragma pack(pop) | |
563 | |
564 extern struct BLVRenderParams *pBLVRenderParams; | |
565 | |
566 | |
567 | |
568 |