2496
|
1 #pragma
|
|
2
|
|
3 #include "Indoor.h"
|
2499
|
4 #include "../Tables/TileFrameTable.h"
|
|
5 #include "BSPModel.h"
|
2496
|
6
|
|
7 #define DAY_ATTRIB_FOG 1
|
|
8
|
|
9 /* 256 */
|
|
10 #pragma pack(push, 1)
|
|
11 struct ODMHeader
|
|
12 {
|
|
13 int uVersion;
|
|
14 char pMagic[4];
|
|
15 unsigned int uCompressedSize;
|
|
16 unsigned int uDecompressedSize;
|
|
17 };
|
|
18 #pragma pack(pop)
|
|
19
|
|
20
|
|
21
|
|
22 /* 78 */
|
|
23 #pragma pack(push, 1)
|
|
24 struct OutdoorLocationTileType
|
|
25 {
|
|
26 Tileset tileset;
|
|
27 unsigned __int16 uTileID;
|
|
28 };
|
|
29 #pragma pack(pop)
|
|
30
|
|
31 #pragma pack(push, 1)
|
|
32 struct DMap
|
|
33 {
|
|
34 unsigned __int8 field0;
|
|
35 unsigned __int8 field1;
|
|
36 };
|
|
37 #pragma pack(pop)
|
|
38
|
|
39 /* 79 */
|
|
40 #pragma pack(push, 1)
|
|
41 struct OutdoorLocationTerrain
|
|
42 {
|
|
43 //----- (0047C794) --------------------------------------------------------
|
|
44 inline OutdoorLocationTerrain()
|
|
45 {
|
|
46 pHeightmap = nullptr;
|
|
47 pTilemap = nullptr;
|
|
48 pAttributemap = nullptr;
|
|
49 pDmap = nullptr;;
|
|
50 this->field_10 = 0;
|
|
51 this->field_12 = 0;
|
|
52
|
|
53
|
|
54 }
|
|
55
|
|
56 void _47C7A9();
|
|
57 void Release();
|
|
58 void FillDMap(int X, int Y, int W, int Z);
|
|
59 int _47CB57(int a1, int a2, int a3);
|
|
60 bool ZeroLandscape();
|
|
61 bool Initialize();
|
|
62
|
|
63
|
|
64 unsigned __int8 *pHeightmap;
|
|
65 unsigned __int8 *pTilemap;
|
|
66 unsigned __int8 *pAttributemap;
|
|
67 struct DMap *pDmap;
|
|
68 __int16 field_10;
|
|
69 __int16 field_12;
|
|
70 __int16 field_14;
|
|
71 __int16 field_16;
|
|
72 int field_18;
|
|
73 int field_1C;
|
|
74 };
|
|
75 #pragma pack(pop)
|
|
76
|
|
77
|
|
78 /* 81 */
|
|
79 #pragma pack(push, 1)
|
|
80 struct ODMFace
|
|
81 {
|
|
82 bool HasEventHint();
|
|
83
|
|
84
|
|
85 static bool IsBackfaceNotCulled(struct RenderVertexSoft *a2, struct Polygon *polygon);
|
|
86
|
|
87 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;}
|
|
88 inline bool Visible() const {return !Invisible();}
|
|
89 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;}
|
|
90 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;}
|
|
91 inline bool Indoor_sky() const {return (uAttributes & FACE_INDOOR_SKY) != 0;}
|
|
92 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;}
|
|
93 inline bool Pressure_Plate() const {return (uAttributes & FACE_PRESSURE_PLATE) != 0;}
|
|
94 inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;}
|
|
95
|
|
96 struct Plane_int_ pFacePlane;
|
|
97 int zCalc1;
|
|
98 int zCalc2;
|
|
99 int zCalc3;
|
|
100 unsigned int uAttributes;
|
|
101 unsigned __int16 pVertexIDs[20];
|
|
102 unsigned __int16 pTextureUIDs[20];
|
|
103 unsigned __int16 pTextureVIDs[20];
|
|
104 signed __int16 pXInterceptDisplacements[20];
|
|
105 signed __int16 pYInterceptDisplacements[20];
|
|
106 signed __int16 pZInterceptDisplacements[20];
|
|
107 __int16 uTextureID;
|
|
108 __int16 sTextureDeltaU;
|
|
109 __int16 sTextureDeltaV;
|
|
110 struct BBox_short_ pBoundingBox;
|
|
111 __int16 sCogNumber;
|
|
112 __int16 sCogTriggeredID;
|
|
113 __int16 sCogTriggerType;
|
|
114 char field_128;
|
|
115 char field_129;
|
|
116 unsigned __int8 uGradientVertex1;
|
|
117 unsigned __int8 uGradientVertex2;
|
|
118 unsigned __int8 uGradientVertex3;
|
|
119 unsigned __int8 uGradientVertex4;
|
|
120 unsigned __int8 uNumVertices;
|
|
121 unsigned __int8 uPolygonType;
|
|
122 unsigned __int8 uShadeType;
|
|
123 unsigned __int8 bVisible;
|
|
124 char field_132;
|
|
125 char field_133;
|
|
126 };
|
|
127 #pragma pack(pop)
|
|
128
|
|
129
|
|
130 #pragma pack(push, 1)
|
|
131 struct OutdoorLocation
|
|
132 {
|
|
133 OutdoorLocation();
|
|
134 void subconstuctor();
|
2534
|
135 //int New_SKY_NIGHT_ID;
|
2496
|
136 void ExecDraw(unsigned int bRedraw);
|
|
137 void PrepareActorsDrawList();
|
|
138 void CreateDebugLocation();
|
|
139 void Release();
|
|
140 bool Load(const char *pFilename, ODMFace *File, size_t a4, int *thisa);
|
|
141 int GetTileIdByTileMapId(signed int a2);
|
|
142 unsigned int DoGetTileTexture(signed int uX, signed int uZ);
|
|
143 int _47ED83(signed int a2, signed int a3);
|
|
144 int ActuallyGetSomeOtherTileInfo(signed int uX, signed int uY);
|
|
145 int DoGetHeightOnTerrain(signed int sX, signed int sZ);
|
|
146 int GetSoundIdByPosition(signed int X_pos, signed int Y_pos, int a4);
|
|
147 int UpdateDiscoveredArea(int a2, int a3, int a4);
|
|
148 bool IsMapCellFullyRevealed(signed int a2, signed int a3);
|
|
149 bool IsMapCellPartiallyRevealed(signed int a2, signed int a3);
|
|
150 bool _47F0E2();
|
|
151 bool PrepareDecorations();
|
|
152 void ArrangeSpriteObjects();
|
|
153 bool InitalizeActors(int a1);
|
|
154 bool LoadRoadTileset();
|
|
155 bool LoadTileGroupIds();
|
|
156 double GetFogDensityByTime();
|
|
157 int GetSomeOtherTileInfo(int sX, int sY);
|
|
158 unsigned int GetTileTexture(int sX, int sZ);
|
|
159 int GetHeightOnTerrain(int sX, int sZ);
|
|
160 bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int *thisa);
|
|
161 //bool Release2();
|
|
162 bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5);
|
|
163 void MessWithLUN();
|
|
164 void UpdateSunlightVectors();
|
|
165 void UpdateFog();
|
|
166 int GetNumFoodRequiredToRestInCurrentPos(int x, signed int y, int z);
|
|
167 void SetFog();
|
|
168 void Draw();
|
|
169
|
|
170 static void LoadActualSkyFrame();
|
|
171
|
|
172
|
|
173 char pLevelFilename[32];
|
|
174 char pLocationFileName[32];
|
|
175 char pLocationFileDescription[32];
|
|
176 char pSkyTextureName[32];
|
|
177 char pGroundTileset[32];
|
|
178 OutdoorLocationTileType pTileTypes[4]; // [3] road tileset
|
|
179 int uNumBModels;
|
|
180 struct OutdoorLocationTerrain pTerrain;
|
|
181 void *pCmap;
|
|
182 BSPModel *pBModels;
|
|
183 unsigned int numFaceIDListElems;
|
|
184 unsigned __int16 *pFaceIDLIST;
|
|
185 unsigned int *pOMAP;
|
|
186 signed int sSky_TextureID;
|
|
187 signed int sMainTile_BitmapID;
|
|
188 __int16 field_F0;
|
|
189 __int16 field_F2;
|
|
190 int field_F4;
|
|
191 char field_F8[968];
|
|
192 unsigned int uNumSpawnPoints;
|
|
193 struct SpawnPointMM7 *pSpawnPoints;
|
|
194 struct DDM_DLV_Header ddm;
|
|
195 LocationTime_stru1 loc_time;
|
|
196 //unsigned __int64 uLastVisitDay;
|
|
197 //char sky_texture_name[12];
|
|
198 //int day_attrib;
|
|
199 //int day_fogrange_1;
|
|
200 //int day_fogrange_2;
|
|
201 // char field_510[24];
|
|
202 unsigned char uFullyRevealedCellOnMap[88][11];//968 the inner array is 11 bytes long, because every bit is used for a separate cell, so in the end it's 11 * 8 bits = 88 values
|
|
203 unsigned char uPartiallyRevealedCellOnMap[88][11];//[968]
|
|
204 int field_CB8;
|
|
205 int max_terrain_dimming_level;
|
|
206 int field_CC0;
|
|
207 unsigned int pSpriteIDs_LUN[8];
|
|
208 unsigned int uSpriteID_LUNFULL;
|
|
209 int field_CE8;
|
|
210 unsigned int uSpriteID_LUN3_4_cp;
|
|
211 int field_CF0;
|
|
212 unsigned int uSpriteID_LUN1_2_cp;
|
|
213 int field_CF8;
|
|
214 unsigned int uSpriteID_LUN1_4_cp;
|
|
215 int field_D00;
|
|
216 unsigned __int16 uSpriteID_LUN_SUN;
|
|
217 __int16 field_D06;
|
|
218 int field_D08;
|
|
219 int field_D0C;
|
|
220 int field_D10;
|
|
221 int field_D14;
|
|
222 int inv_sunlight_x;
|
|
223 int inv_sunlight_y;
|
|
224 int inv_sunlight_z;
|
|
225 int field_D24;
|
|
226 int field_D28;
|
|
227 int field_D2C;
|
|
228 Vec3_int_ vSunlight;
|
|
229 int field_D3C;
|
|
230 int field_D40;
|
|
231 int field_D44;
|
|
232 int field_D48;
|
|
233 int field_D4C;
|
|
234 float field_D50;
|
|
235 int field_D54;
|
|
236 int field_D58;
|
|
237 int field_D5C;
|
|
238 int field_D60;
|
|
239 int field_D64;
|
|
240 char field_D68[111900];
|
|
241 float fFogDensity;
|
|
242 int uLastSunlightUpdateMinute;
|
|
243 };
|
|
244 #pragma pack(pop)
|
|
245
|
|
246
|
|
247 extern struct OutdoorLocation *pOutdoor;
|
|
248
|
|
249 void ODM_UpdateUserInputAndOther();
|
|
250 int ODM_GetFloorLevel(int X, signed int Y, int Z, int, int *pOnWater, int *bmodel_pid, int bWaterWalk);
|
|
251 int GetCeilingHeight(int Party_X, signed int Party_Y, int Party_ZHeight, int pFaceID);
|
|
252 void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out);
|
|
253 void UpdateActors_ODM();
|
|
254 void ODM_ProcessPartyActions();
|
|
255 char Is_out15odm_underwater();
|
|
256 void SetUnderwaterFog();
|
|
257 void ODM_Project(unsigned int uNumVertices);
|
|
258 void sub_487DA9();
|
|
259 void ODM_LoadAndInitialize(const char *pLevelFilename, struct ODMRenderParams *thisa);
|
|
260 unsigned int GetLevelFogColor();
|
|
261 int __fastcall sub_47C3D7_get_fog_specular(int a1, int a2, float a3);
|
|
262 unsigned int WorldPosToGridCellX(int); // weak
|
|
263 unsigned int WorldPosToGridCellZ(int); // weak
|
|
264 int GridCellToWorldPosX(int); // weak
|
|
265 int GridCellToWorldPosZ(int); // weak
|
|
266 void sub_481ED9_MessWithODMRenderParams();
|
|
267 bool IsTerrainSlopeTooHigh(int pos_x, int pos_y);
|
|
268 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4);
|
|
269
|
|
270
|
|
271
|
|
272
|
|
273
|
|
274
|
|
275
|
|
276
|
|
277
|