5 #ifndef FUNCTIONS_H |
5 #ifndef FUNCTIONS_H |
6 #define FUNCTIONS_H |
6 #define FUNCTIONS_H |
7 |
7 |
8 #include "gfx.h" |
8 #include "gfx.h" |
9 |
9 |
10 void DoClearSquare(TileIndex tile); |
|
11 void RunTileLoop(); |
|
12 |
|
13 uint GetPartialZ(int x, int y, Slope corners); |
|
14 uint GetSlopeZ(int x, int y); |
|
15 uint32 GetTileTrackStatus(TileIndex tile, TransportType mode); |
|
16 void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac); |
|
17 void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player); |
|
18 void AnimateTile(TileIndex tile); |
|
19 void ClickTile(TileIndex tile); |
|
20 void GetTileDesc(TileIndex tile, TileDesc *td); |
|
21 void UpdateTownMaxPass(Town *t); |
10 void UpdateTownMaxPass(Town *t); |
22 |
|
23 bool IsValidTile(TileIndex tile); |
|
24 |
|
25 static inline Point RemapCoords(int x, int y, int z) |
|
26 { |
|
27 Point pt; |
|
28 pt.x = (y - x) * 2; |
|
29 pt.y = y + x - z; |
|
30 return pt; |
|
31 } |
|
32 |
|
33 static inline Point RemapCoords2(int x, int y) |
|
34 { |
|
35 return RemapCoords(x, y, GetSlopeZ(x, y)); |
|
36 } |
|
37 |
|
38 |
11 |
39 /* clear_land.cpp */ |
12 /* clear_land.cpp */ |
40 void DrawHillyLandTile(const TileInfo *ti); |
13 void DrawHillyLandTile(const TileInfo *ti); |
41 void DrawClearLandTile(const TileInfo *ti, byte set); |
14 void DrawClearLandTile(const TileInfo *ti, byte set); |
42 void DrawClearLandFence(const TileInfo *ti); |
15 void DrawClearLandFence(const TileInfo *ti); |
168 bool EnsureNoVehicleOnGround(TileIndex tile); |
141 bool EnsureNoVehicleOnGround(TileIndex tile); |
169 void MarkAllViewportsDirty(int left, int top, int right, int bottom); |
142 void MarkAllViewportsDirty(int left, int top, int right, int bottom); |
170 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost); |
143 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost); |
171 void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost); |
144 void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost); |
172 |
145 |
173 void DrawFoundation(TileInfo *ti, uint f); |
|
174 |
|
175 bool CheckIfAuthorityAllows(TileIndex tile); |
146 bool CheckIfAuthorityAllows(TileIndex tile); |
176 Town *ClosestTownFromTile(TileIndex tile, uint threshold); |
147 Town *ClosestTownFromTile(TileIndex tile, uint threshold); |
177 void ChangeTownRating(Town *t, int add, int max); |
148 void ChangeTownRating(Town *t, int add, int max); |
178 |
149 |
179 uint GetTownRadiusGroup(const Town* t, TileIndex tile); |
150 uint GetTownRadiusGroup(const Town* t, TileIndex tile); |
180 int FindFirstBit(uint32 x); |
151 int FindFirstBit(uint32 x); |
181 void ShowHighscoreTable(int difficulty, int8 rank); |
152 void ShowHighscoreTable(int difficulty, int8 rank); |
182 TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng); |
|
183 |
153 |
184 void AfterLoadTown(); |
154 void AfterLoadTown(); |
185 void UpdatePatches(); |
155 void UpdatePatches(); |
186 void AskExitGame(); |
156 void AskExitGame(); |
187 void AskExitToGameMenu(); |
157 void AskExitToGameMenu(); |