30 /* standard */ |
31 /* standard */ |
31 void ShowInfo(const char *str); |
32 void ShowInfo(const char *str); |
32 void CDECL ShowInfoF(const char *str, ...); |
33 void CDECL ShowInfoF(const char *str, ...); |
33 |
34 |
34 /* openttd.cpp */ |
35 /* openttd.cpp */ |
35 |
|
36 /************** |
|
37 * Warning: DO NOT enable this unless you understand what it does |
|
38 * |
|
39 * If enabled, in a network game all randoms will be dumped to the |
|
40 * stdout if the first client joins (or if you are a client). This |
|
41 * is to help finding desync problems. |
|
42 * |
|
43 * Warning: DO NOT enable this unless you understand what it does |
|
44 **************/ |
|
45 |
|
46 //#define RANDOM_DEBUG |
|
47 |
|
48 |
|
49 // Enable this to produce higher quality random numbers. |
|
50 // Doesn't work with network yet. |
|
51 //#define MERSENNE_TWISTER |
|
52 |
|
53 // Mersenne twister functions |
|
54 void SeedMT(uint32 seed); |
|
55 uint32 RandomMT(); |
|
56 |
|
57 |
|
58 #ifdef MERSENNE_TWISTER |
|
59 static inline uint32 Random() { return RandomMT(); } |
|
60 uint RandomRange(uint max); |
|
61 #else |
|
62 |
|
63 #ifdef RANDOM_DEBUG |
|
64 #define Random() DoRandom(__LINE__, __FILE__) |
|
65 uint32 DoRandom(int line, const char *file); |
|
66 #define RandomRange(max) DoRandomRange(max, __LINE__, __FILE__) |
|
67 uint DoRandomRange(uint max, int line, const char *file); |
|
68 #else |
|
69 uint32 Random(); |
|
70 uint RandomRange(uint max); |
|
71 #endif |
|
72 #endif // MERSENNE_TWISTER |
|
73 |
|
74 static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); } |
36 static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); } |
75 static inline TileIndex RandomTile() { return TILE_MASK(Random()); } |
37 static inline TileIndex RandomTile() { return TILE_MASK(Random()); } |
76 |
|
77 |
|
78 uint32 InteractiveRandom(); // Used for random sequences that are not the same on the other end of the multiplayer link |
|
79 uint InteractiveRandomRange(uint max); |
|
80 |
38 |
81 /* texteff.cpp */ |
39 /* texteff.cpp */ |
82 void AddAnimatedTile(TileIndex tile); |
40 void AddAnimatedTile(TileIndex tile); |
83 void DeleteAnimatedTile(TileIndex tile); |
41 void DeleteAnimatedTile(TileIndex tile); |
84 void AnimateAnimatedTiles(); |
42 void AnimateAnimatedTiles(); |