Mercurial > mm7
annotate Outdoor.h @ 767:45615cacad31
Fog fixed
author | Nomad |
---|---|
date | Sat, 23 Mar 2013 21:11:15 +0200 |
parents | a84db04439a4 |
children | 67b77b052ef3 |
rev | line source |
---|---|
0 | 1 #pragma |
2 #include "BSPModel.h" | |
3 #include "OutdoorCamera.h" | |
4 #include "Indoor.h" | |
630 | 5 #include "TileFrameTable.h" |
0 | 6 |
7 | |
767 | 8 |
9 #define DAY_ATTRIB_FOG 1 | |
10 | |
0 | 11 /* 256 */ |
12 #pragma pack(push, 1) | |
13 struct ODMHeader | |
14 { | |
15 int uVersion; | |
16 char pMagic[4]; | |
17 unsigned int uCompressedSize; | |
18 unsigned int uDecompressedSize; | |
19 }; | |
20 #pragma pack(pop) | |
21 | |
22 | |
23 | |
24 /* 78 */ | |
25 #pragma pack(push, 1) | |
26 struct OutdoorLocationTileType | |
27 { | |
630 | 28 Tileset tileset; |
0 | 29 unsigned __int16 uTileID; |
30 }; | |
31 #pragma pack(pop) | |
32 | |
760 | 33 #pragma pack(push, 1) |
34 struct DMap | |
35 { | |
36 unsigned __int8 field0; | |
37 unsigned __int8 field1; | |
38 }; | |
39 #pragma pack(pop) | |
0 | 40 |
41 /* 79 */ | |
42 #pragma pack(push, 1) | |
43 struct OutdoorLocationTerrain | |
44 { | |
45 //----- (0047C794) -------------------------------------------------------- | |
46 inline OutdoorLocationTerrain() | |
47 { | |
760 | 48 pHeightmap = NULL; |
49 pTilemap = NULL; | |
50 pAttributemap = NULL; | |
51 pDmap = NULL;; | |
0 | 52 this->field_10 = 0; |
53 this->field_12 = 0; | |
54 | |
760 | 55 |
0 | 56 } |
57 | |
58 void _47C7A9(); | |
59 void Release(); | |
760 | 60 void FillDMap(int X, int Y, int W, int Z); |
0 | 61 int _47CB57(int a1, int a2, int a3); |
62 bool ZeroLandscape(); | |
63 bool Initialize(); | |
64 | |
65 | |
66 unsigned __int8 *pHeightmap; | |
67 unsigned __int8 *pTilemap; | |
68 unsigned __int8 *pAttributemap; | |
760 | 69 struct DMap *pDmap; |
0 | 70 __int16 field_10; |
71 __int16 field_12; | |
72 __int16 field_14; | |
73 __int16 field_16; | |
74 int field_18; | |
75 int field_1C; | |
76 }; | |
77 #pragma pack(pop) | |
78 | |
79 | |
80 /* 81 */ | |
81 #pragma pack(push, 1) | |
82 struct ODMFace | |
83 { | |
84 bool HasEventHint(); | |
85 | |
86 | |
87 static bool IsBackfaceCulled(struct ODMFace *a1, struct RenderVertexSoft *a2, struct stru148 *a3); | |
88 | |
89 inline bool Invisible() const {return uAttributes & FACE_INVISIBLE;} | |
90 inline bool Visible() const {return !Invisible();} | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
91 inline bool TwoSided() const {return uAttributes & FACE_PORTAL;} |
0 | 92 |
93 struct Plane_int_ pFacePlane; | |
94 int zCalc1; | |
95 int zCalc2; | |
96 int zCalc3; | |
97 unsigned int uAttributes; | |
98 unsigned __int16 pVertexIDs[20]; | |
99 unsigned __int16 pTextureUIDs[20]; | |
100 unsigned __int16 pTextureVIDs[20]; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
101 signed __int16 pXInterceptDisplacements[20]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
102 signed __int16 pYInterceptDisplacements[20]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
103 signed __int16 pZInterceptDisplacements[20]; |
0 | 104 unsigned __int16 uTextureID; |
105 __int16 sTextureDeltaU; | |
106 __int16 sTextureDeltaV; | |
107 struct BBox_short_ pBoundingBox; | |
108 __int16 sCogNumber; | |
109 __int16 sCogTriggeredID; | |
110 __int16 sCogTriggerType; | |
111 char field_128; | |
112 char field_129; | |
113 unsigned __int8 uGradientVertex1; | |
114 unsigned __int8 uGradientVertex2; | |
115 unsigned __int8 uGradientVertex3; | |
116 unsigned __int8 uGradientVertex4; | |
117 unsigned __int8 uNumVertices; | |
118 unsigned __int8 uPolygonType; | |
119 unsigned __int8 uShadeType; | |
120 unsigned __int8 bVisible; | |
121 char field_132; | |
122 char field_133; | |
123 }; | |
124 #pragma pack(pop) | |
125 | |
126 | |
127 | |
128 #pragma pack(push, 1) | |
129 struct OutdoorLocation | |
130 { | |
131 //----- (004626BA) -------------------------------------------------------- | |
132 OutdoorLocation() | |
133 { | |
134 subconstuctor(); | |
135 uLastSunlightUpdateMinute = 0; | |
227 | 136 |
137 uNumBModels = 0; | |
138 pBModels = nullptr; | |
0 | 139 } |
140 //----- (004626CD) -------------------------------------------------------- | |
141 void subconstuctor() | |
142 { | |
143 //OutdoorLocationTerrain::OutdoorLocationTerrain(&this->pTerrain); | |
144 field_F0 = 0; | |
145 field_F4 = 0x40000000u; | |
146 //DLVHeader::DLVHeader(&v1->ddm); | |
147 pSpawnPoints = 0; | |
148 pBModels = 0; | |
760 | 149 pCmap = 0; |
0 | 150 pFaceIDLIST = 0; |
151 pOMAP = 0; | |
152 } | |
153 | |
154 void ExecDraw(unsigned int bRedraw); | |
142 | 155 void PrepareActorsDrawList(); |
0 | 156 void CreateDebugLocation(); |
157 void Release(); | |
119 | 158 bool Load(const char *pFilename, ODMFace *File, size_t a4, int thisa); |
0 | 159 int _47ECC1(signed int a2); |
160 unsigned int DoGetTileTexture(unsigned int uX, unsigned int uZ); | |
161 int _47ED83(signed int a2, signed int a3); | |
162 int ActuallyGetSomeOtherTileInfo(unsigned int uX, unsigned int uY); | |
163 int DoGetHeightOnTerrain(unsigned int uX, unsigned int uZ); | |
164 int _47EE49(signed int a2, signed int a3, int a4); | |
752 | 165 int UpdateDiscoveredArea(int a2, int a3, int a4); |
0 | 166 bool _47F04C(signed int a2, signed int a3); |
167 bool _47F097(signed int a2, signed int a3); | |
168 bool _47F0E2(); | |
169 bool PrepareDecorations(); | |
170 int _47F223_LooksLikeGenerateMonsterLoot(); | |
171 bool InitalizeActors(int a1); | |
630 | 172 bool LoadRoadTileset(); |
0 | 173 bool LoadTileGroupIds(); |
174 double GetFogDensityByTime(); | |
175 int GetSomeOtherTileInfo(int sX, int sY); | |
176 unsigned int GetTileTexture(int sX, int sZ); | |
177 int GetHeightOnTerrain(int sX, int sZ); | |
178 bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int thisa); | |
179 bool Release2(); | |
180 bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5); | |
181 void MessWithLUN(); | |
762 | 182 void UpdateSunlightVectors(); |
0 | 183 void UpdateFog(); |
184 int GetNumFoodRequiredToRestInCurrentPos(int x, signed int y, int z); | |
767 | 185 void SetFog(); |
0 | 186 void Draw(); |
187 | |
188 | |
189 char pLevelFilename[32]; | |
190 char pLocationFileName[32]; | |
191 char pLocationFileDescription[32]; | |
192 char pSkyTextureName[32]; | |
193 char pGroundTileset[32]; | |
630 | 194 OutdoorLocationTileType pTileTypes[4]; // [3] road tileset |
0 | 195 unsigned int uNumBModels; |
196 struct OutdoorLocationTerrain pTerrain; | |
760 | 197 void *pCmap; |
0 | 198 struct BSPModel *pBModels; |
199 unsigned int numFaceIDListElems; | |
200 unsigned __int16 *pFaceIDLIST; | |
201 unsigned int *pOMAP; | |
202 unsigned int uSky_TextureID; | |
203 unsigned int uMainTile_BitmapID; | |
204 __int16 field_F0; | |
205 __int16 field_F2; | |
206 int field_F4; | |
207 char field_F8[968]; | |
208 unsigned int uNumSpawnPoints; | |
209 struct SpawnPointMM7 *pSpawnPoints; | |
210 struct DDM_DLV_Header ddm; | |
211 unsigned __int64 uLastVisitDay; | |
760 | 212 char sky_texture_name[12]; |
0 | 213 int day_attrib; |
214 int day_fogrange_1; | |
215 int day_fogrange_2; | |
216 char field_510[24]; | |
752 | 217 unsigned char uUndiscoveredArea[88][11];//968 |
218 unsigned char uDicovered_area[88][11];//[968] | |
0 | 219 int field_CB8; |
638 | 220 int max_terrain_dimming_level; |
0 | 221 int field_CC0; |
222 unsigned int pSpriteIDs_LUN[8]; | |
223 unsigned int uSpriteID_LUNFULL; | |
224 int field_CE8; | |
225 unsigned int uSpriteID_LUN3_4_cp; | |
226 int field_CF0; | |
227 unsigned int uSpriteID_LUN1_2_cp; | |
228 int field_CF8; | |
229 unsigned int uSpriteID_LUN1_4_cp; | |
230 int field_D00; | |
231 unsigned __int16 uSpriteID_LUN_SUN; | |
232 __int16 field_D06; | |
233 int field_D08; | |
234 int field_D0C; | |
235 int field_D10; | |
236 int field_D14; | |
638 | 237 int inv_sunlight_x; |
238 int inv_sunlight_y; | |
239 int inv_sunlight_z; | |
0 | 240 int field_D24; |
241 int field_D28; | |
242 int field_D2C; | |
243 Vec3_int_ vSunlight; | |
244 int field_D3C; | |
245 int field_D40; | |
246 int field_D44; | |
247 int field_D48; | |
248 int field_D4C; | |
249 float field_D50; | |
250 int field_D54; | |
251 int field_D58; | |
252 int field_D5C; | |
253 int field_D60; | |
254 int field_D64; | |
255 char field_D68[111900]; | |
256 float fFogDensity; | |
257 int uLastSunlightUpdateMinute; | |
258 }; | |
259 #pragma pack(pop) | |
260 | |
261 | |
262 extern struct OutdoorLocation *pOutdoor; | |
263 | |
264 | |
265 | |
266 | |
267 | |
268 | |
269 | |
270 | |
271 | |
272 | |
273 | |
274 | |
275 | |
276 #include "Outdoor_stuff.h" |