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
commit6013b327f7d54f9d5a331b105011c238da97046f (patch)
tree24c82eee7c186426a35f3ee245d8d753a296d7e2 /functions.h
parent4b006aa6cff4b25f6e9421d3693c2ea51e6b5220 (diff)
downloadopenttd-6013b327f7d54f9d5a331b105011c238da97046f.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);