Mercurial > mm7
annotate Indoor.h @ 860:8fc2f035abc0
* AI function renames
* more PID replaces
author | zipi |
---|---|
date | Sun, 31 Mar 2013 12:39:29 +0100 |
parents | bebc19f3d2af |
children | e865f349aa41 c45d51b3f4f4 8b492d4722d4 |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "VectorTypes.h" | |
3 #include "IndoorCameraD3D.h" | |
810 | 4 #include "Weather.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(); | |
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) | |
711 | 180 struct BLVLightMM7 //10h |
0 | 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) | |
711 | 205 struct BLVDoor //50h |
0 | 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) | |
711 | 241 struct BLVMapOutline //0C |
0 | 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 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
253 #define FACE_PORTAL 0x00000001 // portal/two-sided |
638 | 254 #define FACE_CAN_SATURATE_COLOR 0x00000002 |
791 | 255 #define FACE_FLUID 0x00000010 // wavy animated water or lava |
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. | |
0 | 267 |
268 /* 93 */ | |
269 #pragma pack(push, 1) | |
711 | 270 struct BLVFace //60h |
0 | 271 { |
272 //----- (0046ED02) -------------------------------------------------------- | |
273 inline BLVFace() | |
274 { | |
275 this->uNumVertices = 0; | |
276 this->uAttributes = 0; | |
277 this->uFaceExtraID = 0; | |
278 this->pVertexIDs = 0; | |
279 this->pZInterceptDisplacements = 0; | |
280 this->pYInterceptDisplacements = 0; | |
281 this->pXInterceptDisplacements = 0; | |
282 } | |
283 | |
284 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
285 struct Texture *GetTexture(); | |
286 void FromODM(struct ODMFace *a2); | |
287 | |
288 inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;} | |
289 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
|
290 inline bool Portal() const {return uAttributes & FACE_PORTAL;} |
791 | 291 inline bool Fluid() const {return uAttributes & FACE_FLUID;} |
0 | 292 inline bool Clickable() const {return uAttributes & FACE_CLICKABLE;} |
293 | |
294 | |
295 struct Plane_float_ pFacePlane; | |
296 struct Plane_int_ pFacePlane_old; | |
297 int zCalc1; | |
298 int zCalc2; | |
299 int zCalc3; | |
300 unsigned int uAttributes; | |
301 unsigned __int16 *pVertexIDs; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
302 signed __int16 *pXInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
303 signed __int16 *pYInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
304 signed __int16 *pZInterceptDisplacements; |
0 | 305 signed __int16 *pVertexUIDs; |
306 signed __int16 *pVertexVIDs; | |
307 unsigned __int16 uFaceExtraID; | |
308 unsigned __int16 uBitmapID; | |
309 unsigned __int16 uSectorID; | |
310 __int16 uBackSectorID; | |
311 struct BBox_short_ pBounding; | |
312 PolygonType uPolygonType; | |
313 unsigned __int8 uNumVertices; | |
314 char field_5E; | |
315 char field_5F; | |
316 }; | |
317 #pragma pack(pop) | |
318 | |
319 /* 94 */ | |
320 #pragma pack(push, 1) | |
711 | 321 struct BLVFaceExtra //24h |
0 | 322 { |
428 | 323 bool HasEventint(); |
0 | 324 |
325 __int16 field_0; | |
326 __int16 field_2; | |
327 __int16 field_4; | |
328 __int16 field_6; | |
329 __int16 field_8; | |
330 __int16 field_A; | |
331 __int16 field_C; | |
332 unsigned __int16 uAdditionalBitmapID; | |
333 __int16 field_10; | |
334 __int16 field_12; | |
335 __int16 sTextureDeltaU; | |
336 __int16 sTextureDeltaV; | |
337 __int16 sCogNumber; | |
338 unsigned __int16 uEventID; | |
339 __int16 field_1C; | |
340 __int16 field_1E; | |
341 __int16 field_20; | |
342 __int16 field_22; | |
343 }; | |
344 #pragma pack(pop) | |
345 | |
346 /* 95 */ | |
347 #pragma pack(push, 1) | |
711 | 348 struct BLVSector //0x74 |
0 | 349 { |
350 int field_0; | |
351 unsigned __int16 uNumFloors; | |
352 __int16 field_6; | |
353 unsigned __int16 *pFloors; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
354 unsigned __int16 uNumWalls; |
0 | 355 __int16 field_E; |
356 unsigned __int16 *pWalls; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
357 unsigned __int16 uNumCeilings; |
0 | 358 __int16 field_16; |
359 unsigned __int16 *pCeilings; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
360 unsigned __int16 uNumFluids; |
0 | 361 __int16 field_1E; |
362 unsigned __int16 *pFluids; | |
363 __int16 uNumPortals; | |
364 __int16 field_26; | |
365 unsigned __int16 *pPortals; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
366 unsigned __int16 uNumFaces; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
367 unsigned __int16 uNumNonBSPFaces; |
0 | 368 unsigned __int16 *pFaceIDs; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
369 unsigned __int16 uNumCylinderFaces; |
0 | 370 __int16 field_36; |
371 int pCylinderFaces; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
372 unsigned __int16 uNumCogs; |
0 | 373 __int16 field_3E; |
374 unsigned __int16 *pCogs; | |
375 unsigned __int16 uNumDecorations; | |
376 __int16 field_46; | |
377 unsigned __int16 *pDecorationIDs; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
378 unsigned __int16 uNumMarkers; |
0 | 379 __int16 field_4E; |
380 unsigned __int16 *pMarkers; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
381 unsigned __int16 uNumLights; |
0 | 382 __int16 field_56; |
383 unsigned __int16 *pLights; | |
384 __int16 uWaterLevel; | |
385 __int16 uMistLevel; | |
386 __int16 uLightDistanceMultiplier; | |
387 __int16 uMinAmbientLightLevel; | |
388 __int16 uFirstBSPNode; | |
389 __int16 exit_tag; | |
390 BBox_short_ pBounding; | |
391 }; | |
392 #pragma pack(pop) | |
393 | |
394 | |
395 #pragma pack(push, 1) | |
396 struct BLVMapOutlines | |
397 { | |
711 | 398 int uNumOutlines; |
399 BLVMapOutline pOutlines[7000]; | |
0 | 400 }; |
401 #pragma pack(pop) | |
402 | |
403 | |
404 | |
810 | 405 |
0 | 406 |
407 | |
408 | |
409 /* 89 */ | |
410 #pragma pack(push, 1) | |
411 struct IndoorLocation | |
412 { | |
413 //----- (00462592) -------------------------------------------------------- | |
414 inline IndoorLocation() | |
415 { | |
416 bLoaded = 0; | |
417 ptr_0002B8_sector_lrdata = 0; | |
418 ptr_0002B4_doors_ddata = 0; | |
419 ptr_0002B0_sector_rdata = 0; | |
420 ptr_2AC = 0; | |
421 pVertices = 0; | |
422 pFaces = 0; | |
423 pFaceExtras = 0; | |
424 pSectors = 0; | |
425 pLights = 0; | |
426 pDoors = 0; | |
427 pNodes = 0; | |
428 pMapOutlines = 0; | |
429 uNumSpawnPoints = 0; | |
430 pSpawnPoints = 0; | |
431 } | |
432 | |
433 int GetSector(int sX, int sY, int sZ); | |
434 void Release(); | |
711 | 435 bool Alloc(); |
0 | 436 bool Load(char *pFilename, int a3, size_t i, char *pDest); |
437 void Draw(); | |
711 | 438 void ToggleLight(signed int uLightID, unsigned int bToggle); |
0 | 439 |
440 static unsigned int GetLocationIndex(const char *Str1); | |
441 static void ExecDraw(bool bD3D); | |
442 static void ExecDraw_sw(unsigned int uFaceID); | |
794 | 443 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding); |
0 | 444 |
445 char pFilename[32]; | |
446 char field_20[48]; | |
447 unsigned int bLoaded; | |
448 char field_54[404]; | |
449 struct BLVHeader blv; | |
450 unsigned int uNumVertices; | |
451 struct Vec3_short_ *pVertices; | |
452 unsigned int uNumFaces; | |
453 struct BLVFace *pFaces; | |
454 unsigned int uNumFaceExtras; | |
455 struct BLVFaceExtra *pFaceExtras; | |
456 int uNumSectors; | |
457 struct BLVSector *pSectors; | |
458 int uNumLights; | |
459 struct BLVLightMM7 *pLights; | |
460 int uNumDoors; | |
461 struct BLVDoor *pDoors; | |
462 unsigned int uNumNodes; | |
463 struct BSPNode *pNodes; | |
464 BLVMapOutlines *pMapOutlines; | |
465 unsigned __int16 *ptr_2AC; | |
466 unsigned __int16 *ptr_0002B0_sector_rdata; | |
467 unsigned __int16 *ptr_0002B4_doors_ddata; | |
468 unsigned __int16 *ptr_0002B8_sector_lrdata; | |
469 unsigned int uNumSpawnPoints; | |
470 struct SpawnPointMM7 *pSpawnPoints; | |
471 struct DDM_DLV_Header dlv; | |
810 | 472 LocationTime_stru1 stru1; |
837 | 473 char _visible_outlines[875]; |
474 char padding; | |
0 | 475 }; |
476 #pragma pack(pop) | |
477 | |
478 extern IndoorLocation *pIndoor; | |
479 | |
480 | |
481 | |
482 | |
483 | |
484 | |
485 | |
486 | |
487 | |
488 | |
489 | |
490 | |
491 /* 263 */ | |
492 #pragma pack(push, 1) | |
493 struct IndoorLocation_drawstru | |
494 { | |
495 int field_0_timer; | |
186 | 496 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 497 Vec3_int_ vPosition; |
498 int sRotationY; | |
499 int sRotationX; | |
500 int field_1C_mb_fov; | |
501 unsigned __int16 *pRenderTarget; | |
502 unsigned int uTargetWidth; | |
503 unsigned int uTargetHeight; | |
711 | 504 signed int uViewportX; |
505 signed int uViewportY; | |
506 signed int uViewportZ; | |
507 signed int uViewportW; | |
0 | 508 int field_3C; |
509 int *pTargetZ; | |
510 }; | |
511 #pragma pack(pop) | |
512 | |
513 | |
514 | |
515 | |
516 | |
517 | |
518 | |
519 | |
520 | |
521 | |
522 | |
523 | |
524 /* 162 */ | |
525 #pragma pack(push, 1) | |
526 struct BLVRenderParams | |
527 { | |
791 | 528 inline BLVRenderParams(): |
529 uFlags(0) | |
530 {} | |
531 | |
0 | 532 int Reset(struct IndoorLocation_drawstru *a2); |
533 | |
534 int field_0_timer_; | |
186 | 535 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 536 Vec3_int_ vPartyPos; |
537 int sPartyRotY; | |
538 int sPartyRotX; | |
539 int uPartySectorID; | |
540 int sCosineY; | |
541 int sSineY; | |
542 int sCosineNegX; | |
543 int sSineNegX; | |
544 float fCosineY; | |
545 float fSineY; | |
546 float fCosineNegX; | |
547 float fSineNegX; | |
548 int field_40; | |
549 float field_44; | |
550 unsigned __int16 *pRenderTarget; | |
551 unsigned int uTargetWidth; | |
552 unsigned int uTargetHeight; | |
553 unsigned int uViewportX; | |
554 unsigned int uViewportY; | |
555 unsigned int uViewportZ; | |
556 unsigned int uViewportW; | |
557 int field_64; | |
558 int *pTargetZBuffer; | |
559 int uViewportHeight; | |
560 int field_70; | |
561 int uViewportCenterX; | |
562 int uViewportCenterY; | |
563 struct BspRenderer_stru2 *field_7C; | |
564 unsigned int uNumFacesRenderedThisFrame; | |
565 int field_84; | |
566 int field_88; | |
567 int field_8C; | |
568 int field_90; | |
569 int field_94; | |
570 }; | |
571 #pragma pack(pop) | |
572 | |
573 extern struct BLVRenderParams *pBLVRenderParams; | |
574 | |
575 | |
576 | |
577 | |
578 | |
579 #include "Indoor_stuff.h" |