From 3617d243189ec7076bec045d04e4a96ff55a8de8 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. --- landscape.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'landscape.c') diff --git a/landscape.c b/landscape.c index 18e51ebd6..ef9984692 100644 --- a/landscape.c +++ b/landscape.c @@ -656,38 +656,38 @@ void GenerateLandscape(void) uint32 r; if (_opt.landscape == LT_HILLY) { - i = ((Random() & 0x7F) + 950) * LANDSCAPE_SIZE_FACTOR; + i = ScaleByMapSize((Random() & 0x7F) + 950); do { GenerateTerrain(2, 0); } while (--i); r = Random(); flag = (r & 3) | 4; - i = (((r >> 16) & 0x7F) + 450) * LANDSCAPE_SIZE_FACTOR; + i = ScaleByMapSize(((r >> 16) & 0x7F) + 450); do { GenerateTerrain(4, flag); } while (--i); } else if (_opt.landscape == LT_DESERT) { - i = ((Random()&0x7F) + 170) * LANDSCAPE_SIZE_FACTOR; + i = ScaleByMapSize((Random()&0x7F) + 170); do { GenerateTerrain(0, 0); } while (--i); r = Random(); flag = (r & 3) | 4; - i = (((r >> 16) & 0xFF) + 1700) * LANDSCAPE_SIZE_FACTOR; + i = ScaleByMapSize(((r >> 16) & 0xFF) + 1700); do { GenerateTerrain(0, flag); } while (--i); flag ^= 2; - i = ((Random() & 0x7F) + 410) * LANDSCAPE_SIZE_FACTOR; + i = ScaleByMapSize((Random() & 0x7F) + 410); do { GenerateTerrain(3, flag); } while (--i); } else { - i = ((Random() & 0x7F) + (3 - _opt.diff.quantity_sea_lakes)*256 + 100) * LANDSCAPE_SIZE_FACTOR; + i = ScaleByMapSize((Random() & 0x7F) + (3 - _opt.diff.quantity_sea_lakes) * 256 + 100); do { GenerateTerrain(_opt.diff.terrain_type, 0); } while (--i); -- cgit v1.2.3-54-g00ecf