From 400f07fdb834dc99aa8a2a4695e20b36e5d23dc4 Mon Sep 17 00:00:00 2001 From: tron Date: Fri, 28 Jan 2005 15:31:04 +0000 Subject: (svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D() These scale a number relative to the map size/circumference. Use them to scale the amount of map objects. Of course at the moment they return just the input, because there are no bigger/smaller maps yet. --- clear_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clear_cmd.c') diff --git a/clear_cmd.c b/clear_cmd.c index 27942bcb6..a3095646b 100644 --- a/clear_cmd.c +++ b/clear_cmd.c @@ -740,7 +740,7 @@ void GenerateClearTile(void) uint32 r; /* add hills */ - i = (Random() & 0x3FF) | 0x400; + i = ScaleByMapSize((Random() & 0x3FF) + 0x400); do { tile = TILE_MASK(Random()); if (IsTileType(tile, MP_CLEAR)) @@ -748,7 +748,7 @@ void GenerateClearTile(void) } while (--i); /* add grey squares */ - i = (Random() & 0x7F) | 0x80; + i = ScaleByMapSize((Random() & 0x7F) + 0x80); do { r = Random(); tile = TILE_MASK(r); -- cgit v1.2.3-54-g00ecf