From 6013b327f7d54f9d5a331b105011c238da97046f Mon Sep 17 00:00:00 2001 From: ludde Date: Wed, 13 Jul 2005 19:51:31 +0000 Subject: (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. --- functions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'functions.h') 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); -- cgit v1.2.3-70-g09d2