summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-29 20:11:19 +0000
committertron <tron@openttd.org>2005-01-29 20:11:19 +0000
commitb29877e14c71b4e2b8244397bff39ea107050024 (patch)
tree03caa313743ebae96c38123095c8be9f3e7b607b /misc.c
parent3a89108a55b6ee45550ed8b5e01434b51c2f6995 (diff)
downloadopenttd-b29877e14c71b4e2b8244397bff39ea107050024.tar.xz
(svn r1723) Save the map size in tiles, not number of bits
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 43415a208..d8bd83b3f 100644
--- a/misc.c
+++ b/misc.c
@@ -871,15 +871,22 @@ static const SaveLoadGlobVarList _map_dimensions[] = {
static void Save_MAPSIZE(void)
{
- _map_dim_x = MapLogX();
- _map_dim_y = MapLogY();
+ _map_dim_x = MapSizeX();
+ _map_dim_y = MapSizeY();
SlGlobList(_map_dimensions);
}
static void Load_MAPSIZE(void)
{
+ uint bits_x = 0;
+ uint bits_y = 0;
+
SlGlobList(_map_dimensions);
- InitMap(_map_dim_x, _map_dim_y);
+
+ for (; _map_dim_x > 1; _map_dim_x >>= 1) ++bits_x;
+ for (; _map_dim_y > 1; _map_dim_y >>= 1) ++bits_y;
+
+ InitMap(bits_x, bits_y);
}
static void SaveLoad_MAPT(void)