author | tron |
Sun, 16 Oct 2005 09:13:04 +0000 | |
changeset 2520 | 75eb66d6e371 |
parent 2482 | dffcca243dbc |
child 2639 | 8a7342eb3a78 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef FUNCTIONS_H |
4 |
#define FUNCTIONS_H |
|
5 |
||
6 |
/* vehicle.c */ |
|
7 |
||
8 |
/* window.c */ |
|
9 |
||
10 |
||
11 |
/* landscape.c */ |
|
12 |
void FindLandscapeHeight(TileInfo *ti, uint x, uint y); |
|
1420
5308b177b5b3
(svn r1924) Use same type names in declaration and implementation
tron
parents:
1377
diff
changeset
|
13 |
void FindLandscapeHeightByTile(TileInfo *ti, TileIndex tile); |
0 | 14 |
|
1589
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
15 |
void DoClearSquare(TileIndex tile); |
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
16 |
void CDECL ModifyTile(TileIndex tile, uint flags, ...); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
17 |
void RunTileLoop(void); |
0 | 18 |
|
19 |
uint GetPartialZ(int x, int y, int corners); |
|
20 |
uint GetSlopeZ(int x, int y); |
|
1589
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
21 |
uint32 GetTileTrackStatus(TileIndex tile, TransportType mode); |
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
22 |
void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac); |
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
23 |
void ChangeTileOwner(TileIndex tile, byte old_player, byte new_player); |
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
24 |
void AnimateTile(TileIndex tile); |
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
25 |
void ClickTile(TileIndex tile); |
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
26 |
void GetTileDesc(TileIndex tile, TileDesc *td); |
0 | 27 |
void DrawTile(TileInfo *ti); |
1377
2a418162176e
(svn r1881) -Fix: [ 1119308 ] Max passengers / mail variables are now 32 bit
celestar
parents:
1335
diff
changeset
|
28 |
void UpdateTownMaxPass(Town *t); |
0 | 29 |
|
1589
58d173b56509
(svn r2093) uint -> TileIndex, remove commented out code and a local variable, which was only used once
tron
parents:
1542
diff
changeset
|
30 |
bool IsValidTile(TileIndex tile); |
0 | 31 |
|
536 | 32 |
static inline Point RemapCoords(int x, int y, int z) |
33 |
{ |
|
0 | 34 |
#if !defined(NEW_ROTATION) |
781
9717ff353c17
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
35 |
Point pt; |
9717ff353c17
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
36 |
pt.x = (y - x) * 2; |
9717ff353c17
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
37 |
pt.y = y + x - z; |
0 | 38 |
#else |
781
9717ff353c17
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
39 |
Point pt; |
9717ff353c17
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
40 |
pt.x = (x + y) * 2; |
9717ff353c17
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
41 |
pt.y = x - y - z; |
0 | 42 |
#endif |
536 | 43 |
return pt; |
44 |
} |
|
0 | 45 |
|
536 | 46 |
static inline Point RemapCoords2(int x, int y) |
47 |
{ |
|
48 |
return RemapCoords(x, y, GetSlopeZ(x, y)); |
|
49 |
} |
|
0 | 50 |
|
51 |
||
52 |
/* clear_land.c */ |
|
2436
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2380
diff
changeset
|
53 |
void DrawHillyLandTile(const TileInfo *ti); |
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2380
diff
changeset
|
54 |
void DrawClearLandTile(const TileInfo *ti, byte set); |
2220 | 55 |
void DrawClearLandFence(const TileInfo *ti); |
1420
5308b177b5b3
(svn r1924) Use same type names in declaration and implementation
tron
parents:
1377
diff
changeset
|
56 |
void TileLoopClearHelper(TileIndex tile); |
0 | 57 |
|
58 |
/* road_land.c */ |
|
59 |
void DrawRoadDepotSprite(int x, int y, int image); |
|
60 |
||
61 |
/* water_land.c */ |
|
62 |
void DrawShipDepotSprite(int x, int y, int image); |
|
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
63 |
void TileLoop_Water(TileIndex tile); |
0 | 64 |
|
65 |
/* players.c */ |
|
66 |
bool CheckPlayerHasMoney(int32 cost); |
|
67 |
void SubtractMoneyFromPlayer(int32 cost); |
|
2436
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2380
diff
changeset
|
68 |
void SubtractMoneyFromPlayerFract(PlayerID player, int32 cost); |
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2380
diff
changeset
|
69 |
bool CheckOwnership(PlayerID owner); |
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
70 |
bool CheckTileOwnership(TileIndex tile); |
2475 | 71 |
StringID GetPlayerNameString(PlayerID player, uint index); |
0 | 72 |
|
73 |
/* standard */ |
|
74 |
void ShowInfo(const char *str); |
|
75 |
void CDECL ShowInfoF(const char *str, ...); |
|
76 |
void NORETURN CDECL error(const char *str, ...); |
|
77 |
||
2075
7f0ca01392db
(svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents:
2073
diff
changeset
|
78 |
/* openttd.c */ |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
79 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
80 |
// ************** |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
81 |
// * Warning: DO NOT enable this unless you understand what it does |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
82 |
// * |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
83 |
// * If enabled, in a network game all randoms will be dumped to the |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
84 |
// * stdout if the first client joins (or if you are a client). This |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
85 |
// * is to help finding desync problems. |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
86 |
// * |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
87 |
// * Warning: DO NOT enable this unless you understand what it does |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
88 |
// ************** |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
89 |
|
1539
3d5b40209884
(svn r2043) -Fix: committed too many files in the last commit
truelight
parents:
1538
diff
changeset
|
90 |
//#define RANDOM_DEBUG |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
91 |
|
2073 | 92 |
|
93 |
// Enable this to produce higher quality random numbers. |
|
94 |
// Doesn't work with network yet. |
|
95 |
//#define MERSENNE_TWISTER |
|
96 |
||
97 |
// Mersenne twister functions |
|
98 |
void SeedMT(uint32 seed); |
|
99 |
uint32 RandomMT(void); |
|
100 |
||
101 |
||
102 |
#ifdef MERSENNE_TWISTER |
|
103 |
static inline uint32 Random(void) { return RandomMT(); } |
|
104 |
uint RandomRange(uint max); |
|
105 |
#else |
|
106 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
107 |
#ifdef RANDOM_DEBUG |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
108 |
#define Random() DoRandom(__LINE__, __FILE__) |
1120
ea3bf8bc6678
(svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents:
1115
diff
changeset
|
109 |
uint32 DoRandom(int line, const char *file); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
110 |
#define RandomRange(max) DoRandomRange(max, __LINE__, __FILE__) |
1120
ea3bf8bc6678
(svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents:
1115
diff
changeset
|
111 |
uint DoRandomRange(uint max, int line, const char *file); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
112 |
#else |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
113 |
uint32 Random(void); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
114 |
uint RandomRange(uint max); |
2073 | 115 |
#endif |
116 |
#endif // MERSENNE_TWISTER |
|
2051 | 117 |
|
2073 | 118 |
static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); } |
119 |
static inline TileIndex RandomTile(void) { return TILE_MASK(Random()); } |
|
120 |
||
121 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
122 |
uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */ |
239 | 123 |
uint InteractiveRandomRange(uint max); |
124 |
||
2091
97197b795fe6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
125 |
|
97197b795fe6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
126 |
// Used for profiling |
2482
dffcca243dbc
(svn r3008) [ 1247535 ] Native Support for Win64 (compile&run only) (michi_cc)
Darkvater
parents:
2475
diff
changeset
|
127 |
#define TIC() { extern uint32 _rdtsc(void); uint32 _xxx_ = _rdtsc(); static float __avg__; |
dffcca243dbc
(svn r3008) [ 1247535 ] Native Support for Win64 (compile&run only) (michi_cc)
Darkvater
parents:
2475
diff
changeset
|
128 |
#define TOC(s) _xxx_ = _rdtsc() - _xxx_; __avg__=__avg__*0.99+_xxx_*0.01; printf("%s: %8d %f\n", s, _xxx_,__avg__); } |
2091
97197b795fe6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
129 |
|
97197b795fe6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
130 |
|
0 | 131 |
void SetDate(uint date); |
132 |
/* facedraw.c */ |
|
133 |
void DrawPlayerFace(uint32 face, int color, int x, int y); |
|
134 |
||
135 |
/* texteff.c */ |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
136 |
void MoveAllTextEffects(void); |
0 | 137 |
void AddTextEffect(StringID msg, int x, int y, uint16 duration); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
138 |
void InitTextEffects(void); |
0 | 139 |
void DrawTextEffects(DrawPixelInfo *dpi); |
140 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
141 |
void InitTextMessage(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
142 |
void DrawTextMessage(void); |
619
2a8675eeeb3f
(svn r1045) -Fix: OpenTTD compiles again under VC6 (sign_de)
truelight
parents:
543
diff
changeset
|
143 |
void CDECL AddTextMessage(uint16 color, uint8 duration, const char *message, ...); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
144 |
void UndrawTextMessage(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
145 |
void TextMessageDailyLoop(void); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
146 |
|
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
147 |
bool AddAnimatedTile(TileIndex tile); |
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
148 |
void DeleteAnimatedTile(TileIndex tile); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
149 |
void AnimateAnimatedTiles(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
150 |
void InitializeAnimatedTiles(void); |
0 | 151 |
|
152 |
/* tunnelbridge_cmd.c */ |
|
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
153 |
bool CheckTunnelInWay(TileIndex tile, int z); |
0 | 154 |
bool CheckBridge_Stuff(byte bridge_type, int bridge_len); |
155 |
uint32 GetBridgeLength(TileIndex begin, TileIndex end); |
|
156 |
int CalcBridgeLenCostFactor(int x); |
|
157 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
158 |
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2); |
0 | 159 |
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd); |
160 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
161 |
/* network.c */ |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
162 |
void NetworkUDPClose(void); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
163 |
void NetworkStartUp(void); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
164 |
void NetworkShutDown(void); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
165 |
void NetworkGameLoop(void); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
166 |
void NetworkUDPGameLoop(void); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
167 |
bool NetworkServerStart(void); |
1329 | 168 |
bool NetworkClientConnectGame(const char* host, unsigned short port); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
169 |
void NetworkReboot(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
170 |
void NetworkDisconnect(void); |
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
171 |
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback); |
0 | 172 |
|
173 |
/* misc_cmd.c */ |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
174 |
void PlaceTreesRandomly(void); |
0 | 175 |
|
176 |
void InitializeLandscapeVariables(bool only_constants); |
|
177 |
||
178 |
/* misc.c */ |
|
179 |
void DeleteName(StringID id); |
|
1328
e069d2db0e4c
(svn r1832) Next byte -> char iteration: custom names
tron
parents:
1317
diff
changeset
|
180 |
char *GetName(int id, char *buff); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
181 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
182 |
// AllocateNameUnique also tests if the name used is not used anywere else |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
183 |
// and if it is used, it returns an error. |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
184 |
#define AllocateNameUnique(name, skip) RealAllocateName(name, skip, true) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
185 |
#define AllocateName(name, skip) RealAllocateName(name, skip, false) |
1328
e069d2db0e4c
(svn r1832) Next byte -> char iteration: custom names
tron
parents:
1317
diff
changeset
|
186 |
StringID RealAllocateName(const char *name, byte skip, bool check_double); |
0 | 187 |
void ConvertDayToYMD(YearMonthDay *ymd, uint16 date); |
188 |
uint ConvertYMDToDay(uint year, uint month, uint day); |
|
189 |
uint ConvertIntDate(uint date); |
|
190 |
||
191 |
/* misc functions */ |
|
192 |
void MarkTileDirty(int x, int y); |
|
193 |
void MarkTileDirtyByTile(TileIndex tile); |
|
194 |
void InvalidateWindow(byte cls, WindowNumber number); |
|
195 |
void InvalidateWindowWidget(byte cls, WindowNumber number, byte widget_index); |
|
196 |
void InvalidateWindowClasses(byte cls); |
|
197 |
void DeleteWindowById(WindowClass cls, WindowNumber number); |
|
999
8b2a34061963
(svn r1497) -Fix: [1101179] Crash if generating land while industry window is open. This also happened for towns and the land information window
darkvater
parents:
998
diff
changeset
|
198 |
void DeleteWindowByClass(WindowClass cls); |
0 | 199 |
|
1914
5ede46fd496f
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Darkvater
parents:
1885
diff
changeset
|
200 |
void SetObjectToPlaceWnd(CursorID icon, byte mode, Window *w); |
5ede46fd496f
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Darkvater
parents:
1885
diff
changeset
|
201 |
void SetObjectToPlace(CursorID icon, byte mode, WindowClass window_class, WindowNumber window_num); |
0 | 202 |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
203 |
void ResetObjectToPlace(void); |
152
c3964b43943e
(svn r153) -Feature: [1009710] Extra Viewport. In the minimap dropdown menu, open a new viewport to have a quick look at your favorite map-positions. Independent zoom and quick jump to/from viewport (Dribbel)
darkvater
parents:
131
diff
changeset
|
204 |
|
c3964b43943e
(svn r153) -Feature: [1009710] Extra Viewport. In the minimap dropdown menu, open a new viewport to have a quick look at your favorite map-positions. Independent zoom and quick jump to/from viewport (Dribbel)
darkvater
parents:
131
diff
changeset
|
205 |
bool ScrollWindowToTile(TileIndex tile, Window * w); |
c3964b43943e
(svn r153) -Feature: [1009710] Extra Viewport. In the minimap dropdown menu, open a new viewport to have a quick look at your favorite map-positions. Independent zoom and quick jump to/from viewport (Dribbel)
darkvater
parents:
131
diff
changeset
|
206 |
bool ScrollWindowTo(int x, int y, Window * w); |
c3964b43943e
(svn r153) -Feature: [1009710] Extra Viewport. In the minimap dropdown menu, open a new viewport to have a quick look at your favorite map-positions. Independent zoom and quick jump to/from viewport (Dribbel)
darkvater
parents:
131
diff
changeset
|
207 |
|
0 | 208 |
bool ScrollMainWindowToTile(TileIndex tile); |
209 |
bool ScrollMainWindowTo(int x, int y); |
|
210 |
void DrawSprite(uint32 img, int x, int y); |
|
1082
56a4c048c5c3
(svn r1583) -Fix: You should no longer be able to delete bridges on any type of underground when there is a vehicle on it
darkvater
parents:
1009
diff
changeset
|
211 |
uint GetCorrectTileHeight(TileIndex tile); |
0 | 212 |
bool EnsureNoVehicle(TileIndex tile); |
213 |
bool EnsureNoVehicleZ(TileIndex tile, byte z); |
|
214 |
void MarkAllViewportsDirty(int left, int top, int right, int bottom); |
|
215 |
void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost); |
|
1935
f43f062c9498
(svn r2441) -Feature: You can now give transfer order to set up feeder systems
celestar
parents:
1914
diff
changeset
|
216 |
void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost); |
0 | 217 |
|
218 |
void DrawFoundation(TileInfo *ti, uint f); |
|
219 |
||
1977
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
220 |
bool CheckIfAuthorityAllows(TileIndex tile); |
4392ae3d8e31
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
221 |
Town *ClosestTownFromTile(TileIndex tile, uint threshold); |
0 | 222 |
void ChangeTownRating(Town *t, int add, int max); |
223 |
||
224 |
uint GetRoadBitsByTile(TileIndex tile); |
|
2471
14109854e818
(svn r2997) -Codechange: Split road drawing code off from DrawTile_Road into a separate function to be used elsewhere.
peter1138
parents:
2436
diff
changeset
|
225 |
void DrawRoadBits(TileInfo *ti, byte road, byte ground_type, bool snow, bool flat); |
2436
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2380
diff
changeset
|
226 |
int GetTownRadiusGroup(const Town *t, TileIndex tile); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
227 |
void ShowNetworkChatQueryWindow(byte desttype, byte dest); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
228 |
void ShowNetworkGiveMoneyWindow(byte player); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
229 |
void ShowNetworkNeedGamePassword(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
230 |
void ShowNetworkNeedCompanyPassword(void); |
0 | 231 |
int FindFirstBit(uint32 x); |
998
d9dc257b8949
(svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents:
988
diff
changeset
|
232 |
void ShowHighscoreTable(int difficulty, int8 rank); |
983
1be852dcdd4c
(svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
darkvater
parents:
873
diff
changeset
|
233 |
void ShowEndGameChart(void); |
0 | 234 |
TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng); |
235 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
236 |
void AfterLoadTown(void); |
1794
44f9deff97ed
(svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents:
1688
diff
changeset
|
237 |
void GenRandomNewGame(uint32 rnd1, uint32 rnd2); |
1796
cae31916ae54
(svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents:
1794
diff
changeset
|
238 |
void StartScenarioEditor(uint32 rnd1, uint32 rnd2); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
239 |
void AskExitGame(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
240 |
void AskExitToGameMenu(void); |
0 | 241 |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
242 |
void RedrawAutosave(void); |
0 | 243 |
|
244 |
StringID RemapOldStringID(StringID s); |
|
245 |
||
246 |
void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str); |
|
247 |
||
248 |
enum { |
|
249 |
SLD_LOAD_GAME = 0, |
|
250 |
SLD_LOAD_SCENARIO = 1, |
|
251 |
SLD_SAVE_GAME = 2, |
|
252 |
SLD_SAVE_SCENARIO = 3, |
|
253 |
SLD_NEW_GAME = 4, |
|
254 |
}; |
|
255 |
void ShowSaveLoadDialog(int mode); |
|
256 |
||
257 |
// callback from drivers that is called if the game size changes dynamically |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
258 |
void GameSizeChanged(void); |
0 | 259 |
bool FileExists(const char *filename); |
260 |
bool ReadLanguagePack(int index); |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
261 |
void InitializeLanguagePacks(void); |
1310
85cde2193afc
(svn r1814) Let ReadFileToMem() return void* (instead of byte*) because we don't know what the caller wants to do with the data
tron
parents:
1309
diff
changeset
|
262 |
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize); |
0 | 263 |
int GetLanguageList(char **languages, int max); |
264 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
265 |
void LoadFromConfig(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
266 |
void SaveToConfig(void); |
1688
787400219027
(svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
Darkvater
parents:
1589
diff
changeset
|
267 |
void CheckConfig(void); |
0 | 268 |
int ttd_main(int argc, char* argv[]); |
269 |
||
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
270 |
void DeterminePaths(void); |
0 | 271 |
|
1217
ab9f02a224ab
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1211
diff
changeset
|
272 |
void bubblesort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); |
2380
3b26659b4a9a
(svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents:
2306
diff
changeset
|
273 |
void CSleep(int milliseconds); |
0 | 274 |
#endif /* FUNCTIONS_H */ |