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