(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:
tron
2005-01-28 15:31:04 +00:00
parent 4e6d6578e4
commit 3617d24318
9 changed files with 45 additions and 18 deletions

View File

@@ -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);