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