summaryrefslogtreecommitdiff
path: root/landscape.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-28 15:31:04 +0000
committertron <tron@openttd.org>2005-01-28 15:31:04 +0000
commit3617d243189ec7076bec045d04e4a96ff55a8de8 (patch)
treeefbaeb3426c01178731116a7fca722dc190ac78f /landscape.c
parent4e6d6578e4e4d17712acff4b0c1f749f405a815d (diff)
downloadopenttd-3617d243189ec7076bec045d04e4a96ff55a8de8.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 'landscape.c')
-rw-r--r--landscape.c12
1 files changed, 6 insertions, 6 deletions
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);