Mercurial > mm7
annotate Indoor.h @ 1339:8bfdc44cebfd
Слияние
author | Ritor1 |
---|---|
date | Fri, 05 Jul 2013 17:37:30 +0600 |
parents | bfde0563ecdc |
children | 78671379d8da |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "VectorTypes.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 /* 74 */ | |
32 #pragma pack(push, 1) | |
33 struct LevelDecoration | |
34 { | |
35 LevelDecoration(); | |
36 int GetGlobalEvent(); | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
37 bool IsInteractive(); |
0 | 38 bool _47A825(); |
39 | |
40 | |
41 unsigned __int16 uDecorationDescID; | |
42 __int16 field_2; | |
43 struct Vec3_int_ vPosition; | |
44 int field_10_y_rot; | |
45 __int16 uCog; | |
46 __int16 field_16_event_id; | |
47 __int16 field_18; | |
48 __int16 field_1A; | |
49 __int16 _idx_in_stru123; | |
50 __int16 field_1E; | |
51 }; | |
52 #pragma pack(pop) | |
1202 | 53 extern std::array<LevelDecoration, 3000> pLevelDecorations; |
0 | 54 extern size_t uNumLevelDecorations; |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
469
diff
changeset
|
55 extern LevelDecoration* activeLevelDecoration; |
0 | 56 |
57 | |
58 | |
59 | |
60 | |
61 | |
62 | |
63 | |
64 /* 86 */ | |
65 #pragma pack(push, 1) | |
66 struct SpawnPointMM6 | |
67 { | |
68 Vec3_int_ vPosition; | |
69 unsigned __int16 uRadius; | |
70 unsigned __int16 uKind; | |
71 unsigned __int16 uIndex; | |
72 unsigned __int16 uAttributes; | |
73 }; | |
74 #pragma pack(pop) | |
75 | |
76 | |
77 | |
78 /* 102 */ | |
79 #pragma pack(push, 1) | |
80 struct SpawnPointMM7 | |
81 { | |
82 //----- (00448DD6) -------------------------------------------------------- | |
83 SpawnPointMM7() | |
84 { | |
85 uRadius = 32; | |
86 uAttributes = 0; | |
87 uIndex = 0; | |
88 uKind = 0; | |
89 uGroup = 0; | |
90 } | |
91 | |
92 | |
93 Vec3_int_ vPosition; | |
94 unsigned __int16 uRadius; | |
95 unsigned __int16 uKind; | |
96 unsigned __int16 uIndex; | |
97 unsigned __int16 uAttributes; | |
98 unsigned int uGroup; | |
99 }; | |
100 #pragma pack(pop) | |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | |
108 | |
109 | |
110 | |
111 #pragma pack(push, 1) | |
112 struct DDM_DLV_Header | |
113 { | |
114 //----- (00462607) -------------------------------------------------------- | |
115 inline DDM_DLV_Header() | |
116 { | |
117 this->uLastRepawnDay = 0; | |
118 this->uNumRespawns = 0; | |
119 this->uReputation = 0; | |
120 this->field_C_alert = 0; | |
121 this->uNumFacesInBModels = 0; | |
122 this->uNumDecorations = 0; | |
123 this->uNumBModels = 0; | |
124 } | |
125 | |
126 | |
127 int uNumRespawns; | |
128 int uLastRepawnDay; | |
129 int uReputation; | |
130 int field_C_alert; | |
131 unsigned int uNumFacesInBModels; | |
132 unsigned int uNumDecorations; | |
133 unsigned int uNumBModels; | |
134 int field_1C; | |
135 int field_20; | |
136 int field_24; | |
137 }; | |
138 #pragma pack(pop) | |
139 | |
140 | |
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 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
289 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} |
0 | 290 inline bool Visible() const {return !Invisible();} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
291 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
292 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
293 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;} |
0 | 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 |