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