src/functions.h
author rubidium
Fri, 05 Oct 2007 21:49:15 +0000
changeset 7681 582e8912e8d1
parent 7545 d44e19c5671e
child 7694 3c4a0b7894cd
permissions -rw-r--r--
(svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2162
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2162
diff changeset
     2
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
     3
/** @file functions.h */
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
     4
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#ifndef FUNCTIONS_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
#define FUNCTIONS_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
5636
3c19b56dc982 (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5587
diff changeset
     8
#include "gfx.h"
3c19b56dc982 (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5587
diff changeset
     9
1377
7ab329d1fc28 (svn r1881) -Fix: [ 1119308 ] Max passengers / mail variables are now 32 bit
celestar
parents: 1335
diff changeset
    10
void UpdateTownMaxPass(Town *t);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    12
/* clear_land.cpp */
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2380
diff changeset
    13
void DrawHillyLandTile(const TileInfo *ti);
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2380
diff changeset
    14
void DrawClearLandTile(const TileInfo *ti, byte set);
2220
cacd492f3c1c (svn r2738) Small bit fiddling cleanup
tron
parents: 2210
diff changeset
    15
void DrawClearLandFence(const TileInfo *ti);
1420
83e74e76f600 (svn r1924) Use same type names in declaration and implementation
tron
parents: 1377
diff changeset
    16
void TileLoopClearHelper(TileIndex tile);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    18
/* water_land.cpp */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
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
    20
void TileLoop_Water(TileIndex tile);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    22
/* players.cpp */
6943
1914f26aee04 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate.
rubidium
parents: 6879
diff changeset
    23
bool CheckPlayerHasMoney(CommandCost cost);
1914f26aee04 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate.
rubidium
parents: 6879
diff changeset
    24
void SubtractMoneyFromPlayer(CommandCost cost);
1914f26aee04 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate.
rubidium
parents: 6879
diff changeset
    25
void SubtractMoneyFromPlayerFract(PlayerID player, CommandCost cost);
4849
1c6f21eb97f2 (svn r6775) -Codechange: Use some more proper types, especially Owner and PlayerID as
Darkvater
parents: 4833
diff changeset
    26
bool CheckOwnership(Owner owner);
1977
37bbebf94434 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1935
diff changeset
    27
bool CheckTileOwnership(TileIndex tile);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    28
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    29
/* standard */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
void ShowInfo(const char *str);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    31
void CDECL ShowInfoF(const char *str, ...);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    32
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    33
/* openttd.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    34
4432
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    35
/**************
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    36
 * Warning: DO NOT enable this unless you understand what it does
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    37
 *
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    38
 * If enabled, in a network game all randoms will be dumped to the
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    39
 *  stdout if the first client joins (or if you are a client). This
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    40
 *  is to help finding desync problems.
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    41
 *
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    42
 * Warning: DO NOT enable this unless you understand what it does
372316ca7924 (svn r6195) -Codechange: do not use '//' in '/* ... */' style comments and '/*' or '*/' in '//' style comments.
rubidium
parents: 4300
diff changeset
    43
 **************/
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    44
1539
b3fce185178a (svn r2043) -Fix: committed too many files in the last commit
truelight
parents: 1538
diff changeset
    45
//#define RANDOM_DEBUG
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    46
2073
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    47
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    48
// Enable this to produce higher quality random numbers.
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    49
// Doesn't work with network yet.
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    50
//#define MERSENNE_TWISTER
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    51
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    52
// Mersenne twister functions
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    53
void SeedMT(uint32 seed);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    54
uint32 RandomMT();
2073
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    55
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    56
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    57
#ifdef MERSENNE_TWISTER
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    58
	static inline uint32 Random() { return RandomMT(); }
2073
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    59
	uint RandomRange(uint max);
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    60
#else
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    61
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    62
#ifdef RANDOM_DEBUG
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    63
	#define Random() DoRandom(__LINE__, __FILE__)
1120
047e8b16a954 (svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents: 1115
diff changeset
    64
	uint32 DoRandom(int line, const char *file);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    65
	#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
    66
	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
    67
#else
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    68
	uint32 Random();
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
    69
	uint RandomRange(uint max);
2073
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    70
#endif
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    71
#endif // MERSENNE_TWISTER
2051
e369160ce2f3 (svn r2560) Fix: various minor code changes.
ludde
parents: 1977
diff changeset
    72
2073
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    73
static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); }
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    74
static inline TileIndex RandomTile() { return TILE_MASK(Random()); }
2073
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    75
2d63300e4a44 (svn r2583) Move OS specific code out of misc.c
ludde
parents: 2051
diff changeset
    76
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    77
uint32 InteractiveRandom(); // Used for random sequences that are not the same on the other end of the multiplayer link
239
23958632a582 (svn r240) -Fix: desync on subsidy generation
signde
parents: 223
diff changeset
    78
uint InteractiveRandomRange(uint max);
23958632a582 (svn r240) -Fix: desync on subsidy generation
signde
parents: 223
diff changeset
    79
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    80
/* texteff.cpp */
1977
37bbebf94434 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1935
diff changeset
    81
bool AddAnimatedTile(TileIndex tile);
37bbebf94434 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1935
diff changeset
    82
void DeleteAnimatedTile(TileIndex tile);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    83
void AnimateAnimatedTiles();
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    84
void InitializeAnimatedTiles();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    85
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    86
/* tunnelbridge_cmd.cpp */
2639
eeaefdabfdfd (svn r3181) -Bracing
tron
parents: 2520
diff changeset
    87
bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    88
uint32 GetBridgeLength(TileIndex begin, TileIndex end);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    89
int CalcBridgeLenCostFactor(int x);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    90
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    91
/* misc_cmd.cpp */
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
    92
void PlaceTreesRandomly();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    93
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    94
void InitializeLandscapeVariables(bool only_constants);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    95
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
    96
/* misc.cpp */
4862
ac034ec9ed2b (svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents: 4849
diff changeset
    97
bool IsCustomName(StringID id);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    98
void DeleteName(StringID id);
7318
632cd0497770 (svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
rubidium
parents: 7097
diff changeset
    99
char *GetName(char *buff, StringID id, const char *last);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
   100
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 536
diff changeset
   101
#define AllocateName(name, skip) RealAllocateName(name, skip, false)
1328
eacd8225ed42 (svn r1832) Next byte -> char iteration: custom names
tron
parents: 1317
diff changeset
   102
StringID RealAllocateName(const char *name, byte skip, bool check_double);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   103
void ConvertNameArray();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
/* misc functions */
7545
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   106
/**
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   107
 * Mark a tile given by its coordinate dirty for repaint.
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   108
 *
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   109
 * @ingroup dirty
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   110
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
void MarkTileDirty(int x, int y);
7545
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   112
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   113
/**
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   114
 * Mark a tile given by its index dirty for repaint.
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   115
 *
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   116
 * @ingroup dirty
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   117
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
void MarkTileDirtyByTile(TileIndex tile);
2788
0187c588107e (svn r3336) byte -> WindowClass, uint16 -> WindowNumber
tron
parents: 2639
diff changeset
   119
void InvalidateWindow(WindowClass cls, WindowNumber number);
0187c588107e (svn r3336) byte -> WindowClass, uint16 -> WindowNumber
tron
parents: 2639
diff changeset
   120
void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index);
0187c588107e (svn r3336) byte -> WindowClass, uint16 -> WindowNumber
tron
parents: 2639
diff changeset
   121
void InvalidateWindowClasses(WindowClass cls);
4766
aa276d0ec2eb (svn r6680) -Codechange r6679: [train build window] only generate the list when the window data is invalidated or the window is generated, not on each redraw
bjarni
parents: 4548
diff changeset
   122
void InvalidateWindowClassesData(WindowClass cls);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   123
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
   124
void DeleteWindowByClass(WindowClass cls);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   125
5668
36b39f4a9032 (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents: 5636
diff changeset
   126
void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, byte mode, Window *w);
36b39f4a9032 (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents: 5636
diff changeset
   127
void SetObjectToPlace(CursorID icon, SpriteID pal, byte mode, WindowClass window_class, WindowNumber window_num);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   129
void ResetObjectToPlace();
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
   130
7318
632cd0497770 (svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
rubidium
parents: 7097
diff changeset
   131
bool ScrollWindowTo(int x, int y, Window *w, bool instant = false);
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
   132
6730
9311a208f8f7 (svn r9962) -Feature: Add smooth viewport scrolling. This must be enabled with patch setting 'smooth_scroll'
peter1138
parents: 6622
diff changeset
   133
bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
9311a208f8f7 (svn r9962) -Feature: Add smooth viewport scrolling. This must be enabled with patch setting 'smooth_scroll'
peter1138
parents: 6622
diff changeset
   134
bool ScrollMainWindowTo(int x, int y, bool instant = false);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
bool EnsureNoVehicle(TileIndex tile);
3794
f72053a38797 (svn r4790) Remove slope magic from EnsureNoVehicleZ() and rename it to EnsureNoVehicleOnGround() to make more clear what it does
tron
parents: 3636
diff changeset
   136
bool EnsureNoVehicleOnGround(TileIndex tile);
7545
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   137
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   138
/**
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   139
 * Mark all viewports dirty for repaint.
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   140
 *
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   141
 * @ingroup dirty
d44e19c5671e (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 7516
diff changeset
   142
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   143
void MarkAllViewportsDirty(int left, int top, int right, int bottom);
6990
136a08baf0ed (svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.
rubidium
parents: 6943
diff changeset
   144
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost);
136a08baf0ed (svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch.
rubidium
parents: 6943
diff changeset
   145
void ShowFeederIncomeAnimation(int x, int y, int z, Money cost);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
1977
37bbebf94434 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1935
diff changeset
   147
bool CheckIfAuthorityAllows(TileIndex tile);
37bbebf94434 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1935
diff changeset
   148
Town *ClosestTownFromTile(TileIndex tile, uint threshold);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   149
void ChangeTownRating(Town *t, int add, int max);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   150
4000
4009d092b306 (svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents: 3794
diff changeset
   151
uint GetTownRadiusGroup(const Town* t, TileIndex tile);
6879
6f2927f456d7 (svn r10122) -Codechange: Add a CountBitsSet function and use it to replace some less efficient loops.
maedhros
parents: 6730
diff changeset
   152
void ShowHighscoreTable(int difficulty, int8 rank);
6f2927f456d7 (svn r10122) -Codechange: Add a CountBitsSet function and use it to replace some less efficient loops.
maedhros
parents: 6730
diff changeset
   153
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   154
int FindFirstBit(uint32 x);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   155
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   156
void AfterLoadTown();
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   157
void UpdatePatches();
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   158
void AskExitGame();
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   159
void AskExitToGameMenu();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   160
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   161
void RedrawAutosave();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   162
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   163
StringID RemapOldStringID(StringID s);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   164
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   165
void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   166
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
enum {
4300
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4261
diff changeset
   168
	SLD_LOAD_GAME,
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4261
diff changeset
   169
	SLD_LOAD_SCENARIO,
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4261
diff changeset
   170
	SLD_SAVE_GAME,
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4261
diff changeset
   171
	SLD_SAVE_SCENARIO,
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4261
diff changeset
   172
	SLD_LOAD_HEIGHTMAP,
c7e43c47a2b9 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4261
diff changeset
   173
	SLD_NEW_GAME,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   174
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
void ShowSaveLoadDialog(int mode);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
6179
d19b0137d8e4 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5668
diff changeset
   177
/* callback from drivers that is called if the game size changes dynamically */
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   178
void GameSizeChanged();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   179
bool FileExists(const char *filename);
3329
9885789ecaf7 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3297
diff changeset
   180
const char *GetCurrentLocale(const char *param);
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
   181
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   182
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   183
void LoadFromConfig();
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   184
void SaveToConfig();
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   185
void CheckConfig();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   186
int ttd_main(int argc, char* argv[]);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6190
diff changeset
   187
void HandleExitGameRequest();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   189
#endif /* FUNCTIONS_H */