Merge branch 'extra_large_maps' into extra_large_maps-sx
Conflicts: src/genworld_gui.cpp src/map_type.h src/newgrf_debug_gui.cpp
This commit is contained in:
10
src/map.cpp
10
src/map.cpp
@@ -40,17 +40,19 @@ TileExtended *_me = NULL; ///< Extended Tiles of the map
|
||||
*/
|
||||
void AllocateMap(uint size_x, uint size_y)
|
||||
{
|
||||
DEBUG(map, 2, "Min/max map size %d/%d, max map tiles %d", MIN_MAP_SIZE, MAX_MAP_SIZE, MAX_MAP_TILES);
|
||||
DEBUG(map, 1, "Allocating map of size %dx%d", size_x, size_y);
|
||||
|
||||
/* Make sure that the map size is within the limits and that
|
||||
* size of both axes is a power of 2. */
|
||||
if (!IsInsideMM(size_x, MIN_MAP_SIZE, MAX_MAP_SIZE + 1) ||
|
||||
!IsInsideMM(size_y, MIN_MAP_SIZE, MAX_MAP_SIZE + 1) ||
|
||||
if (size_x * size_y > MAX_MAP_TILES ||
|
||||
size_x < MIN_MAP_SIZE ||
|
||||
size_y < MIN_MAP_SIZE ||
|
||||
(size_x & (size_x - 1)) != 0 ||
|
||||
(size_y & (size_y - 1)) != 0) {
|
||||
error("Invalid map size");
|
||||
}
|
||||
|
||||
DEBUG(map, 1, "Allocating map of size %dx%d", size_x, size_y);
|
||||
|
||||
_map_log_x = FindFirstBit(size_x);
|
||||
_map_log_y = FindFirstBit(size_y);
|
||||
_map_size_x = size_x;
|
||||
|
Reference in New Issue
Block a user