mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 09:09:09 +00:00
(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.
This commit is contained in:
@@ -90,7 +90,7 @@ static void DoPlaceMoreTrees(uint tile)
|
||||
|
||||
static void PlaceMoreTrees(void)
|
||||
{
|
||||
int i = (Random() & 0x1F) + 25;
|
||||
int i = ScaleByMapSize((Random() & 0x1F) + 25);
|
||||
do {
|
||||
DoPlaceMoreTrees(TILE_MASK(Random()));
|
||||
} while (--i);
|
||||
@@ -102,7 +102,7 @@ void PlaceTreesRandomly(void)
|
||||
uint32 r;
|
||||
uint tile;
|
||||
|
||||
i = 1000;
|
||||
i = ScaleByMapSize(1000);
|
||||
do {
|
||||
r = Random();
|
||||
tile = TILE_MASK(r);
|
||||
@@ -114,7 +114,7 @@ void PlaceTreesRandomly(void)
|
||||
|
||||
/* place extra trees at rainforest area */
|
||||
if (_opt.landscape == LT_DESERT) {
|
||||
i = 15000;
|
||||
i = ScaleByMapSize(15000);
|
||||
|
||||
do {
|
||||
r = Random();
|
||||
|
Reference in New Issue
Block a user