Mercurial > mm7
annotate Indoor.h @ 1569:5cc08e71a308
m
author | Ritor1 |
---|---|
date | Mon, 02 Sep 2013 18:49:18 +0600 |
parents | 61451d5980bf |
children | af57b3b76fe4 |
rev | line source |
---|---|
0 | 1 #pragma once |
1480 | 2 #include "Level/Decoration.h" |
1262 | 3 #include "Indoor_stuff.h" |
0 | 4 |
5 | |
1323 | 6 #pragma pack(push, 1) |
7 struct LocationTime_stru1 | |
8 { | |
9 unsigned __int64 uLastVisitDay; | |
10 char sky_texture_name[12]; | |
11 int day_attrib; | |
12 int day_fogrange_1; | |
13 int day_fogrange_2; | |
14 char field_2F4[24]; | |
15 }; | |
16 #pragma pack(pop) | |
0 | 17 |
18 /* 319 */ | |
19 enum LEVEL_TYPE | |
20 { | |
21 LEVEL_null = 0, | |
22 LEVEL_Indoor = 0x1, | |
23 LEVEL_Outdoor = 0x2, | |
24 }; | |
25 extern LEVEL_TYPE uCurrentlyLoadedLevelType; | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
1202 | 32 extern std::array<LevelDecoration, 3000> pLevelDecorations; |
0 | 33 extern size_t uNumLevelDecorations; |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
469
diff
changeset
|
34 extern LevelDecoration* activeLevelDecoration; |
0 | 35 |
36 | |
37 | |
38 | |
39 | |
40 | |
41 | |
42 | |
43 /* 86 */ | |
44 #pragma pack(push, 1) | |
45 struct SpawnPointMM6 | |
46 { | |
47 Vec3_int_ vPosition; | |
48 unsigned __int16 uRadius; | |
49 unsigned __int16 uKind; | |
50 unsigned __int16 uIndex; | |
51 unsigned __int16 uAttributes; | |
52 }; | |
53 #pragma pack(pop) | |
54 | |
55 | |
56 | |
57 /* 102 */ | |
58 #pragma pack(push, 1) | |
59 struct SpawnPointMM7 | |
60 { | |
61 //----- (00448DD6) -------------------------------------------------------- | |
62 SpawnPointMM7() | |
63 { | |
64 uRadius = 32; | |
65 uAttributes = 0; | |
66 uIndex = 0; | |
67 uKind = 0; | |
68 uGroup = 0; | |
69 } | |
70 | |
71 | |
72 Vec3_int_ vPosition; | |
73 unsigned __int16 uRadius; | |
74 unsigned __int16 uKind; | |
75 unsigned __int16 uIndex; | |
76 unsigned __int16 uAttributes; | |
77 unsigned int uGroup; | |
78 }; | |
79 #pragma pack(pop) | |
80 | |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | |
89 | |
90 #pragma pack(push, 1) | |
91 struct DDM_DLV_Header | |
92 { | |
93 //----- (00462607) -------------------------------------------------------- | |
94 inline DDM_DLV_Header() | |
95 { | |
96 this->uLastRepawnDay = 0; | |
97 this->uNumRespawns = 0; | |
98 this->uReputation = 0; | |
99 this->field_C_alert = 0; | |
100 this->uNumFacesInBModels = 0; | |
101 this->uNumDecorations = 0; | |
102 this->uNumBModels = 0; | |
103 } | |
104 | |
105 | |
106 int uNumRespawns; | |
107 int uLastRepawnDay; | |
108 int uReputation; | |
109 int field_C_alert; | |
110 unsigned int uNumFacesInBModels; | |
111 unsigned int uNumDecorations; | |
112 unsigned int uNumBModels; | |
113 int field_1C; | |
114 int field_20; | |
115 int field_24; | |
116 }; | |
117 #pragma pack(pop) | |
118 | |
119 | |
120 | |
121 | |
122 /* 90 */ | |
123 #pragma pack(push, 1) | |
124 struct BLVHeader | |
125 { | |
126 char field_0[104]; | |
127 unsigned int uFaces_fdata_Size; | |
128 unsigned int uSector_rdata_Size; | |
129 unsigned int uSector_lrdata_Size; | |
130 unsigned int uDoors_ddata_Size; | |
131 char field_78[16]; | |
132 }; | |
133 #pragma pack(pop) | |
134 | |
135 | |
136 | |
137 /* 96 */ | |
138 #pragma pack(push, 1) | |
139 struct BLVSectorMM8 | |
140 { | |
141 int dword_000074; | |
142 }; | |
143 #pragma pack(pop) | |
144 | |
145 /* 97 */ | |
146 #pragma pack(push, 1) | |
147 struct BLVLightMM6 | |
148 { | |
149 Vec3_short_ vPosition; | |
150 __int16 uRadius; | |
151 __int16 uAttributes; | |
152 unsigned __int16 uBrightness; | |
153 }; | |
154 #pragma pack(pop) | |
155 | |
156 /* 98 */ | |
157 #pragma pack(push, 1) | |
711 | 158 struct BLVLightMM7 //10h |
0 | 159 { |
160 struct Vec3_short_ vPosition; | |
161 __int16 uRadius; | |
162 char uRed; | |
163 char uGreen; | |
164 char uBlue; | |
165 char uType; | |
166 __int16 uAtributes; // & 0x08 doesn't light faces | |
167 __int16 uBrightness; | |
168 }; | |
169 #pragma pack(pop) | |
170 | |
171 /* 99 */ | |
172 #pragma pack(push, 1) | |
173 struct BLVLightMM8 | |
174 { | |
175 int uID; | |
176 }; | |
177 #pragma pack(pop) | |
178 | |
179 | |
180 | |
181 /* 100 */ | |
182 #pragma pack(push, 1) | |
711 | 183 struct BLVDoor //50h |
0 | 184 { |
185 enum State: unsigned __int16 | |
186 { | |
187 Closed = 0, | |
188 Opening = 1, | |
189 Open = 2, | |
190 Closing = 3 | |
191 }; | |
192 | |
193 unsigned int uAttributes; | |
194 unsigned int uDoorID; | |
195 unsigned int uTimeSinceTriggered; | |
196 Vec3_int_ vDirection; | |
197 int uMoveLength; | |
198 int uOpenSpeed; | |
199 int uCloseSpeed; | |
200 unsigned __int16 *pVertexIDs; | |
201 unsigned __int16 *pFaceIDs; | |
202 unsigned __int16 *pSectorIDs; | |
203 __int16 *pDeltaUs; | |
204 __int16 *pDeltaVs; | |
205 unsigned __int16 *pXOffsets; | |
206 unsigned __int16 *pYOffsets; | |
207 unsigned __int16 *pZOffsets; | |
208 unsigned __int16 uNumVertices; | |
209 unsigned __int16 uNumFaces; | |
210 __int16 field_48; | |
211 unsigned __int16 uNumOffsets; | |
212 State uState; | |
213 __int16 field_4E; | |
214 }; | |
215 #pragma pack(pop) | |
216 | |
217 /* 101 */ | |
218 #pragma pack(push, 1) | |
711 | 219 struct BLVMapOutline //0C |
0 | 220 { |
221 unsigned __int16 uVertex1ID; | |
222 unsigned __int16 uVertex2ID; | |
223 unsigned __int16 uFace1ID; | |
224 unsigned __int16 uFace2ID; | |
225 __int16 sZ; | |
226 unsigned __int16 uFlags; | |
227 }; | |
228 #pragma pack(pop) | |
229 | |
230 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
231 #define FACE_PORTAL 0x00000001 // portal/two-sided |
638 | 232 #define FACE_CAN_SATURATE_COLOR 0x00000002 |
791 | 233 #define FACE_FLUID 0x00000010 // wavy animated water or lava |
1030 | 234 #define FACE_DONT_CACHE_TEXTURE 0x00000040 // do not load face texture if it isn't loaded already |
795 | 235 #define FACE_XY_PLANE 0x00000100 |
236 #define FACE_XZ_PLANE 0x00000200 | |
237 #define FACE_YZ_PLANE 0x00000400 | |
638 | 238 #define FACE_INVISIBLE 0x00002000 |
239 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID | |
240 #define FACE_OUTLINED 0x00010000 // outline face edges | |
241 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. | |
242 #define FACE_DO_NOT_LIGHT 0x00400000 | |
243 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet. | |
244 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet. | |
245 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it. | |
1053 | 246 #define FACE_PICKED 0x80000000 |
0 | 247 |
248 /* 93 */ | |
249 #pragma pack(push, 1) | |
711 | 250 struct BLVFace //60h |
0 | 251 { |
252 //----- (0046ED02) -------------------------------------------------------- | |
253 inline BLVFace() | |
254 { | |
255 this->uNumVertices = 0; | |
256 this->uAttributes = 0; | |
257 this->uFaceExtraID = 0; | |
258 this->pVertexIDs = 0; | |
259 this->pZInterceptDisplacements = 0; | |
260 this->pYInterceptDisplacements = 0; | |
261 this->pXInterceptDisplacements = 0; | |
262 } | |
263 | |
264 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
265 struct Texture *GetTexture(); | |
1025 | 266 void FromODM(struct ODMFace *face); |
0 | 267 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
268 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} |
0 | 269 inline bool Visible() const {return !Invisible();} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
270 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
271 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
272 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;} |
0 | 273 |
274 | |
275 struct Plane_float_ pFacePlane; | |
276 struct Plane_int_ pFacePlane_old; | |
277 int zCalc1; | |
278 int zCalc2; | |
279 int zCalc3; | |
280 unsigned int uAttributes; | |
281 unsigned __int16 *pVertexIDs; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
282 signed __int16 *pXInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
283 signed __int16 *pYInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
284 signed __int16 *pZInterceptDisplacements; |
0 | 285 signed __int16 *pVertexUIDs; |
286 signed __int16 *pVertexVIDs; | |
287 unsigned __int16 uFaceExtraID; | |
288 unsigned __int16 uBitmapID; | |
289 unsigned __int16 uSectorID; | |
290 __int16 uBackSectorID; | |
291 struct BBox_short_ pBounding; | |
292 PolygonType uPolygonType; | |
293 unsigned __int8 uNumVertices; | |
294 char field_5E; | |
295 char field_5F; | |
296 }; | |
297 #pragma pack(pop) | |
298 | |
299 /* 94 */ | |
300 #pragma pack(push, 1) | |
711 | 301 struct BLVFaceExtra //24h |
0 | 302 { |
428 | 303 bool HasEventint(); |
0 | 304 |
305 __int16 field_0; | |
306 __int16 field_2; | |
307 __int16 field_4; | |
308 __int16 field_6; | |
309 __int16 field_8; | |
310 __int16 field_A; | |
311 __int16 field_C; | |
312 unsigned __int16 uAdditionalBitmapID; | |
313 __int16 field_10; | |
314 __int16 field_12; | |
315 __int16 sTextureDeltaU; | |
316 __int16 sTextureDeltaV; | |
317 __int16 sCogNumber; | |
318 unsigned __int16 uEventID; | |
319 __int16 field_1C; | |
320 __int16 field_1E; | |
321 __int16 field_20; | |
322 __int16 field_22; | |
323 }; | |
324 #pragma pack(pop) | |
325 | |
326 /* 95 */ | |
327 #pragma pack(push, 1) | |
711 | 328 struct BLVSector //0x74 |
0 | 329 { |
330 int field_0; | |
331 unsigned __int16 uNumFloors; | |
332 __int16 field_6; | |
333 unsigned __int16 *pFloors; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
334 unsigned __int16 uNumWalls; |
0 | 335 __int16 field_E; |
336 unsigned __int16 *pWalls; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
337 unsigned __int16 uNumCeilings; |
0 | 338 __int16 field_16; |
339 unsigned __int16 *pCeilings; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
340 unsigned __int16 uNumFluids; |
0 | 341 __int16 field_1E; |
342 unsigned __int16 *pFluids; | |
343 __int16 uNumPortals; | |
344 __int16 field_26; | |
345 unsigned __int16 *pPortals; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
346 unsigned __int16 uNumFaces; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
347 unsigned __int16 uNumNonBSPFaces; |
0 | 348 unsigned __int16 *pFaceIDs; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
349 unsigned __int16 uNumCylinderFaces; |
0 | 350 __int16 field_36; |
351 int pCylinderFaces; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
352 unsigned __int16 uNumCogs; |
0 | 353 __int16 field_3E; |
354 unsigned __int16 *pCogs; | |
355 unsigned __int16 uNumDecorations; | |
356 __int16 field_46; | |
357 unsigned __int16 *pDecorationIDs; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
358 unsigned __int16 uNumMarkers; |
0 | 359 __int16 field_4E; |
360 unsigned __int16 *pMarkers; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
361 unsigned __int16 uNumLights; |
0 | 362 __int16 field_56; |
363 unsigned __int16 *pLights; | |
364 __int16 uWaterLevel; | |
365 __int16 uMistLevel; | |
366 __int16 uLightDistanceMultiplier; | |
367 __int16 uMinAmbientLightLevel; | |
368 __int16 uFirstBSPNode; | |
369 __int16 exit_tag; | |
370 BBox_short_ pBounding; | |
371 }; | |
372 #pragma pack(pop) | |
373 | |
374 | |
375 #pragma pack(push, 1) | |
376 struct BLVMapOutlines | |
377 { | |
711 | 378 int uNumOutlines; |
379 BLVMapOutline pOutlines[7000]; | |
0 | 380 }; |
381 #pragma pack(pop) | |
382 | |
383 | |
384 | |
810 | 385 |
0 | 386 |
387 | |
388 | |
389 /* 89 */ | |
390 #pragma pack(push, 1) | |
391 struct IndoorLocation | |
392 { | |
393 //----- (00462592) -------------------------------------------------------- | |
394 inline IndoorLocation() | |
395 { | |
396 bLoaded = 0; | |
397 ptr_0002B8_sector_lrdata = 0; | |
398 ptr_0002B4_doors_ddata = 0; | |
399 ptr_0002B0_sector_rdata = 0; | |
1006 | 400 pLFaces = 0; |
0 | 401 pVertices = 0; |
402 pFaces = 0; | |
403 pFaceExtras = 0; | |
404 pSectors = 0; | |
405 pLights = 0; | |
406 pDoors = 0; | |
407 pNodes = 0; | |
408 pMapOutlines = 0; | |
409 uNumSpawnPoints = 0; | |
410 pSpawnPoints = 0; | |
411 } | |
412 | |
413 int GetSector(int sX, int sY, int sZ); | |
414 void Release(); | |
711 | 415 bool Alloc(); |
0 | 416 bool Load(char *pFilename, int a3, size_t i, char *pDest); |
417 void Draw(); | |
711 | 418 void ToggleLight(signed int uLightID, unsigned int bToggle); |
0 | 419 |
420 static unsigned int GetLocationIndex(const char *Str1); | |
421 static void ExecDraw(bool bD3D); | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1376
diff
changeset
|
422 //static void ExecDraw_sw(unsigned int uFaceID); |
794 | 423 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding); |
0 | 424 |
425 char pFilename[32]; | |
426 char field_20[48]; | |
427 unsigned int bLoaded; | |
428 char field_54[404]; | |
429 struct BLVHeader blv; | |
430 unsigned int uNumVertices; | |
431 struct Vec3_short_ *pVertices; | |
432 unsigned int uNumFaces; | |
433 struct BLVFace *pFaces; | |
434 unsigned int uNumFaceExtras; | |
435 struct BLVFaceExtra *pFaceExtras; | |
436 int uNumSectors; | |
437 struct BLVSector *pSectors; | |
438 int uNumLights; | |
439 struct BLVLightMM7 *pLights; | |
440 int uNumDoors; | |
441 struct BLVDoor *pDoors; | |
442 unsigned int uNumNodes; | |
443 struct BSPNode *pNodes; | |
444 BLVMapOutlines *pMapOutlines; | |
1006 | 445 unsigned __int16 *pLFaces; |
0 | 446 unsigned __int16 *ptr_0002B0_sector_rdata; |
447 unsigned __int16 *ptr_0002B4_doors_ddata; | |
448 unsigned __int16 *ptr_0002B8_sector_lrdata; | |
449 unsigned int uNumSpawnPoints; | |
450 struct SpawnPointMM7 *pSpawnPoints; | |
451 struct DDM_DLV_Header dlv; | |
810 | 452 LocationTime_stru1 stru1; |
837 | 453 char _visible_outlines[875]; |
454 char padding; | |
0 | 455 }; |
456 #pragma pack(pop) | |
457 | |
458 extern IndoorLocation *pIndoor; | |
459 | |
460 | |
461 | |
462 | |
463 | |
464 | |
465 | |
466 | |
467 | |
468 | |
469 | |
470 | |
471 /* 263 */ | |
472 #pragma pack(push, 1) | |
473 struct IndoorLocation_drawstru | |
474 { | |
475 int field_0_timer; | |
186 | 476 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 477 Vec3_int_ vPosition; |
478 int sRotationY; | |
479 int sRotationX; | |
480 int field_1C_mb_fov; | |
481 unsigned __int16 *pRenderTarget; | |
482 unsigned int uTargetWidth; | |
483 unsigned int uTargetHeight; | |
711 | 484 signed int uViewportX; |
485 signed int uViewportY; | |
486 signed int uViewportZ; | |
487 signed int uViewportW; | |
0 | 488 int field_3C; |
489 int *pTargetZ; | |
490 }; | |
491 #pragma pack(pop) | |
492 | |
493 | |
494 | |
495 | |
496 | |
497 | |
498 | |
499 | |
500 | |
501 | |
502 | |
503 | |
504 /* 162 */ | |
505 #pragma pack(push, 1) | |
506 struct BLVRenderParams | |
507 { | |
791 | 508 inline BLVRenderParams(): |
509 uFlags(0) | |
510 {} | |
511 | |
0 | 512 int Reset(struct IndoorLocation_drawstru *a2); |
513 | |
514 int field_0_timer_; | |
186 | 515 int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines |
0 | 516 Vec3_int_ vPartyPos; |
517 int sPartyRotY; | |
518 int sPartyRotX; | |
519 int uPartySectorID; | |
520 int sCosineY; | |
521 int sSineY; | |
522 int sCosineNegX; | |
523 int sSineNegX; | |
524 float fCosineY; | |
525 float fSineY; | |
526 float fCosineNegX; | |
527 float fSineNegX; | |
528 int field_40; | |
1006 | 529 int field_44;//float |
0 | 530 unsigned __int16 *pRenderTarget; |
531 unsigned int uTargetWidth; | |
532 unsigned int uTargetHeight; | |
533 unsigned int uViewportX; | |
534 unsigned int uViewportY; | |
535 unsigned int uViewportZ; | |
536 unsigned int uViewportW; | |
537 int field_64; | |
538 int *pTargetZBuffer; | |
539 int uViewportHeight; | |
540 int field_70; | |
541 int uViewportCenterX; | |
542 int uViewportCenterY; | |
1376 | 543 struct BspRenderer_PortalViewportData *field_7C; |
0 | 544 unsigned int uNumFacesRenderedThisFrame; |
545 int field_84; | |
546 int field_88; | |
547 int field_8C; | |
548 int field_90; | |
549 int field_94; | |
550 }; | |
551 #pragma pack(pop) | |
552 | |
553 extern struct BLVRenderParams *pBLVRenderParams; | |
554 | |
555 | |
556 | |
557 |