Mercurial > mm7
annotate Engine/Graphics/Indoor.h @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | dd36326a9994 |
children |
rev | line source |
---|---|
2496 | 1 #pragma once |
2 #include <array> | |
3 | |
4 #include "Render.h" | |
5 #include "IndoorCameraD3D.h" | |
2499 | 6 #include "../mm7_data.h" |
2496 | 7 |
8 /* 358 */ | |
9 #pragma pack(push, 1) | |
2562
b8a56afc6ba1
new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents:
2508
diff
changeset
|
10 struct LightsData |
2496 | 11 { |
12 int field_0; | |
13 Plane_int_ plane_4; | |
14 Vec3_int_ vec_14; | |
15 Vec3_int_ vec_20; | |
16 unsigned int uCurrentAmbientLightLevel; | |
17 int field_30; | |
18 int field_34; | |
19 int field_38; | |
20 int pDeltaUV[2]; | |
21 int field_44; | |
22 int field_48; | |
23 char field_4C[8]; | |
24 Vec3_int_ rotated_normal; | |
25 Vec3_int_ vec_60; | |
26 int field_6C; | |
27 Vec3_int_ vec_70; | |
28 int field_7C; | |
29 Vec3_int_ vec_80; | |
30 Vec3_int_ vec_8C; | |
31 int field_98; | |
32 Vec3_int_ vec_9C; | |
33 int field_A8; | |
34 unsigned int uNumLightsApplied; | |
35 int _blv_lights_radii[20]; | |
36 int _blv_lights_inv_radii[20]; | |
37 int _blv_lights_xs[20]; | |
38 int _blv_lights_ys[20]; | |
39 int _blv_lights_light_dot_faces[20]; | |
40 int field_240; | |
41 int field_244; | |
42 int field_248; | |
43 int field_24C; | |
44 int field_250; | |
45 int field_254; | |
46 int field_258; | |
47 int field_25C; | |
48 int field_260; | |
49 int field_264; | |
50 int field_268; | |
51 int field_26C; | |
52 int field_270; | |
53 int field_274; | |
54 int field_278; | |
55 int field_27C; | |
56 int field_280; | |
57 int field_284; | |
58 int field_288; | |
59 int field_28C; | |
60 int _blv_lights_zs[20]; | |
61 float _blv_lights_rs[20]; | |
62 float _blv_lights_gs[20]; | |
63 float _blv_lights_bs[20]; | |
64 char _blv_lights_types[20]; | |
65 int field_3E4; | |
66 int field_3E8; | |
67 int field_3EC; | |
68 int field_3F0; | |
69 int field_3F4; | |
70 unsigned int uDefaultAmbientLightLevel; | |
71 }; | |
72 #pragma pack(pop) | |
73 | |
2562
b8a56afc6ba1
new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents:
2508
diff
changeset
|
74 extern LightsData Lights; // idb |
2496 | 75 |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | |
83 /* 345 */ | |
84 #pragma pack(push, 1) | |
85 struct stru315 | |
86 { | |
87 int field_0; | |
88 int field_4; | |
89 int field_8; | |
90 int field_C; | |
91 int field_10; | |
92 int field_14; | |
93 int field_18; | |
94 int field_1C; | |
95 int field_20; | |
96 int field_24; | |
97 int field_28; | |
98 int field_2C; | |
99 int field_30; | |
100 unsigned __int16 *field_34_palette; | |
101 unsigned __int16 *pTextureLOD; | |
102 unsigned int *pDepthBuffer; | |
103 unsigned __int16 *pColorBuffer; | |
104 }; | |
105 #pragma pack(pop) | |
106 | |
107 | |
108 | |
109 | |
110 | |
111 /* 346 */ | |
112 #pragma pack(push, 1) | |
113 struct stru316 | |
114 { | |
115 int field_0; | |
116 int field_4; | |
117 int field_8; | |
118 int field_C; | |
119 int field_10; | |
120 int field_14; | |
121 int field_18; | |
122 int field_1C; | |
123 int field_20; | |
124 unsigned __int16 *field_24_palette; | |
125 }; | |
126 #pragma pack(pop) | |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | |
133 /* 134 */ | |
134 #pragma pack(push, 1) | |
135 struct stru141_actor_collision_object | |
136 { | |
137 int _47050A(int a2); | |
138 | |
139 int field_0; | |
140 int prolly_normal_d; | |
141 int field_8_radius; | |
142 int height; | |
143 int field_10; | |
144 int field_14; | |
145 int field_18; | |
146 Vec3_int_ velocity; | |
147 Vec3_int_ normal; | |
148 Vec3_int_ position; | |
149 Vec3_int_ normal2; | |
150 int field_4C; | |
151 int field_50; | |
152 int field_54; | |
153 Vec3_int_ direction; // velocity's unit vector | |
154 int speed; | |
155 int inv_speed; | |
156 int field_6C; | |
157 int field_70; | |
158 unsigned int uSectorID; | |
159 unsigned int uFaceID; | |
160 int field_7C; | |
161 int field_80; | |
162 int field_84; | |
163 int field_88; | |
164 int sMaxX; | |
165 int sMinX; | |
166 int sMaxY; | |
167 int sMinY; | |
168 int sMaxZ; | |
169 int sMinZ; | |
170 int field_A4; | |
171 }; | |
172 #pragma pack(pop) | |
173 extern stru141_actor_collision_object stru_721530; | |
174 | |
175 | |
176 | |
177 | |
178 | |
179 | |
180 /* 378 */ | |
181 #pragma pack(push, 1) | |
182 struct stru337_stru0 | |
183 { | |
184 int field_0; | |
185 int field_4; | |
186 int field_8; | |
187 int field_C; | |
188 int field_10; | |
189 }; | |
190 #pragma pack(pop) | |
191 | |
192 | |
193 | |
194 /* 377 */ | |
195 #pragma pack(push, 1) | |
196 struct stru337 | |
197 { | |
198 stru337_stru0 field_0; | |
199 int field_14; | |
200 int field_18; | |
201 int field_1C; | |
202 int field_20; | |
203 int field_24; | |
204 int field_28; | |
205 int field_2C; | |
206 int field_30; | |
207 stru337_stru0 field_34; | |
208 }; | |
209 #pragma pack(pop) | |
210 extern stru337 stru_F81018; | |
211 | |
212 | |
213 /* 291 */ | |
214 enum PolygonType : __int8 | |
215 { | |
216 POLYGON_Invalid = 0x0, | |
217 POLYGON_VerticalWall = 0x1, | |
218 POLYGON_unk = 0x2, | |
219 POLYGON_Floor = 0x3, | |
220 POLYGON_InBetweenFloorAndWall = 0x4, | |
221 POLYGON_Ceiling = 0x5, | |
222 POLYGON_InBetweenCeilingAndWall = 0x6, | |
223 }; | |
224 | |
225 | |
226 /* 147 */ | |
227 #pragma pack(push, 1) | |
228 | |
229 struct stru154 | |
230 { | |
231 //----- (0049B001) -------------------------------------------------------- | |
232 inline stru154() | |
233 {} | |
234 | |
235 //----- (0049B027) -------------------------------------------------------- | |
236 inline ~stru154() | |
237 {} | |
238 | |
239 void GetFacePlaneAndClassify(struct ODMFace *a2, struct BSPVertexBuffer *a3); | |
240 void ClassifyPolygon(struct Vec3_float_ *pNormal, float dist); | |
241 void GetFacePlane(struct ODMFace *pFace, struct BSPVertexBuffer *pVertices, struct Vec3_float_ *pOutNormal, float *pOutDist); | |
242 | |
243 | |
244 void(***vdestructor_ptr)(stru154 *, bool); | |
245 Plane_float_ face_plane; | |
246 PolygonType polygonType; | |
247 char field_15; | |
248 char field_16; | |
249 char field_17; | |
250 }; | |
251 #pragma pack(pop) | |
252 | |
253 | |
254 | |
255 | |
256 | |
257 /* 392 */ | |
258 #pragma pack(push, 1) | |
259 struct stru352 | |
260 { | |
261 int field_0; | |
262 int field_4; | |
263 int field_8; | |
264 int field_C; | |
265 int field_10; | |
266 int field_14; | |
267 int field_18; | |
268 int field_1C; | |
269 int field_20; | |
270 int field_24; | |
271 int field_28; | |
272 int field_2C; | |
273 int field_30; | |
274 int field_34; | |
275 }; | |
276 #pragma pack(pop) | |
277 //extern std::array<stru352, 480> stru_F83B80; | |
278 | |
279 #pragma pack(push, 1) | |
280 struct LocationTime_stru1 | |
281 { | |
282 unsigned __int64 uLastVisitDay; | |
283 char sky_texture_name[12]; | |
284 int day_attrib; | |
285 int day_fogrange_1; | |
286 int day_fogrange_2; | |
287 char field_2F4[24]; | |
288 }; | |
289 #pragma pack(pop) | |
290 | |
291 /* 319 */ | |
292 enum LEVEL_TYPE | |
293 { | |
294 LEVEL_null = 0, | |
295 LEVEL_Indoor = 0x1, | |
296 LEVEL_Outdoor = 0x2, | |
297 }; | |
298 extern LEVEL_TYPE uCurrentlyLoadedLevelType; | |
299 | |
300 | |
301 | |
302 | |
303 | |
304 | |
305 | |
306 | |
307 | |
308 | |
309 | |
310 | |
311 | |
312 /* 86 */ | |
313 #pragma pack(push, 1) | |
314 struct SpawnPointMM6 | |
315 { | |
316 Vec3_int_ vPosition; | |
317 unsigned __int16 uRadius; | |
318 unsigned __int16 uKind; | |
319 unsigned __int16 uIndex; | |
320 unsigned __int16 uAttributes; | |
321 }; | |
322 #pragma pack(pop) | |
323 | |
324 | |
325 | |
326 /* 102 */ | |
327 #pragma pack(push, 1) | |
328 struct SpawnPointMM7 | |
329 { | |
330 //----- (00448DD6) -------------------------------------------------------- | |
331 SpawnPointMM7() | |
332 { | |
333 uRadius = 32; | |
334 uAttributes = 0; | |
335 uIndex = 0; | |
336 uKind = 0; | |
337 uGroup = 0; | |
338 } | |
339 | |
340 | |
341 Vec3_int_ vPosition; | |
342 unsigned __int16 uRadius; | |
343 unsigned __int16 uKind; | |
344 unsigned __int16 uIndex; | |
345 unsigned __int16 uAttributes; | |
346 unsigned int uGroup; | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2562
diff
changeset
|
347 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2562
diff
changeset
|
348 inline bool IsMonsterSpawn() const { return uKind == 3; } |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2562
diff
changeset
|
349 inline bool IsTreasureSpawn() const { return uKind != 3; } |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2562
diff
changeset
|
350 |
2496 | 351 }; |
352 #pragma pack(pop) | |
353 | |
354 | |
355 | |
356 | |
357 | |
358 | |
359 /* 90 */ | |
360 #pragma pack(push, 1) | |
361 struct BLVHeader | |
362 { | |
363 char field_0[104]; | |
364 unsigned int uFaces_fdata_Size; | |
365 unsigned int uSector_rdata_Size; | |
366 unsigned int uSector_lrdata_Size; | |
367 unsigned int uDoors_ddata_Size; | |
368 char field_78[16]; | |
369 }; | |
370 #pragma pack(pop) | |
371 | |
372 | |
373 | |
374 /* 96 */ | |
375 #pragma pack(push, 1) | |
376 struct BLVSectorMM8 | |
377 { | |
378 int dword_000074; | |
379 }; | |
380 #pragma pack(pop) | |
381 | |
382 /* 97 */ | |
383 #pragma pack(push, 1) | |
384 struct BLVLightMM6 | |
385 { | |
386 Vec3_short_ vPosition; | |
387 __int16 uRadius; | |
388 __int16 uAttributes; | |
389 unsigned __int16 uBrightness; | |
390 }; | |
391 #pragma pack(pop) | |
392 | |
393 /* 98 */ | |
394 #pragma pack(push, 1) | |
395 struct BLVLightMM7 //10h | |
396 { | |
397 struct Vec3_short_ vPosition; | |
398 __int16 uRadius; | |
399 char uRed; | |
400 char uGreen; | |
401 char uBlue; | |
402 char uType; | |
403 __int16 uAtributes; // & 0x08 doesn't light faces | |
404 __int16 uBrightness; | |
405 }; | |
406 #pragma pack(pop) | |
407 | |
408 /* 99 */ | |
409 #pragma pack(push, 1) | |
410 struct BLVLightMM8 | |
411 { | |
412 int uID; | |
413 }; | |
414 #pragma pack(pop) | |
415 | |
416 | |
417 | |
418 /* 100 */ | |
419 #pragma pack(push, 1) | |
420 struct BLVDoor //50h | |
421 { | |
422 enum State: unsigned __int16 | |
423 { | |
424 Closed = 0, | |
425 Opening = 1, | |
426 Open = 2, | |
427 Closing = 3 | |
428 }; | |
429 | |
430 unsigned int uAttributes; | |
431 unsigned int uDoorID; | |
432 unsigned int uTimeSinceTriggered; | |
433 Vec3_int_ vDirection; | |
434 int uMoveLength; | |
435 int uOpenSpeed; | |
436 int uCloseSpeed; | |
437 unsigned __int16 *pVertexIDs; | |
438 unsigned __int16 *pFaceIDs; | |
439 unsigned __int16 *pSectorIDs; | |
440 __int16 *pDeltaUs; | |
441 __int16 *pDeltaVs; | |
442 unsigned __int16 *pXOffsets; | |
443 unsigned __int16 *pYOffsets; | |
444 unsigned __int16 *pZOffsets; | |
445 unsigned __int16 uNumVertices; | |
446 unsigned __int16 uNumFaces; | |
447 __int16 field_48; | |
448 unsigned __int16 uNumOffsets; | |
449 State uState; | |
450 __int16 field_4E; | |
451 }; | |
452 #pragma pack(pop) | |
453 | |
454 /* 101 */ | |
455 #pragma pack(push, 1) | |
456 struct BLVMapOutline //0C | |
457 { | |
458 unsigned __int16 uVertex1ID; | |
459 unsigned __int16 uVertex2ID; | |
460 unsigned __int16 uFace1ID; | |
461 unsigned __int16 uFace2ID; | |
462 __int16 sZ; | |
463 unsigned __int16 uFlags; | |
464 }; | |
465 #pragma pack(pop) | |
466 | |
467 | |
468 #define FACE_PORTAL 0x00000001 // portal/two-sided | |
469 #define FACE_CAN_SATURATE_COLOR 0x00000002 | |
470 #define FACE_FLOW_DIAGONAL 0x00000004 // Diagonal flow of the lava or water | |
471 #define FACE_UNKNOW5 0x00000006 | |
472 #define FACE_UNKNOW6 0x00000008 | |
473 #define FACE_FLUID 0x00000010 // wavy animated water or lava | |
474 #define FACE_FLOW_VERTICAL 0x00000020 // Vertical flow of the lava or water | |
475 #define FACE_DONT_CACHE_TEXTURE 0x00000040 // do not load face texture if it isn't loaded already | |
2508 | 476 #define FACE_UNKNOW7 0x00000080 |
2496 | 477 #define FACE_XY_PLANE 0x00000100 |
478 #define FACE_XZ_PLANE 0x00000200 | |
479 #define FACE_YZ_PLANE 0x00000400 | |
480 #define FACE_FLOW_HORIZONTAL 0x00000800 // Horizontal flow of the lava or water | |
481 #define FACE_HAS_EVENT_HINT 0x00001000 | |
482 #define FACE_INVISIBLE 0x00002000 | |
2575 | 483 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID |
2496 | 484 #define FACE_OUTLINED 0x00010000 // outline face edges |
485 #define FACE_INDOOR_DOOR 0x00020000 | |
486 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. | |
487 #define FACE_HAS_EVENT 0x00100000 | |
488 #define FACE_INDOOR_CARPET 0x00200000 | |
489 #define FACE_INDOOR_SKY 0x00400000 | |
490 #define FACE_UNKNOW3 0x00800000 | |
491 #define FACE_UNKNOW4 0x01000000 | |
492 #define FACE_CLICKABLE 0x02000000 // Event can be triggered by clicking on the facet. | |
493 #define FACE_PRESSURE_PLATE 0x04000000 // Event can be triggered by stepping on the facet. | |
494 #define FACE_INDICATE 0x06000000 // Event can be triggered by indicating on the facet. | |
495 #define FACE_UNKNOW1 0x08000000 | |
496 #define FACE_UNKNOW2 0x10000000 | |
497 #define FACE_ETHEREAL 0x20000000 // Untouchable. You can pass through it. | |
498 #define FACE_INDOOR_LAVA 0x40000000 | |
499 #define FACE_PICKED 0x80000000 | |
500 | |
501 /* 93 */ | |
502 #pragma pack(push, 1) | |
503 struct BLVFace //60h | |
504 { | |
505 //----- (0046ED02) -------------------------------------------------------- | |
506 inline BLVFace() | |
507 { | |
508 this->uNumVertices = 0; | |
509 this->uAttributes = 0; | |
510 this->uFaceExtraID = 0; | |
511 this->pVertexIDs = nullptr; | |
512 this->pZInterceptDisplacements = nullptr; | |
513 this->pYInterceptDisplacements = nullptr; | |
514 this->pXInterceptDisplacements = nullptr; | |
515 } | |
516 | |
517 void _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); | |
2574 | 518 struct Texture_MM7 *GetTexture(); |
2496 | 519 void FromODM(struct ODMFace *face); |
520 | |
521 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} | |
522 inline bool Visible() const {return !Invisible();} | |
523 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;} | |
524 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;} | |
525 inline bool Indoor_sky() const {return (uAttributes & FACE_INDOOR_SKY) != 0;} | |
526 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;} | |
527 inline bool Pressure_Plate() const {return (uAttributes & FACE_PRESSURE_PLATE) != 0;} | |
528 inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;} | |
529 | |
530 struct Plane_float_ pFacePlane; | |
531 struct Plane_int_ pFacePlane_old; | |
532 int zCalc1; | |
533 int zCalc2; | |
534 int zCalc3; | |
535 unsigned int uAttributes; | |
536 unsigned __int16 *pVertexIDs; | |
537 signed __int16 *pXInterceptDisplacements; | |
538 signed __int16 *pYInterceptDisplacements; | |
539 signed __int16 *pZInterceptDisplacements; | |
540 signed __int16 *pVertexUIDs; | |
541 signed __int16 *pVertexVIDs; | |
542 unsigned __int16 uFaceExtraID; | |
543 unsigned __int16 uBitmapID; | |
544 unsigned __int16 uSectorID; | |
545 __int16 uBackSectorID; | |
546 struct BBox_short_ pBounding; | |
547 PolygonType uPolygonType; | |
548 unsigned __int8 uNumVertices; | |
549 char field_5E; | |
550 char field_5F; | |
551 }; | |
552 #pragma pack(pop) | |
553 | |
554 /* 94 */ | |
555 #pragma pack(push, 1) | |
556 struct BLVFaceExtra //24h | |
557 { | |
558 bool HasEventint(); | |
559 | |
560 __int16 field_0; | |
561 __int16 field_2; | |
562 __int16 field_4; | |
563 __int16 field_6; | |
564 __int16 field_8; | |
565 __int16 field_A; | |
566 __int16 field_C; | |
567 unsigned __int16 uAdditionalBitmapID; | |
568 __int16 field_10; | |
569 __int16 field_12; | |
570 __int16 sTextureDeltaU; | |
571 __int16 sTextureDeltaV; | |
572 __int16 sCogNumber; | |
573 unsigned __int16 uEventID; | |
574 __int16 field_1C; | |
575 __int16 field_1E; | |
576 __int16 field_20; | |
577 __int16 field_22; | |
578 }; | |
579 #pragma pack(pop) | |
580 | |
581 /* 95 */ | |
582 #pragma pack(push, 1) | |
583 struct BLVSector //0x74 | |
584 { | |
585 int field_0; | |
586 unsigned __int16 uNumFloors; | |
587 __int16 field_6; | |
588 unsigned __int16 *pFloors; | |
589 unsigned __int16 uNumWalls; | |
590 __int16 field_E; | |
591 unsigned __int16 *pWalls; | |
592 unsigned __int16 uNumCeilings; | |
593 __int16 field_16; | |
594 unsigned __int16 *pCeilings; | |
595 unsigned __int16 uNumFluids; | |
596 __int16 field_1E; | |
597 unsigned __int16 *pFluids; | |
598 __int16 uNumPortals; | |
599 __int16 field_26; | |
600 unsigned __int16 *pPortals; | |
601 unsigned __int16 uNumFaces; | |
602 unsigned __int16 uNumNonBSPFaces; | |
603 unsigned __int16 *pFaceIDs; | |
604 unsigned __int16 uNumCylinderFaces; | |
605 __int16 field_36; | |
606 int pCylinderFaces; | |
607 unsigned __int16 uNumCogs; | |
608 __int16 field_3E; | |
609 unsigned __int16 *pCogs; | |
610 unsigned __int16 uNumDecorations; | |
611 __int16 field_46; | |
612 unsigned __int16 *pDecorationIDs; | |
613 unsigned __int16 uNumMarkers; | |
614 __int16 field_4E; | |
615 unsigned __int16 *pMarkers; | |
616 unsigned __int16 uNumLights; | |
617 __int16 field_56; | |
618 unsigned __int16 *pLights; | |
619 __int16 uWaterLevel; | |
620 __int16 uMistLevel; | |
621 __int16 uLightDistanceMultiplier; | |
622 __int16 uMinAmbientLightLevel; | |
623 __int16 uFirstBSPNode; | |
624 __int16 exit_tag; | |
625 BBox_short_ pBounding; | |
626 }; | |
627 #pragma pack(pop) | |
628 | |
629 | |
630 #pragma pack(push, 1) | |
631 struct BLVMapOutlines | |
632 { | |
633 int uNumOutlines; | |
634 BLVMapOutline pOutlines[7000]; | |
635 }; | |
636 #pragma pack(pop) | |
637 | |
638 | |
639 | |
640 | |
641 | |
642 | |
643 | |
644 /* 89 */ | |
645 #pragma pack(push, 1) | |
646 struct IndoorLocation | |
647 { | |
648 //----- (00462592) -------------------------------------------------------- | |
649 inline IndoorLocation() | |
650 { | |
651 bLoaded = 0; | |
652 ptr_0002B8_sector_lrdata = 0; | |
653 ptr_0002B4_doors_ddata = 0; | |
654 ptr_0002B0_sector_rdata = 0; | |
655 pLFaces = 0; | |
656 pVertices = 0; | |
657 pFaces = 0; | |
658 pFaceExtras = 0; | |
659 pSectors = 0; | |
660 pLights = 0; | |
661 pDoors = 0; | |
662 pNodes = 0; | |
663 pMapOutlines = 0; | |
664 uNumSpawnPoints = 0; | |
665 pSpawnPoints = 0; | |
666 uNumSectors = 0; | |
667 } | |
668 | |
669 int GetSector(int sX, int sY, int sZ); | |
670 void Release(); | |
671 bool Alloc(); | |
672 bool Load(char *pFilename, int a3, size_t i, char *pDest); | |
673 void Draw(); | |
674 void ToggleLight(signed int uLightID, unsigned int bToggle); | |
675 | |
676 static unsigned int GetLocationIndex(const char *Str1); | |
677 static void ExecDraw(bool bD3D); | |
678 //static void ExecDraw_sw(unsigned int uFaceID); | |
679 static void ExecDraw_d3d(unsigned int uFaceID, struct IndoorCameraD3D_Vec4 *pVertices, unsigned int uNumVertices, struct RenderVertexSoft *pPortalBounding); | |
680 | |
681 char pFilename[32]; | |
682 char field_20[48]; | |
683 unsigned int bLoaded; | |
684 char field_54[404]; | |
685 struct BLVHeader blv; | |
686 unsigned int uNumVertices; | |
687 struct Vec3_short_ *pVertices; | |
688 unsigned int uNumFaces; | |
689 struct BLVFace *pFaces; | |
690 unsigned int uNumFaceExtras; | |
691 struct BLVFaceExtra *pFaceExtras; | |
692 int uNumSectors; | |
693 struct BLVSector *pSectors; | |
694 int uNumLights; | |
695 struct BLVLightMM7 *pLights; | |
696 int uNumDoors; | |
697 struct BLVDoor *pDoors; | |
698 unsigned int uNumNodes; | |
699 struct BSPNode *pNodes; | |
700 BLVMapOutlines *pMapOutlines; | |
701 unsigned __int16 *pLFaces; | |
702 unsigned __int16 *ptr_0002B0_sector_rdata; | |
703 unsigned __int16 *ptr_0002B4_doors_ddata; | |
704 unsigned __int16 *ptr_0002B8_sector_lrdata; | |
705 unsigned int uNumSpawnPoints; | |
706 struct SpawnPointMM7 *pSpawnPoints; | |
707 struct DDM_DLV_Header dlv; | |
708 LocationTime_stru1 stru1; | |
709 char _visible_outlines[875]; | |
710 char padding; | |
711 }; | |
712 #pragma pack(pop) | |
713 | |
714 extern IndoorLocation *pIndoor; | |
715 | |
716 | |
717 | |
718 | |
719 | |
720 | |
721 | |
722 | |
723 | |
724 | |
725 | |
726 | |
727 | |
728 /* 162 */ | |
729 #pragma pack(push, 1) | |
730 struct BLVRenderParams | |
731 { | |
732 inline BLVRenderParams() | |
733 { | |
734 uViewportX = 0; | |
735 uViewportY = 0; | |
736 uViewportZ = 0; | |
737 uViewportW = 0; | |
738 } | |
739 | |
740 void Reset(); | |
741 | |
742 int field_0_timer_; | |
743 int _unused_uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines | |
744 Vec3_int_ _unused_vPartyPos; | |
745 int _unused_sPartyRotY; | |
746 int _unused_sPartyRotX; | |
747 int uPartySectorID; | |
748 int _unused_sCosineY; // matches ODMRenderParams::int sines and cosines | |
749 int _unused_sSineY; // computed in 0048600E | |
750 int _unused_sCosineNegX; // merged into IndoorCameraD3D | |
751 int _unused_sSineNegX; // --//-- | |
752 float _unused_fCosineY; // matches old IndoorCamera::fRotationCosineY (new IndoorCameraD3D::fRotationCosineY) | |
753 float _unused_fSineY; // matches old IndoorCamera::fRotationSineY (new IndoorCameraD3D::fRotationSineY) | |
754 float _unused_fCosineNegX; // the same | |
755 float _unused_fSineNegX; // the same | |
756 int fov_rad_fixpoint; | |
757 int fov_rad_inv_fixpoint;//float | |
758 void *pRenderTarget; | |
759 unsigned int uTargetWidth; | |
760 unsigned int uTargetHeight; | |
761 unsigned int uViewportX; | |
762 unsigned int uViewportY; | |
763 unsigned int uViewportZ; | |
764 unsigned int uViewportW; | |
765 int field_64; | |
766 int *pTargetZBuffer; | |
767 int uViewportHeight; | |
768 int uViewportWidth; | |
769 int uViewportCenterX; | |
770 int uViewportCenterY; | |
771 struct BspRenderer_PortalViewportData *field_7C; | |
772 unsigned int uNumFacesRenderedThisFrame; | |
773 int field_84; | |
774 int field_88; | |
775 int field_8C; | |
776 int field_90; | |
777 int field_94; | |
778 }; | |
779 #pragma pack(pop) | |
780 extern BLVRenderParams *pBLVRenderParams; | |
781 | |
782 | |
783 | |
784 | |
785 | |
786 int __fastcall GetPortalScreenCoord(unsigned int uFaceID); | |
787 bool PortalFrustrum(int pNumVertices, struct BspRenderer_PortalViewportData *a2, struct BspRenderer_PortalViewportData *near_portal, int uFaceID); | |
788 void PrepareBspRenderList_BLV(); | |
789 void PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID); | |
790 void PrepareActorRenderList_BLV(); | |
791 void PrepareItemsRenderList_BLV(); | |
792 void AddBspNodeToRenderList(unsigned int node_id); | |
793 void __fastcall sub_4406BC(unsigned int node_id, unsigned int uFirstNode); // idb | |
794 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2); | |
795 int __fastcall sub_4AAEA6_transform(struct RenderVertexSoft *a1); | |
796 unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb | |
797 void BLV_UpdateUserInputAndOther(); | |
798 int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID); | |
799 void BLV_UpdateDoors(); | |
800 void UpdateActors_BLV(); | |
801 void BLV_ProcessPartyActions(); | |
802 void Door_switch_animation(unsigned int uDoorID, int a2); // idb: sub_449A49 | |
803 int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6); | |
804 void __fastcall PrepareDrawLists_BLV(); | |
805 void PrepareToLoadBLV(unsigned int bLoading); | |
806 int GetAlertStatus(); | |
807 int __fastcall _45063B_spawn_some_monster(struct MapInfo *a1, int a2); | |
808 int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6); | |
809 | |
810 bool __fastcall sub_4075DB(int a1, int a2, int a3, struct BLVFace *face); | |
811 bool __fastcall sub_4077F1(int a1, int a2, int a3, struct ODMFace *face, struct BSPVertexBuffer *a5); | |
812 | |
813 #pragma once | |
814 | |
815 | |
816 | |
817 | |
818 | |
819 /* 165 */ | |
820 #pragma pack(push, 1) | |
821 struct BspRenderer_PortalViewportData | |
822 { | |
823 void GetViewportData(__int16 x, int y, __int16 z, int w); | |
824 | |
825 int _viewport_space_y; | |
826 int _viewport_space_w; | |
827 int _viewport_space_x; | |
828 int _viewport_space_z; | |
829 int _viewport_x_minID; | |
830 int _viewport_z_maxID; | |
831 __int16 viewport_left_side[480]; | |
832 __int16 viewport_right_side[480]; | |
833 }; | |
834 #pragma pack(pop) | |
835 extern BspRenderer_PortalViewportData stru_F8A590; | |
836 | |
837 | |
838 | |
839 | |
840 /* 164 */ | |
841 #pragma pack(push, 1) | |
842 struct BspRenderer_stru0 | |
843 { | |
844 //----- (0043F2BF) -------------------------------------------------------- | |
845 inline BspRenderer_stru0() | |
846 { | |
847 //_eh_vector_constructor_iterator_(std__vector_0007AC, 24, 4, | |
848 // (void ( *)(void *))IndoorCameraD3D_Vec4::IndoorCameraD3D_Vec4, | |
849 // (void ( *)(void *))IndoorCameraD3D_Vec4::dtor); | |
850 //for (int i = 0; i < 4; ++i) | |
851 // pVertices[i].flt_2C = 0.0f; | |
852 } | |
853 | |
854 //----- (0043F2A9) -------------------------------------------------------- | |
855 ~BspRenderer_stru0() | |
856 { | |
857 //_eh_vector_destructor_iterator_(this->std__vector_0007AC, 24, 4, IndoorCameraD3D_Vec4::dtor); | |
858 } | |
859 | |
860 unsigned __int16 uSectorID; | |
861 unsigned __int16 uViewportX; | |
862 unsigned __int16 uViewportY; | |
863 unsigned __int16 uViewportZ; | |
864 unsigned __int16 uViewportW; | |
865 __int16 field_A; | |
866 BspRenderer_PortalViewportData PortalScreenData; | |
867 unsigned __int16 uFaceID; | |
868 __int16 field_7A6; | |
869 unsigned int viewing_portal_id; // portal through which we're seeing this node | |
870 IndoorCameraD3D_Vec4 std__vector_0007AC[4]; | |
871 RenderVertexSoft pPortalBounding[4]; | |
872 }; | |
873 #pragma pack(pop) | |
874 | |
875 | |
876 | |
877 | |
878 #pragma pack(push, 1) | |
879 struct BspFace | |
880 { | |
881 unsigned __int16 uFaceID; | |
882 unsigned __int16 uNodeID; | |
883 }; | |
884 #pragma pack(pop) | |
885 | |
886 | |
887 /* 163 */ | |
888 #pragma pack(push, 1) | |
889 struct BspRenderer // stru170 | |
890 { | |
891 //----- (0043F282) -------------------------------------------------------- | |
892 inline BspRenderer() | |
893 { | |
894 // _eh_vector_constructor_iterator_(field_FA8, 2252, 150, | |
895 // (void ( *)(void *))stru170_stru0::stru170_stru0, | |
896 // (void ( *)(void *))stru170_stru0::dtor); | |
897 num_faces = 0; | |
898 num_nodes = 0; | |
899 uNumVisibleNotEmptySectors = 0; | |
900 } | |
901 | |
902 //void AddFaceToRenderList_sw(unsigned int node_id, unsigned int uFaceID); | |
903 void AddFaceToRenderList_d3d(unsigned int node_id, unsigned int uFaceID); | |
904 void MakeVisibleSectorList(); | |
905 //void DrawFaceOutlines(); | |
906 | |
907 unsigned int num_faces; | |
908 //__int16 pFaceIDs[2000]; | |
909 BspFace faces[1000]; | |
910 //char field_130[3700]; | |
911 unsigned int num_nodes; | |
912 BspRenderer_stru0 nodes[150]; | |
913 unsigned int uNumVisibleNotEmptySectors; | |
914 unsigned __int16 pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[6]; | |
915 }; | |
916 #pragma pack(pop) | |
917 | |
918 | |
919 extern struct BspRenderer *pBspRenderer; // idb | |
920 | |
921 void FindBillboardsLightLevels_BLV(); | |
922 | |
923 int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb | |
924 | |
925 bool __fastcall sub_407A1C(int x, int z, int y, struct Vec3_int_ v); // idb |