Mercurial > mm7
annotate Outdoor.h @ 2385:b842e1b77c8c
sub_407A1C - fixed wrong refactoring of condition
author | zipi |
---|---|
date | Sun, 22 Jun 2014 15:14:10 +0100 |
parents | bddcaf5d5db2 |
children | eba7123e4a2d |
rev | line source |
---|---|
0 | 1 #pragma |
1016 | 2 |
0 | 3 #include "Indoor.h" |
630 | 4 #include "TileFrameTable.h" |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1323
diff
changeset
|
5 #include "BSPModel.h" |
0 | 6 |
767 | 7 #define DAY_ATTRIB_FOG 1 |
8 | |
0 | 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 { | |
630 | 26 Tileset tileset; |
0 | 27 unsigned __int16 uTileID; |
28 }; | |
29 #pragma pack(pop) | |
30 | |
760 | 31 #pragma pack(push, 1) |
32 struct DMap | |
33 { | |
34 unsigned __int8 field0; | |
35 unsigned __int8 field1; | |
36 }; | |
37 #pragma pack(pop) | |
0 | 38 |
39 /* 79 */ | |
40 #pragma pack(push, 1) | |
41 struct OutdoorLocationTerrain | |
42 { | |
43 //----- (0047C794) -------------------------------------------------------- | |
44 inline OutdoorLocationTerrain() | |
45 { | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2368
diff
changeset
|
46 pHeightmap = nullptr; |
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2368
diff
changeset
|
47 pTilemap = nullptr; |
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2368
diff
changeset
|
48 pAttributemap = nullptr; |
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2368
diff
changeset
|
49 pDmap = nullptr;; |
0 | 50 this->field_10 = 0; |
51 this->field_12 = 0; | |
52 | |
760 | 53 |
0 | 54 } |
55 | |
56 void _47C7A9(); | |
57 void Release(); | |
760 | 58 void FillDMap(int X, int Y, int W, int Z); |
0 | 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; | |
760 | 67 struct DMap *pDmap; |
0 | 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 | |
2368
91b6c0a338ad
ODMFace::IsBackfaceCulled to ODMFace::IsBackfaceNotCulled, cleaned up a bit
Grumpy7
parents:
2365
diff
changeset
|
85 static bool IsBackfaceNotCulled(struct RenderVertexSoft *a2, struct Polygon *polygon); |
0 | 86 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1052
diff
changeset
|
87 inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;} |
0 | 88 inline bool Visible() const {return !Invisible();} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1052
diff
changeset
|
89 inline bool Portal() const {return (uAttributes & FACE_PORTAL) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1052
diff
changeset
|
90 inline bool Fluid() const {return (uAttributes & FACE_FLUID) != 0;} |
2092 | 91 inline bool Indoor_sky() const {return (uAttributes & FACE_INDOOR_SKY) != 0;} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1052
diff
changeset
|
92 inline bool Clickable() const {return (uAttributes & FACE_CLICKABLE) != 0;} |
2092 | 93 inline bool Pressure_Plate() const {return (uAttributes & FACE_PRESSURE_PLATE) != 0;} |
2075 | 94 inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;} |
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]; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
104 signed __int16 pXInterceptDisplacements[20]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
105 signed __int16 pYInterceptDisplacements[20]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
106 signed __int16 pZInterceptDisplacements[20]; |
1632 | 107 __int16 uTextureID; |
0 | 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 | |
131 #pragma pack(push, 1) | |
132 struct OutdoorLocation | |
133 { | |
1323 | 134 OutdoorLocation(); |
135 void subconstuctor(); | |
0 | 136 |
137 void ExecDraw(unsigned int bRedraw); | |
142 | 138 void PrepareActorsDrawList(); |
0 | 139 void CreateDebugLocation(); |
140 void Release(); | |
119 | 141 bool Load(const char *pFilename, ODMFace *File, size_t a4, int thisa); |
764 | 142 int GetTileIdByTileMapId(signed int a2); |
2006 | 143 unsigned int DoGetTileTexture(signed int uX, signed int uZ); |
0 | 144 int _47ED83(signed int a2, signed int a3); |
2006 | 145 int ActuallyGetSomeOtherTileInfo(signed int uX, signed int uY); |
2003 | 146 int DoGetHeightOnTerrain(signed int sX, signed int sZ); |
764 | 147 int GetSoundIdByPosition(signed int X_pos, signed int Y_pos, int a4); |
752 | 148 int UpdateDiscoveredArea(int a2, int a3, int a4); |
2365
65789351a537
OutdoorLocation::_47F04C and OutdoorLocation::_47F097 to OutdoorLocation::IsMapCellFullyRevealed and OutdoorLocation::IsMapCellPartiallyRevealed
Grumpy7
parents:
2364
diff
changeset
|
149 bool IsMapCellFullyRevealed(signed int a2, signed int a3); |
65789351a537
OutdoorLocation::_47F04C and OutdoorLocation::_47F097 to OutdoorLocation::IsMapCellFullyRevealed and OutdoorLocation::IsMapCellPartiallyRevealed
Grumpy7
parents:
2364
diff
changeset
|
150 bool IsMapCellPartiallyRevealed(signed int a2, signed int a3); |
0 | 151 bool _47F0E2(); |
152 bool PrepareDecorations(); | |
2065
87be06553c76
rename int _47F223_LooksLikeGenerateMonsterLoot() to void ArrangeSpriteObjects()
Ritor1
parents:
2006
diff
changeset
|
153 void ArrangeSpriteObjects(); |
0 | 154 bool InitalizeActors(int a1); |
630 | 155 bool LoadRoadTileset(); |
0 | 156 bool LoadTileGroupIds(); |
157 double GetFogDensityByTime(); | |
158 int GetSomeOtherTileInfo(int sX, int sY); | |
159 unsigned int GetTileTexture(int sX, int sZ); | |
160 int GetHeightOnTerrain(int sX, int sZ); | |
161 bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int thisa); | |
1583 | 162 //bool Release2(); |
0 | 163 bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5); |
164 void MessWithLUN(); | |
762 | 165 void UpdateSunlightVectors(); |
0 | 166 void UpdateFog(); |
167 int GetNumFoodRequiredToRestInCurrentPos(int x, signed int y, int z); | |
767 | 168 void SetFog(); |
0 | 169 void Draw(); |
170 | |
2340 | 171 static void LoadActualSkyFrame(); |
172 | |
0 | 173 |
174 char pLevelFilename[32]; | |
175 char pLocationFileName[32]; | |
176 char pLocationFileDescription[32]; | |
177 char pSkyTextureName[32]; | |
178 char pGroundTileset[32]; | |
630 | 179 OutdoorLocationTileType pTileTypes[4]; // [3] road tileset |
1267 | 180 int uNumBModels; |
0 | 181 struct OutdoorLocationTerrain pTerrain; |
760 | 182 void *pCmap; |
1052 | 183 BSPModel *pBModels; |
0 | 184 unsigned int numFaceIDListElems; |
185 unsigned __int16 *pFaceIDLIST; | |
186 unsigned int *pOMAP; | |
2006 | 187 signed int sSky_TextureID; |
188 signed int sMainTile_BitmapID; | |
0 | 189 __int16 field_F0; |
190 __int16 field_F2; | |
191 int field_F4; | |
192 char field_F8[968]; | |
193 unsigned int uNumSpawnPoints; | |
194 struct SpawnPointMM7 *pSpawnPoints; | |
195 struct DDM_DLV_Header ddm; | |
810 | 196 LocationTime_stru1 loc_time; |
197 //unsigned __int64 uLastVisitDay; | |
198 //char sky_texture_name[12]; | |
199 //int day_attrib; | |
200 //int day_fogrange_1; | |
201 //int day_fogrange_2; | |
202 // char field_510[24]; | |
2364 | 203 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 |
204 unsigned char uPartiallyRevealedCellOnMap[88][11];//[968] | |
0 | 205 int field_CB8; |
638 | 206 int max_terrain_dimming_level; |
0 | 207 int field_CC0; |
208 unsigned int pSpriteIDs_LUN[8]; | |
209 unsigned int uSpriteID_LUNFULL; | |
210 int field_CE8; | |
211 unsigned int uSpriteID_LUN3_4_cp; | |
212 int field_CF0; | |
213 unsigned int uSpriteID_LUN1_2_cp; | |
214 int field_CF8; | |
215 unsigned int uSpriteID_LUN1_4_cp; | |
216 int field_D00; | |
217 unsigned __int16 uSpriteID_LUN_SUN; | |
218 __int16 field_D06; | |
219 int field_D08; | |
220 int field_D0C; | |
221 int field_D10; | |
222 int field_D14; | |
638 | 223 int inv_sunlight_x; |
224 int inv_sunlight_y; | |
225 int inv_sunlight_z; | |
0 | 226 int field_D24; |
227 int field_D28; | |
228 int field_D2C; | |
229 Vec3_int_ vSunlight; | |
230 int field_D3C; | |
231 int field_D40; | |
232 int field_D44; | |
233 int field_D48; | |
234 int field_D4C; | |
235 float field_D50; | |
236 int field_D54; | |
237 int field_D58; | |
238 int field_D5C; | |
239 int field_D60; | |
240 int field_D64; | |
241 char field_D68[111900]; | |
242 float fFogDensity; | |
243 int uLastSunlightUpdateMinute; | |
244 }; | |
245 #pragma pack(pop) | |
246 | |
247 | |
248 extern struct OutdoorLocation *pOutdoor; | |
249 | |
2343 | 250 void ODM_UpdateUserInputAndOther(); |
251 int ODM_GetFloorLevel(int X, signed int Y, int Z, int, int *pOnWater, int *bmodel_pid, int bWaterWalk); | |
252 int GetCeilingHeight(int Party_X, signed int Party_Y, int Party_ZHeight, int pFaceID); | |
253 void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out); | |
254 void UpdateActors_ODM(); | |
255 void ODM_ProcessPartyActions(); | |
2355 | 256 char Is_out15odm_underwater(); |
257 void SetUnderwaterFog(); | |
0 | 258 |
259 | |
260 | |
261 | |
262 | |
263 | |
264 | |
265 | |
266 | |
267 |