summaryrefslogtreecommitdiff
path: root/functions.h
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-13 19:51:31 +0000
committerludde <ludde@openttd.org>2005-07-13 19:51:31 +0000
commit2123deff13b3f23352ef82410e76705f9911c184 (patch)
tree24c82eee7c186426a35f3ee245d8d753a296d7e2 /functions.h
parentca9d0f984143f034725dce098e4a40e3589ed0f4 (diff)
downloadopenttd-2123deff13b3f23352ef82410e76705f9911c184.tar.xz
(svn r2560) Fix: various minor code changes.
Added RandomTile/RandomTileSeed functions to generate a random tile. Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though) Changed some frequently used map macros to not compute the values each time. Silence some warnings on MSVC.
Diffstat (limited to 'functions.h')
-rw-r--r--functions.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/functions.h b/functions.h
index a34525f28..4960eb338 100644
--- a/functions.h
+++ b/functions.h
@@ -101,6 +101,9 @@ void NORETURN CDECL error(const char *str, ...);
#else
uint32 Random(void);
uint RandomRange(uint max);
+
+ static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); }
+ static inline TileIndex RandomTile(void) { return TILE_MASK(Random()); }
#endif
void InitPlayerRandoms(void);