Mercurial > mm7
annotate Indoor.h @ 2055:95e9a5141338
PlayerModule.swig
author | Ritor1 |
---|---|
date | Sat, 30 Nov 2013 20:08:51 +0600 |
parents | 3fa489e0a3f2 |
children | 259df09dfb50 52abdea20b9e |
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 |
795 | 231 #define FACE_XY_PLANE 0x00000100 |
232 #define FACE_XZ_PLANE 0x00000200 | |
233 #define FACE_YZ_PLANE 0x00000400 | |
638 | 234 #define FACE_INVISIBLE 0x00002000 |
235 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID | |
236 #define FACE_OUTLINED 0x00010000 // outline face edges | |
237 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. | |
1922 | 238 #define FACE_INDOOR_SKY 0x00400000 |
638 | 239 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet. |
240 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet. | |
241 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it. | |
1053 | 242 #define FACE_PICKED 0x80000000 |
0 | 243 |
244 /* 93 */ | |
245 #pragma pack(push, 1) | |
711 | 246 struct BLVFace //60h |
0 | 247 { |
248 //----- (0046ED02) -------------------------------------------------------- | |
249 inline BLVFace() | |
250 { | |
251 this->uNumVertices = 0; | |
252 this->uAttributes = 0; | |
253 this->uFaceExtraID = 0; | |
254 this->pVertexIDs = 0; | |
255 this->pZInterceptDisplacements = 0; | |
256 this->pYInterceptDisplacements = 0; | |
257 this->pXInterceptDisplacements = 0; | |
258 } | |
259 | |
260 char _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
261 struct Texture *GetTexture(); | |
1025 | 262 void FromODM(struct ODMFace *face); |
0 | 263 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
264 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} |
0 | 265 inline bool Visible() const {return !Invisible();} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
266 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
267 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
268 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;} |
2027 | 269 inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;} |
0 | 270 |
271 struct Plane_float_ pFacePlane; | |
272 struct Plane_int_ pFacePlane_old; | |
273 int zCalc1; | |
274 int zCalc2; | |
275 int zCalc3; | |
276 unsigned int uAttributes; | |
277 unsigned __int16 *pVertexIDs; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
278 signed __int16 *pXInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
279 signed __int16 *pYInterceptDisplacements; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
280 signed __int16 *pZInterceptDisplacements; |
0 | 281 signed __int16 *pVertexUIDs; |
282 signed __int16 *pVertexVIDs; | |
283 unsigned __int16 uFaceExtraID; | |
284 unsigned __int16 uBitmapID; | |
285 unsigned __int16 uSectorID; | |
286 __int16 uBackSectorID; | |
287 struct BBox_short_ pBounding; | |
288 PolygonType uPolygonType; | |
289 unsigned __int8 uNumVertices; | |
290 char field_5E; | |
291 char field_5F; | |
292 }; | |
293 #pragma pack(pop) | |
294 | |
295 /* 94 */ | |
296 #pragma pack(push, 1) | |
711 | 297 struct BLVFaceExtra //24h |
0 | 298 { |
428 | 299 bool HasEventint(); |
0 | 300 |
301 __int16 field_0; | |
302 __int16 field_2; | |
303 __int16 field_4; | |
304 __int16 field_6; | |
305 __int16 field_8; | |
306 __int16 field_A; | |
307 __int16 field_C; | |
308 unsigned __int16 uAdditionalBitmapID; | |
309 __int16 field_10; | |
310 __int16 field_12; | |
311 __int16 sTextureDeltaU; | |
312 __int16 sTextureDeltaV; | |
313 __int16 sCogNumber; | |
314 unsigned __int16 uEventID; | |
315 __int16 field_1C; | |
316 __int16 field_1E; | |
317 __int16 field_20; | |
318 __int16 field_22; | |
319 }; | |
320 #pragma pack(pop) | |
321 | |
322 /* 95 */ | |
323 #pragma pack(push, 1) | |
711 | 324 struct BLVSector //0x74 |
0 | 325 { |
326 int field_0; | |
327 unsigned __int16 uNumFloors; | |
328 __int16 field_6; | |
329 unsigned __int16 *pFloors; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
330 unsigned __int16 uNumWalls; |
0 | 331 __int16 field_E; |
332 unsigned __int16 *pWalls; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
333 unsigned __int16 uNumCeilings; |
0 | 334 __int16 field_16; |
335 unsigned __int16 *pCeilings; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
336 unsigned __int16 uNumFluids; |
0 | 337 __int16 field_1E; |
338 unsigned __int16 *pFluids; | |
339 __int16 uNumPortals; | |
340 __int16 field_26; | |
341 unsigned __int16 *pPortals; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
342 unsigned __int16 uNumFaces; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
343 unsigned __int16 uNumNonBSPFaces; |
0 | 344 unsigned __int16 *pFaceIDs; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
345 unsigned __int16 uNumCylinderFaces; |
0 | 346 __int16 field_36; |
347 int pCylinderFaces; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
348 unsigned __int16 uNumCogs; |
0 | 349 __int16 field_3E; |
350 unsigned __int16 *pCogs; | |
351 unsigned __int16 uNumDecorations; | |
352 __int16 field_46; | |
353 unsigned __int16 *pDecorationIDs; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
354 unsigned __int16 uNumMarkers; |
0 | 355 __int16 field_4E; |
356 unsigned __int16 *pMarkers; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
520
diff
changeset
|
357 unsigned __int16 uNumLights; |
0 | 358 __int16 field_56; |
359 unsigned __int16 *pLights; | |
360 __int16 uWaterLevel; | |
361 __int16 uMistLevel; | |
362 __int16 uLightDistanceMultiplier; | |
363 __int16 uMinAmbientLightLevel; | |
364 __int16 uFirstBSPNode; | |
365 __int16 exit_tag; | |
366 BBox_short_ pBounding; | |
367 }; | |
368 #pragma pack(pop) | |
369 | |
370 | |
371 #pragma pack(push, 1) | |
372 struct BLVMapOutlines | |
373 { | |
711 | 374 int uNumOutlines; |
375 BLVMapOutline pOutlines[7000]; | |
0 | 376 }; |
377 #pragma pack(pop) | |
378 | |
379 | |
380 | |
810 | 381 |
0 | 382 |
383 | |
384 | |
385 /* 89 */ | |
386 #pragma pack(push, 1) | |
387 struct IndoorLocation | |
388 { | |
389 //----- (00462592) -------------------------------------------------------- | |
390 inline IndoorLocation() | |
391 { | |
392 bLoaded = 0; | |
393 ptr_0002B8_sector_lrdata = 0; | |
394 ptr_0002B4_doors_ddata = 0; | |
395 ptr_0002B0_sector_rdata = 0; | |
1006 | 396 pLFaces = 0; |
0 | 397 pVertices = 0; |
398 pFaces = 0; | |
399 pFaceExtras = 0; | |
400 pSectors = 0; | |
401 pLights = 0; | |
402 pDoors = 0; | |
403 pNodes = 0; | |
404 pMapOutlines = 0; | |
405 uNumSpawnPoints = 0; | |
406 pSpawnPoints = 0; | |
407 } | |
408 | |
409 int GetSector(int sX, int sY, int sZ); | |
410 void Release(); | |
711 | 411 bool Alloc(); |
0 | 412 bool Load(char *pFilename, int a3, size_t i, char *pDest); |
413 void Draw(); | |
711 | 414 void ToggleLight(signed int uLightID, unsigned int bToggle); |
0 | 415 |
416 static unsigned int GetLocationIndex(const char *Str1); | |
417 static void ExecDraw(bool bD3D); | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1376
diff
changeset
|
418 //static void ExecDraw_sw(unsigned int uFaceID); |
794 | 419 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding); |
0 | 420 |
421 char pFilename[32]; | |
422 char field_20[48]; | |
423 unsigned int bLoaded; | |
424 char field_54[404]; | |
425 struct BLVHeader blv; | |
426 unsigned int uNumVertices; | |
427 struct Vec3_short_ *pVertices; | |
428 unsigned int uNumFaces; | |
429 struct BLVFace *pFaces; | |
430 unsigned int uNumFaceExtras; | |
431 struct BLVFaceExtra *pFaceExtras; | |
432 int uNumSectors; | |
433 struct BLVSector *pSectors; | |
434 int uNumLights; | |
435 struct BLVLightMM7 *pLights; | |
436 int uNumDoors; | |
437 struct BLVDoor *pDoors; | |
438 unsigned int uNumNodes; | |
439 struct BSPNode *pNodes; | |
440 BLVMapOutlines *pMapOutlines; | |
1006 | 441 unsigned __int16 *pLFaces; |
0 | 442 unsigned __int16 *ptr_0002B0_sector_rdata; |
443 unsigned __int16 *ptr_0002B4_doors_ddata; | |
444 unsigned __int16 *ptr_0002B8_sector_lrdata; | |
445 unsigned int uNumSpawnPoints; | |
446 struct SpawnPointMM7 *pSpawnPoints; | |
447 struct DDM_DLV_Header dlv; | |
810 | 448 LocationTime_stru1 stru1; |
837 | 449 char _visible_outlines[875]; |
450 char padding; | |
0 | 451 }; |
452 #pragma pack(pop) | |
453 | |
454 extern IndoorLocation *pIndoor; | |
455 | |
456 | |
457 | |
458 | |
459 | |
460 | |
461 | |
462 | |
463 | |
464 | |
465 | |
1641 | 466 |
0 | 467 |
468 /* 162 */ | |
469 #pragma pack(push, 1) | |
470 struct BLVRenderParams | |
471 { | |
1642 | 472 inline BLVRenderParams() |
1641 | 473 { |
474 uViewportX = 0; | |
475 uViewportY = 0; | |
476 uViewportZ = 0; | |
477 uViewportW = 0; | |
478 } | |
791 | 479 |
1641 | 480 void Reset(); |
0 | 481 |
482 int field_0_timer_; | |
1642 | 483 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
|
484 Vec3_int_ _unused_vPartyPos; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
485 int _unused_sPartyRotY; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
486 int _unused_sPartyRotX; |
0 | 487 int uPartySectorID; |
1642 | 488 int _unused_sCosineY; // matches ODMRenderParams::int sines and cosines |
489 int _unused_sSineY; // computed in 0048600E | |
490 int _unused_sCosineNegX; // merged into IndoorCameraD3D | |
491 int _unused_sSineNegX; // --//-- | |
492 float _unused_fCosineY; // matches old IndoorCamera::fRotationCosineY (new IndoorCameraD3D::fRotationCosineY) | |
493 float _unused_fSineY; // matches old IndoorCamera::fRotationSineY (new IndoorCameraD3D::fRotationSineY) | |
494 float _unused_fCosineNegX; // the same | |
495 float _unused_fSineNegX; // the same | |
1641 | 496 int fov_rad_fixpoint; |
497 int fov_rad_inv_fixpoint;//float | |
0 | 498 unsigned __int16 *pRenderTarget; |
499 unsigned int uTargetWidth; | |
500 unsigned int uTargetHeight; | |
501 unsigned int uViewportX; | |
502 unsigned int uViewportY; | |
503 unsigned int uViewportZ; | |
504 unsigned int uViewportW; | |
505 int field_64; | |
506 int *pTargetZBuffer; | |
507 int uViewportHeight; | |
1641 | 508 int uViewportWidth; |
0 | 509 int uViewportCenterX; |
510 int uViewportCenterY; | |
1376 | 511 struct BspRenderer_PortalViewportData *field_7C; |
0 | 512 unsigned int uNumFacesRenderedThisFrame; |
513 int field_84; | |
514 int field_88; | |
515 int field_8C; | |
516 int field_90; | |
517 int field_94; | |
518 }; | |
519 #pragma pack(pop) | |
1637 | 520 extern BLVRenderParams *pBLVRenderParams; |
0 | 521 |
522 | |
523 | |
524 |