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