annotate Outdoor.h @ 2350:7c10dfb6d802

Finishing moving all known UI functions to their appropriate headers
author Grumpy7
date Wed, 09 Apr 2014 21:45:07 +0200
parents 5d263539bbec
children a574a80e7012
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 810
diff changeset
2
0
Ritor1
parents:
diff changeset
3 #include "Indoor.h"
630
1b813023fcbd Tilesets change according to current season
Nomad
parents: 227
diff changeset
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
Ritor1
parents:
diff changeset
6
767
45615cacad31 Fog fixed
Nomad
parents: 763
diff changeset
7 #define DAY_ATTRIB_FOG 1
45615cacad31 Fog fixed
Nomad
parents: 763
diff changeset
8
0
Ritor1
parents:
diff changeset
9 /* 256 */
Ritor1
parents:
diff changeset
10 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
11 struct ODMHeader
Ritor1
parents:
diff changeset
12 {
Ritor1
parents:
diff changeset
13 int uVersion;
Ritor1
parents:
diff changeset
14 char pMagic[4];
Ritor1
parents:
diff changeset
15 unsigned int uCompressedSize;
Ritor1
parents:
diff changeset
16 unsigned int uDecompressedSize;
Ritor1
parents:
diff changeset
17 };
Ritor1
parents:
diff changeset
18 #pragma pack(pop)
Ritor1
parents:
diff changeset
19
Ritor1
parents:
diff changeset
20
Ritor1
parents:
diff changeset
21
Ritor1
parents:
diff changeset
22 /* 78 */
Ritor1
parents:
diff changeset
23 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
24 struct OutdoorLocationTileType
Ritor1
parents:
diff changeset
25 {
630
1b813023fcbd Tilesets change according to current season
Nomad
parents: 227
diff changeset
26 Tileset tileset;
0
Ritor1
parents:
diff changeset
27 unsigned __int16 uTileID;
Ritor1
parents:
diff changeset
28 };
Ritor1
parents:
diff changeset
29 #pragma pack(pop)
Ritor1
parents:
diff changeset
30
760
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
31 #pragma pack(push, 1)
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
32 struct DMap
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
33 {
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
34 unsigned __int8 field0;
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
35 unsigned __int8 field1;
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
36 };
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
37 #pragma pack(pop)
0
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39 /* 79 */
Ritor1
parents:
diff changeset
40 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
41 struct OutdoorLocationTerrain
Ritor1
parents:
diff changeset
42 {
Ritor1
parents:
diff changeset
43 //----- (0047C794) --------------------------------------------------------
Ritor1
parents:
diff changeset
44 inline OutdoorLocationTerrain()
Ritor1
parents:
diff changeset
45 {
760
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
46 pHeightmap = NULL;
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
47 pTilemap = NULL;
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
48 pAttributemap = NULL;
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
49 pDmap = NULL;;
0
Ritor1
parents:
diff changeset
50 this->field_10 = 0;
Ritor1
parents:
diff changeset
51 this->field_12 = 0;
Ritor1
parents:
diff changeset
52
760
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
53
0
Ritor1
parents:
diff changeset
54 }
Ritor1
parents:
diff changeset
55
Ritor1
parents:
diff changeset
56 void _47C7A9();
Ritor1
parents:
diff changeset
57 void Release();
760
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
58 void FillDMap(int X, int Y, int W, int Z);
0
Ritor1
parents:
diff changeset
59 int _47CB57(int a1, int a2, int a3);
Ritor1
parents:
diff changeset
60 bool ZeroLandscape();
Ritor1
parents:
diff changeset
61 bool Initialize();
Ritor1
parents:
diff changeset
62
Ritor1
parents:
diff changeset
63
Ritor1
parents:
diff changeset
64 unsigned __int8 *pHeightmap;
Ritor1
parents:
diff changeset
65 unsigned __int8 *pTilemap;
Ritor1
parents:
diff changeset
66 unsigned __int8 *pAttributemap;
760
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
67 struct DMap *pDmap;
0
Ritor1
parents:
diff changeset
68 __int16 field_10;
Ritor1
parents:
diff changeset
69 __int16 field_12;
Ritor1
parents:
diff changeset
70 __int16 field_14;
Ritor1
parents:
diff changeset
71 __int16 field_16;
Ritor1
parents:
diff changeset
72 int field_18;
Ritor1
parents:
diff changeset
73 int field_1C;
Ritor1
parents:
diff changeset
74 };
Ritor1
parents:
diff changeset
75 #pragma pack(pop)
Ritor1
parents:
diff changeset
76
Ritor1
parents:
diff changeset
77
Ritor1
parents:
diff changeset
78 /* 81 */
Ritor1
parents:
diff changeset
79 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
80 struct ODMFace
Ritor1
parents:
diff changeset
81 {
Ritor1
parents:
diff changeset
82 bool HasEventHint();
Ritor1
parents:
diff changeset
83
Ritor1
parents:
diff changeset
84
2169
5b27c035a241 small cleaning
Ritor1
parents: 2092
diff changeset
85 static bool IsBackfaceCulled(struct RenderVertexSoft *a2, struct Polygon *polygon);
0
Ritor1
parents:
diff changeset
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
Ritor1
parents:
diff changeset
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
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2075
diff changeset
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
a869b0376b48 enums and BLV_UpdateDoors()
Ritor1
parents: 2075
diff changeset
93 inline bool Pressure_Plate() const {return (uAttributes & FACE_PRESSURE_PLATE) != 0;}
2075
24033aa2e1f8 ODM_GetFloorLevel() check height
Ritor1
parents: 2065
diff changeset
94 inline bool Ethereal() const {return (uAttributes & FACE_ETHEREAL) != 0;}
0
Ritor1
parents:
diff changeset
95
Ritor1
parents:
diff changeset
96 struct Plane_int_ pFacePlane;
Ritor1
parents:
diff changeset
97 int zCalc1;
Ritor1
parents:
diff changeset
98 int zCalc2;
Ritor1
parents:
diff changeset
99 int zCalc3;
Ritor1
parents:
diff changeset
100 unsigned int uAttributes;
Ritor1
parents:
diff changeset
101 unsigned __int16 pVertexIDs[20];
Ritor1
parents:
diff changeset
102 unsigned __int16 pTextureUIDs[20];
Ritor1
parents:
diff changeset
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
69ab7593e7af Out of bounds (id 65536) texture fixed.
Nomad
parents: 1583
diff changeset
107 __int16 uTextureID;
0
Ritor1
parents:
diff changeset
108 __int16 sTextureDeltaU;
Ritor1
parents:
diff changeset
109 __int16 sTextureDeltaV;
Ritor1
parents:
diff changeset
110 struct BBox_short_ pBoundingBox;
Ritor1
parents:
diff changeset
111 __int16 sCogNumber;
Ritor1
parents:
diff changeset
112 __int16 sCogTriggeredID;
Ritor1
parents:
diff changeset
113 __int16 sCogTriggerType;
Ritor1
parents:
diff changeset
114 char field_128;
Ritor1
parents:
diff changeset
115 char field_129;
Ritor1
parents:
diff changeset
116 unsigned __int8 uGradientVertex1;
Ritor1
parents:
diff changeset
117 unsigned __int8 uGradientVertex2;
Ritor1
parents:
diff changeset
118 unsigned __int8 uGradientVertex3;
Ritor1
parents:
diff changeset
119 unsigned __int8 uGradientVertex4;
Ritor1
parents:
diff changeset
120 unsigned __int8 uNumVertices;
Ritor1
parents:
diff changeset
121 unsigned __int8 uPolygonType;
Ritor1
parents:
diff changeset
122 unsigned __int8 uShadeType;
Ritor1
parents:
diff changeset
123 unsigned __int8 bVisible;
Ritor1
parents:
diff changeset
124 char field_132;
Ritor1
parents:
diff changeset
125 char field_133;
Ritor1
parents:
diff changeset
126 };
Ritor1
parents:
diff changeset
127 #pragma pack(pop)
Ritor1
parents:
diff changeset
128
Ritor1
parents:
diff changeset
129
Ritor1
parents:
diff changeset
130
Ritor1
parents:
diff changeset
131 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
132 struct OutdoorLocation
Ritor1
parents:
diff changeset
133 {
1323
bfde0563ecdc removed weather.h from indoor.h
Grumpy7
parents: 1276
diff changeset
134 OutdoorLocation();
bfde0563ecdc removed weather.h from indoor.h
Grumpy7
parents: 1276
diff changeset
135 void subconstuctor();
0
Ritor1
parents:
diff changeset
136
Ritor1
parents:
diff changeset
137 void ExecDraw(unsigned int bRedraw);
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 119
diff changeset
138 void PrepareActorsDrawList();
0
Ritor1
parents:
diff changeset
139 void CreateDebugLocation();
Ritor1
parents:
diff changeset
140 void Release();
119
be3c07c98861 Outdoor minimap fixed (didn't test wizard eye thou)
Nomad
parents: 0
diff changeset
141 bool Load(const char *pFilename, ODMFace *File, size_t a4, int thisa);
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 760
diff changeset
142 int GetTileIdByTileMapId(signed int a2);
2006
30c2b575d25c signed fixes
zipi
parents: 2003
diff changeset
143 unsigned int DoGetTileTexture(signed int uX, signed int uZ);
0
Ritor1
parents:
diff changeset
144 int _47ED83(signed int a2, signed int a3);
2006
30c2b575d25c signed fixes
zipi
parents: 2003
diff changeset
145 int ActuallyGetSomeOtherTileInfo(signed int uX, signed int uY);
2003
72af4d93bdfb DoGetHeightOnTerrain -1 signed fix
zipi
parents: 1632
diff changeset
146 int DoGetHeightOnTerrain(signed int sX, signed int sZ);
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 760
diff changeset
147 int GetSoundIdByPosition(signed int X_pos, signed int Y_pos, int a4);
752
8b29c4121f6f map mask
Gloval
parents: 676
diff changeset
148 int UpdateDiscoveredArea(int a2, int a3, int a4);
0
Ritor1
parents:
diff changeset
149 bool _47F04C(signed int a2, signed int a3);
Ritor1
parents:
diff changeset
150 bool _47F097(signed int a2, signed int a3);
Ritor1
parents:
diff changeset
151 bool _47F0E2();
Ritor1
parents:
diff changeset
152 bool PrepareDecorations();
2065
87be06553c76 rename int _47F223_LooksLikeGenerateMonsterLoot() to void ArrangeSpriteObjects()
Ritor1
parents: 2006
diff changeset
153 void ArrangeSpriteObjects();
0
Ritor1
parents:
diff changeset
154 bool InitalizeActors(int a1);
630
1b813023fcbd Tilesets change according to current season
Nomad
parents: 227
diff changeset
155 bool LoadRoadTileset();
0
Ritor1
parents:
diff changeset
156 bool LoadTileGroupIds();
Ritor1
parents:
diff changeset
157 double GetFogDensityByTime();
Ritor1
parents:
diff changeset
158 int GetSomeOtherTileInfo(int sX, int sY);
Ritor1
parents:
diff changeset
159 unsigned int GetTileTexture(int sX, int sZ);
Ritor1
parents:
diff changeset
160 int GetHeightOnTerrain(int sX, int sZ);
Ritor1
parents:
diff changeset
161 bool Initialize(const char *pFilename, int File, size_t uRespawnInterval, int thisa);
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1391
diff changeset
162 //bool Release2();
0
Ritor1
parents:
diff changeset
163 bool GetTravelDestination(signed int sPartyX, signed int sPartyZ, char *pOut, signed int a5);
Ritor1
parents:
diff changeset
164 void MessWithLUN();
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 752
diff changeset
165 void UpdateSunlightVectors();
0
Ritor1
parents:
diff changeset
166 void UpdateFog();
Ritor1
parents:
diff changeset
167 int GetNumFoodRequiredToRestInCurrentPos(int x, signed int y, int z);
767
45615cacad31 Fog fixed
Nomad
parents: 763
diff changeset
168 void SetFog();
0
Ritor1
parents:
diff changeset
169 void Draw();
Ritor1
parents:
diff changeset
170
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2169
diff changeset
171 static void LoadActualSkyFrame();
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2169
diff changeset
172
0
Ritor1
parents:
diff changeset
173
Ritor1
parents:
diff changeset
174 char pLevelFilename[32];
Ritor1
parents:
diff changeset
175 char pLocationFileName[32];
Ritor1
parents:
diff changeset
176 char pLocationFileDescription[32];
Ritor1
parents:
diff changeset
177 char pSkyTextureName[32];
Ritor1
parents:
diff changeset
178 char pGroundTileset[32];
630
1b813023fcbd Tilesets change according to current season
Nomad
parents: 227
diff changeset
179 OutdoorLocationTileType pTileTypes[4]; // [3] road tileset
1267
33e360a9b4bf some fixes in normals
Gloval
parents: 1262
diff changeset
180 int uNumBModels;
0
Ritor1
parents:
diff changeset
181 struct OutdoorLocationTerrain pTerrain;
760
7f1487b74571 some outdoor cleaning
Gloval
parents: 752
diff changeset
182 void *pCmap;
1052
d48c762de563 -nomarg
Nomad
parents: 1030
diff changeset
183 BSPModel *pBModels;
0
Ritor1
parents:
diff changeset
184 unsigned int numFaceIDListElems;
Ritor1
parents:
diff changeset
185 unsigned __int16 *pFaceIDLIST;
Ritor1
parents:
diff changeset
186 unsigned int *pOMAP;
2006
30c2b575d25c signed fixes
zipi
parents: 2003
diff changeset
187 signed int sSky_TextureID;
30c2b575d25c signed fixes
zipi
parents: 2003
diff changeset
188 signed int sMainTile_BitmapID;
0
Ritor1
parents:
diff changeset
189 __int16 field_F0;
Ritor1
parents:
diff changeset
190 __int16 field_F2;
Ritor1
parents:
diff changeset
191 int field_F4;
Ritor1
parents:
diff changeset
192 char field_F8[968];
Ritor1
parents:
diff changeset
193 unsigned int uNumSpawnPoints;
Ritor1
parents:
diff changeset
194 struct SpawnPointMM7 *pSpawnPoints;
Ritor1
parents:
diff changeset
195 struct DDM_DLV_Header ddm;
810
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
196 LocationTime_stru1 loc_time;
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
197 //unsigned __int64 uLastVisitDay;
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
198 //char sky_texture_name[12];
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
199 //int day_attrib;
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
200 //int day_fogrange_1;
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
201 //int day_fogrange_2;
f5156b8c61ad savegame refactoring
Gloval
parents: 791
diff changeset
202 // char field_510[24];
752
8b29c4121f6f map mask
Gloval
parents: 676
diff changeset
203 unsigned char uUndiscoveredArea[88][11];//968
8b29c4121f6f map mask
Gloval
parents: 676
diff changeset
204 unsigned char uDicovered_area[88][11];//[968]
0
Ritor1
parents:
diff changeset
205 int field_CB8;
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 630
diff changeset
206 int max_terrain_dimming_level;
0
Ritor1
parents:
diff changeset
207 int field_CC0;
Ritor1
parents:
diff changeset
208 unsigned int pSpriteIDs_LUN[8];
Ritor1
parents:
diff changeset
209 unsigned int uSpriteID_LUNFULL;
Ritor1
parents:
diff changeset
210 int field_CE8;
Ritor1
parents:
diff changeset
211 unsigned int uSpriteID_LUN3_4_cp;
Ritor1
parents:
diff changeset
212 int field_CF0;
Ritor1
parents:
diff changeset
213 unsigned int uSpriteID_LUN1_2_cp;
Ritor1
parents:
diff changeset
214 int field_CF8;
Ritor1
parents:
diff changeset
215 unsigned int uSpriteID_LUN1_4_cp;
Ritor1
parents:
diff changeset
216 int field_D00;
Ritor1
parents:
diff changeset
217 unsigned __int16 uSpriteID_LUN_SUN;
Ritor1
parents:
diff changeset
218 __int16 field_D06;
Ritor1
parents:
diff changeset
219 int field_D08;
Ritor1
parents:
diff changeset
220 int field_D0C;
Ritor1
parents:
diff changeset
221 int field_D10;
Ritor1
parents:
diff changeset
222 int field_D14;
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 630
diff changeset
223 int inv_sunlight_x;
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 630
diff changeset
224 int inv_sunlight_y;
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 630
diff changeset
225 int inv_sunlight_z;
0
Ritor1
parents:
diff changeset
226 int field_D24;
Ritor1
parents:
diff changeset
227 int field_D28;
Ritor1
parents:
diff changeset
228 int field_D2C;
Ritor1
parents:
diff changeset
229 Vec3_int_ vSunlight;
Ritor1
parents:
diff changeset
230 int field_D3C;
Ritor1
parents:
diff changeset
231 int field_D40;
Ritor1
parents:
diff changeset
232 int field_D44;
Ritor1
parents:
diff changeset
233 int field_D48;
Ritor1
parents:
diff changeset
234 int field_D4C;
Ritor1
parents:
diff changeset
235 float field_D50;
Ritor1
parents:
diff changeset
236 int field_D54;
Ritor1
parents:
diff changeset
237 int field_D58;
Ritor1
parents:
diff changeset
238 int field_D5C;
Ritor1
parents:
diff changeset
239 int field_D60;
Ritor1
parents:
diff changeset
240 int field_D64;
Ritor1
parents:
diff changeset
241 char field_D68[111900];
Ritor1
parents:
diff changeset
242 float fFogDensity;
Ritor1
parents:
diff changeset
243 int uLastSunlightUpdateMinute;
Ritor1
parents:
diff changeset
244 };
Ritor1
parents:
diff changeset
245 #pragma pack(pop)
Ritor1
parents:
diff changeset
246
Ritor1
parents:
diff changeset
247
Ritor1
parents:
diff changeset
248 extern struct OutdoorLocation *pOutdoor;
Ritor1
parents:
diff changeset
249
2343
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2340
diff changeset
250 void ODM_UpdateUserInputAndOther();
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2340
diff changeset
251 int ODM_GetFloorLevel(int X, signed int Y, int Z, int, int *pOnWater, int *bmodel_pid, int bWaterWalk);
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2340
diff changeset
252 int GetCeilingHeight(int Party_X, signed int Party_Y, int Party_ZHeight, int pFaceID);
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2340
diff changeset
253 void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out);
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2340
diff changeset
254 void UpdateActors_ODM();
5d263539bbec Moving functions from unsorted_subs.h pt5
Grumpy7
parents: 2340
diff changeset
255 void ODM_ProcessPartyActions();
0
Ritor1
parents:
diff changeset
256
Ritor1
parents:
diff changeset
257
Ritor1
parents:
diff changeset
258
Ritor1
parents:
diff changeset
259
Ritor1
parents:
diff changeset
260
Ritor1
parents:
diff changeset
261
Ritor1
parents:
diff changeset
262
Ritor1
parents:
diff changeset
263
Ritor1
parents:
diff changeset
264
Ritor1
parents:
diff changeset
265