diff options
author | tron <tron@openttd.org> | 2005-01-28 15:31:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-28 15:31:04 +0000 |
commit | 400f07fdb834dc99aa8a2a4695e20b36e5d23dc4 (patch) | |
tree | efbaeb3426c01178731116a7fca722dc190ac78f /clear_cmd.c | |
parent | 6d410929b6fc96eda09a5060d6665cc5dc800f03 (diff) | |
download | openttd-400f07fdb834dc99aa8a2a4695e20b36e5d23dc4.tar.xz |
(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.
Diffstat (limited to 'clear_cmd.c')
-rw-r--r-- | clear_cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |