summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-02-09 15:00:30 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-02-09 15:00:30 +0000
commite4c7c8876b787b2f9d6e9db9628cafa7688b845e (patch)
tree85ccce31b2fa807afbf4c2166936f22fefca64a0 /src
parent77e62f0b986ebe254f1b0c431674f1da9e94e5e5 (diff)
downloadopenttd-e4c7c8876b787b2f9d6e9db9628cafa7688b845e.tar.xz
(svn r26323) -Fix: update some constants related to map size.
Diffstat (limited to 'src')
-rw-r--r--src/landscape.cpp7
-rw-r--r--src/table/settings.ini4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 4dda8fc11..a19c98db9 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -721,12 +721,13 @@ void RunTileLoop()
* shift register (LFSR). This allows a deterministic pseudorandom ordering, but
* still with minimal state and fast iteration. */
- /* Maximal length LFSR feedback terms, from 12-bit (for 64x64 maps) to 22-bit (for 2048x2048 maps).
+ /* Maximal length LFSR feedback terms, from 12-bit (for 64x64 maps) to 24-bit (for 4096x4096 maps).
* Extracted from http://www.ece.cmu.edu/~koopman/lfsr/ */
static const uint32 feedbacks[] = {
- 0xD8F, 0x1296, 0x2496, 0x4357, 0x8679, 0x1030E, 0x206CD, 0x403FE, 0x807B8, 0x1004B2, 0x2006A8
+ 0xD8F, 0x1296, 0x2496, 0x4357, 0x8679, 0x1030E, 0x206CD, 0x403FE, 0x807B8, 0x1004B2, 0x2006A8, 0x4004B2, 0x800B87
};
- const uint32 feedback = feedbacks[MapLogX() + MapLogY() - 12];
+ assert_compile(lengthof(feedbacks) == 2 * MAX_MAP_SIZE_BITS - 2 * MIN_MAP_SIZE_BITS + 1);
+ const uint32 feedback = feedbacks[MapLogX() + MapLogY() - 2 * MIN_MAP_SIZE_BITS];
/* We update every tile every 256 ticks, so divide the map size by 2^8 = 256 */
uint count = 1 << (MapLogX() + MapLogY() - 8);
diff --git a/src/table/settings.ini b/src/table/settings.ini
index 0b723a0ae..7c55ae9ef 100644
--- a/src/table/settings.ini
+++ b/src/table/settings.ini
@@ -480,7 +480,7 @@ from = 159
guiflags = SGF_NO_NETWORK
def = 64
min = 1
-max = 2048
+max = MAX_MAP_SIZE
interval = 1
str = STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH
strhelp = STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH_HELPTEXT
@@ -494,7 +494,7 @@ from = 159
guiflags = SGF_NO_NETWORK
def = 64
min = 1
-max = 2048
+max = MAX_MAP_SIZE
interval = 1
str = STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH
strhelp = STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH_HELPTEXT