author | tron |
Mon, 25 Jul 2005 07:16:10 +0000 | |
changeset 2189 | 5cdc11ffeaa4 |
parent 2186 | db48cf29b983 |
child 2210 | b76184e0929c |
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
83e74e76f600
(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
bac29165710f
(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); |
bac29165710f
(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
4fdc46eaf423
(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
bac29165710f
(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); |
bac29165710f
(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); |
bac29165710f
(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); |
bac29165710f
(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); |
bac29165710f
(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); |
bac29165710f
(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
7ab329d1fc28
(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
bac29165710f
(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
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
35 |
Point pt; |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
36 |
pt.x = (y - x) * 2; |
4c9177888196
(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
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
39 |
Point pt; |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
738
diff
changeset
|
40 |
pt.x = (x + y) * 2; |
4c9177888196
(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 */ |
|
53 |
void DrawHillyLandTile(TileInfo *ti); |
|
54 |
void DrawClearLandTile(TileInfo *ti, byte set); |
|
55 |
void DrawClearLandFence(TileInfo *ti, byte img); |
|
1420
83e74e76f600
(svn r1924) Use same type names in declaration and implementation
tron
parents:
1377
diff
changeset
|
56 |
void TileLoopClearHelper(TileIndex tile); |
0 | 57 |
|
58 |
/* station_land.c */ |
|
59 |
void StationPickerDrawSprite(int x, int y, int railtype, int image); |
|
60 |
||
61 |
/* track_land.c */ |
|
62 |
void DrawTrainDepotSprite(int x, int y, int image, int railtype); |
|
63 |
||
64 |
/* road_land.c */ |
|
65 |
void DrawRoadDepotSprite(int x, int y, int image); |
|
66 |
||
67 |
/* water_land.c */ |
|
68 |
void DrawShipDepotSprite(int x, int y, int image); |
|
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
69 |
void TileLoop_Water(TileIndex tile); |
0 | 70 |
|
71 |
/* players.c */ |
|
72 |
bool CheckPlayerHasMoney(int32 cost); |
|
73 |
void SubtractMoneyFromPlayer(int32 cost); |
|
74 |
void SubtractMoneyFromPlayerFract(byte player, int32 cost); |
|
75 |
bool CheckOwnership(byte owner); |
|
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
76 |
bool CheckTileOwnership(TileIndex tile); |
2
104b2984cd3e
(svn r3) -[1005611] Player Window patch: When looking in dropdownlist for player stuff, it will say
darkvater
parents:
1
diff
changeset
|
77 |
StringID GetPlayerNameString(byte player, byte index); |
0 | 78 |
|
79 |
/* standard */ |
|
80 |
void ShowInfo(const char *str); |
|
81 |
void CDECL ShowInfoF(const char *str, ...); |
|
82 |
void NORETURN CDECL error(const char *str, ...); |
|
83 |
||
2075
21d2986569d1
(svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents:
2073
diff
changeset
|
84 |
/* openttd.c */ |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
85 |
|
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
86 |
// ************** |
946badd71033
(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 |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
88 |
// * |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
89 |
// * If enabled, in a network game all randoms will be dumped to the |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
90 |
// * stdout if the first client joins (or if you are a client). This |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
91 |
// * is to help finding desync problems. |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
92 |
// * |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
93 |
// * Warning: DO NOT enable this unless you understand what it does |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
94 |
// ************** |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
95 |
|
1539
b3fce185178a
(svn r2043) -Fix: committed too many files in the last commit
truelight
parents:
1538
diff
changeset
|
96 |
//#define RANDOM_DEBUG |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
97 |
|
2073 | 98 |
|
99 |
// Enable this to produce higher quality random numbers. |
|
100 |
// Doesn't work with network yet. |
|
101 |
//#define MERSENNE_TWISTER |
|
102 |
||
103 |
// Mersenne twister functions |
|
104 |
void SeedMT(uint32 seed); |
|
105 |
uint32 RandomMT(void); |
|
106 |
||
107 |
||
108 |
#ifdef MERSENNE_TWISTER |
|
109 |
static inline uint32 Random(void) { return RandomMT(); } |
|
110 |
uint RandomRange(uint max); |
|
111 |
#else |
|
112 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
113 |
#ifdef RANDOM_DEBUG |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
114 |
#define Random() DoRandom(__LINE__, __FILE__) |
1120
047e8b16a954
(svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents:
1115
diff
changeset
|
115 |
uint32 DoRandom(int line, const char *file); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
116 |
#define RandomRange(max) DoRandomRange(max, __LINE__, __FILE__) |
1120
047e8b16a954
(svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents:
1115
diff
changeset
|
117 |
uint DoRandomRange(uint max, int line, const char *file); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
118 |
#else |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
119 |
uint32 Random(void); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
120 |
uint RandomRange(uint max); |
2073 | 121 |
#endif |
122 |
#endif // MERSENNE_TWISTER |
|
2051 | 123 |
|
2073 | 124 |
static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); } |
125 |
static inline TileIndex RandomTile(void) { return TILE_MASK(Random()); } |
|
126 |
||
127 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
128 |
uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */ |
239 | 129 |
uint InteractiveRandomRange(uint max); |
130 |
||
2091
d28dc7eb23f6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
131 |
|
d28dc7eb23f6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
132 |
// Used for profiling |
2125
edc17858f9f6
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
ludde
parents:
2091
diff
changeset
|
133 |
#define TIC() { extern uint32 rdtsc(void); uint32 _xxx_ = rdtsc(); static float __avg__; |
edc17858f9f6
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
ludde
parents:
2091
diff
changeset
|
134 |
#define TOC(s) _xxx_ = rdtsc() - _xxx_; __avg__=__avg__*0.99+_xxx_*0.01; printf("%s: %8d %f\n", s, _xxx_,__avg__); } |
2091
d28dc7eb23f6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
135 |
|
d28dc7eb23f6
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
ludde
parents:
2078
diff
changeset
|
136 |
|
0 | 137 |
void SetDate(uint date); |
138 |
/* facedraw.c */ |
|
139 |
void DrawPlayerFace(uint32 face, int color, int x, int y); |
|
140 |
||
141 |
/* texteff.c */ |
|
1093
4fdc46eaf423
(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 MoveAllTextEffects(void); |
0 | 143 |
void AddTextEffect(StringID msg, int x, int y, uint16 duration); |
1093
4fdc46eaf423
(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 InitTextEffects(void); |
0 | 145 |
void DrawTextEffects(DrawPixelInfo *dpi); |
146 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
147 |
void InitTextMessage(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
148 |
void DrawTextMessage(void); |
619
abab6c8f1af7
(svn r1045) -Fix: OpenTTD compiles again under VC6 (sign_de)
truelight
parents:
543
diff
changeset
|
149 |
void CDECL AddTextMessage(uint16 color, uint8 duration, const char *message, ...); |
1093
4fdc46eaf423
(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 UndrawTextMessage(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
151 |
void TextMessageDailyLoop(void); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
152 |
|
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
153 |
bool AddAnimatedTile(TileIndex tile); |
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
154 |
void DeleteAnimatedTile(TileIndex tile); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
155 |
void AnimateAnimatedTiles(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
156 |
void InitializeAnimatedTiles(void); |
0 | 157 |
|
158 |
/* tunnelbridge_cmd.c */ |
|
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
159 |
bool CheckTunnelInWay(TileIndex tile, int z); |
0 | 160 |
bool CheckBridge_Stuff(byte bridge_type, int bridge_len); |
161 |
uint32 GetBridgeLength(TileIndex begin, TileIndex end); |
|
162 |
int CalcBridgeLenCostFactor(int x); |
|
163 |
||
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
164 |
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2); |
0 | 165 |
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd); |
166 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
167 |
/* network.c */ |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
168 |
void NetworkUDPClose(void); |
1093
4fdc46eaf423
(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 NetworkStartUp(void); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
170 |
void NetworkShutDown(void); |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
171 |
void NetworkGameLoop(void); |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
172 |
void NetworkUDPGameLoop(void); |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
173 |
bool NetworkServerStart(void); |
1329 | 174 |
bool NetworkClientConnectGame(const char* host, unsigned short port); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
175 |
void NetworkReboot(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
176 |
void NetworkDisconnect(void); |
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
177 |
void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback); |
0 | 178 |
|
179 |
/* misc_cmd.c */ |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
180 |
void PlaceTreesRandomly(void); |
0 | 181 |
|
182 |
void InitializeLandscapeVariables(bool only_constants); |
|
183 |
||
184 |
/* misc.c */ |
|
185 |
void DeleteName(StringID id); |
|
1328
eacd8225ed42
(svn r1832) Next byte -> char iteration: custom names
tron
parents:
1317
diff
changeset
|
186 |
char *GetName(int id, char *buff); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
187 |
|
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
188 |
// AllocateNameUnique also tests if the name used is not used anywere else |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
189 |
// and if it is used, it returns an error. |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
190 |
#define AllocateNameUnique(name, skip) RealAllocateName(name, skip, true) |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
191 |
#define AllocateName(name, skip) RealAllocateName(name, skip, false) |
1328
eacd8225ed42
(svn r1832) Next byte -> char iteration: custom names
tron
parents:
1317
diff
changeset
|
192 |
StringID RealAllocateName(const char *name, byte skip, bool check_double); |
0 | 193 |
void ConvertDayToYMD(YearMonthDay *ymd, uint16 date); |
194 |
uint ConvertYMDToDay(uint year, uint month, uint day); |
|
195 |
uint ConvertIntDate(uint date); |
|
196 |
||
197 |
/* misc functions */ |
|
198 |
void MarkTileDirty(int x, int y); |
|
199 |
void MarkTileDirtyByTile(TileIndex tile); |
|
200 |
void InvalidateWindow(byte cls, WindowNumber number); |
|
201 |
void InvalidateWindowWidget(byte cls, WindowNumber number, byte widget_index); |
|
202 |
void InvalidateWindowClasses(byte cls); |
|
203 |
void DeleteWindowById(WindowClass cls, WindowNumber number); |
|
999
647f65adeb9e
(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
|
204 |
void DeleteWindowByClass(WindowClass cls); |
0 | 205 |
|
1914
2b4b3c3a95b4
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Darkvater
parents:
1885
diff
changeset
|
206 |
void SetObjectToPlaceWnd(CursorID icon, byte mode, Window *w); |
2b4b3c3a95b4
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Darkvater
parents:
1885
diff
changeset
|
207 |
void SetObjectToPlace(CursorID icon, byte mode, WindowClass window_class, WindowNumber window_num); |
0 | 208 |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
209 |
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
|
210 |
|
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
|
211 |
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
|
212 |
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
|
213 |
|
0 | 214 |
bool ScrollMainWindowToTile(TileIndex tile); |
215 |
bool ScrollMainWindowTo(int x, int y); |
|
216 |
void DrawSprite(uint32 img, int x, int y); |
|
1082
a83d7ac6fecb
(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
|
217 |
uint GetCorrectTileHeight(TileIndex tile); |
0 | 218 |
bool EnsureNoVehicle(TileIndex tile); |
219 |
bool EnsureNoVehicleZ(TileIndex tile, byte z); |
|
220 |
void MarkAllViewportsDirty(int left, int top, int right, int bottom); |
|
221 |
void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost); |
|
1935
164d58b9137c
(svn r2441) -Feature: You can now give transfer order to set up feeder systems
celestar
parents:
1914
diff
changeset
|
222 |
void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost); |
0 | 223 |
|
224 |
void DrawFoundation(TileInfo *ti, uint f); |
|
225 |
||
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
226 |
bool CheckIfAuthorityAllows(TileIndex tile); |
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
227 |
Town *ClosestTownFromTile(TileIndex tile, uint threshold); |
0 | 228 |
void ChangeTownRating(Town *t, int add, int max); |
229 |
||
230 |
uint GetRoadBitsByTile(TileIndex tile); |
|
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1935
diff
changeset
|
231 |
int GetTownRadiusGroup(Town *t, TileIndex tile); |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
232 |
void ShowNetworkChatQueryWindow(byte desttype, byte dest); |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
233 |
void ShowNetworkGiveMoneyWindow(byte player); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
234 |
void ShowNetworkNeedGamePassword(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
235 |
void ShowNetworkNeedCompanyPassword(void); |
0 | 236 |
int FindFirstBit(uint32 x); |
998
c90459c24842
(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
|
237 |
void ShowHighscoreTable(int difficulty, int8 rank); |
983
4765bf636f6b
(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
|
238 |
void ShowEndGameChart(void); |
0 | 239 |
TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng); |
240 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
241 |
void AfterLoadTown(void); |
1794
24b4239f2090
(svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents:
1688
diff
changeset
|
242 |
void GenRandomNewGame(uint32 rnd1, uint32 rnd2); |
1796
614d996f6be7
(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
|
243 |
void StartScenarioEditor(uint32 rnd1, uint32 rnd2); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
244 |
void AskExitGame(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
245 |
void AskExitToGameMenu(void); |
0 | 246 |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
247 |
void RedrawAutosave(void); |
0 | 248 |
|
249 |
StringID RemapOldStringID(StringID s); |
|
250 |
||
251 |
void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str); |
|
252 |
||
253 |
enum { |
|
254 |
SLD_LOAD_GAME = 0, |
|
255 |
SLD_LOAD_SCENARIO = 1, |
|
256 |
SLD_SAVE_GAME = 2, |
|
257 |
SLD_SAVE_SCENARIO = 3, |
|
258 |
SLD_NEW_GAME = 4, |
|
259 |
}; |
|
260 |
void ShowSaveLoadDialog(int mode); |
|
261 |
||
262 |
// callback from drivers that is called if the game size changes dynamically |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
263 |
void GameSizeChanged(void); |
0 | 264 |
bool FileExists(const char *filename); |
265 |
bool ReadLanguagePack(int index); |
|
1093
4fdc46eaf423
(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 InitializeLanguagePacks(void); |
1310
99c921090356
(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
|
267 |
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize); |
0 | 268 |
int GetLanguageList(char **languages, int max); |
269 |
||
1093
4fdc46eaf423
(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 CheckSwitchToEuro(void); |
0 | 271 |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
272 |
void LoadFromConfig(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
273 |
void SaveToConfig(void); |
1688
af2bb9bcb2ed
(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
|
274 |
void CheckConfig(void); |
0 | 275 |
int ttd_main(int argc, char* argv[]); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
276 |
byte GetOSVersion(void); |
0 | 277 |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1082
diff
changeset
|
278 |
void DeterminePaths(void); |
0 | 279 |
char * CDECL str_fmt(const char *str, ...); |
280 |
||
1217
59c024cfaf54
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1211
diff
changeset
|
281 |
void bubblesort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); |
1885
aef601001f5e
(svn r2391) - Feature: saving games happen in a seperate thread so you no longer will have to wait such a long time (especially handy on bigger maps and multiplayer games). The mouse also changes into the 'ZZZ' state :P. The thread on windows is currently given a little-bit-less-than-normal priority so it should not interfere that much with the gameplay; it will take a bit longer though. Upon the exit of the game any pending saves are waited upon.
Darkvater
parents:
1812
diff
changeset
|
282 |
bool CreateOTTDThread(void *func, void *param); |
aef601001f5e
(svn r2391) - Feature: saving games happen in a seperate thread so you no longer will have to wait such a long time (especially handy on bigger maps and multiplayer games). The mouse also changes into the 'ZZZ' state :P. The thread on windows is currently given a little-bit-less-than-normal priority so it should not interfere that much with the gameplay; it will take a bit longer though. Upon the exit of the game any pending saves are waited upon.
Darkvater
parents:
1812
diff
changeset
|
283 |
void CloseOTTDThread(void); |
aef601001f5e
(svn r2391) - Feature: saving games happen in a seperate thread so you no longer will have to wait such a long time (especially handy on bigger maps and multiplayer games). The mouse also changes into the 'ZZZ' state :P. The thread on windows is currently given a little-bit-less-than-normal priority so it should not interfere that much with the gameplay; it will take a bit longer though. Upon the exit of the game any pending saves are waited upon.
Darkvater
parents:
1812
diff
changeset
|
284 |
void JoinOTTDThread(void); |
0 | 285 |
#endif /* FUNCTIONS_H */ |