Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2025-06-14 17:01:17 +05:00
1132 changed files with 59430 additions and 52889 deletions

View File

@@ -9,7 +9,6 @@
#include "stdafx.h"
#include "debug.h"
#include "core/alloc_func.hpp"
#include "water_map.h"
#include "error_func.h"
#include "string_func.h"
@@ -25,8 +24,8 @@
/* static */ uint Map::size; ///< The number of tiles on the map
/* static */ uint Map::tile_mask; ///< _map_size - 1 (to mask the mapsize)
/* static */ Tile::TileBase *Tile::base_tiles = nullptr; ///< Base tiles of the map
/* static */ Tile::TileExtended *Tile::extended_tiles = nullptr; ///< Extended tiles of the map
/* static */ std::unique_ptr<Tile::TileBase[]> Tile::base_tiles; ///< Base tiles of the map
/* static */ std::unique_ptr<Tile::TileExtended[]> Tile::extended_tiles; ///< Extended tiles of the map
/**
@@ -54,11 +53,8 @@
Map::size = size_x * size_y;
Map::tile_mask = Map::size - 1;
free(Tile::base_tiles);
free(Tile::extended_tiles);
Tile::base_tiles = CallocT<Tile::TileBase>(Map::size);
Tile::extended_tiles = CallocT<Tile::TileExtended>(Map::size);
Tile::base_tiles = std::make_unique<Tile::TileBase[]>(Map::size);
Tile::extended_tiles = std::make_unique<Tile::TileExtended[]>(Map::size);
AllocateWaterRegions();
citymania::AllocateZoningMap(Map::size);
@@ -157,7 +153,7 @@ uint DistanceManhattan(TileIndex t0, TileIndex t1)
* Gets the 'Square' distance between the two given tiles.
* The 'Square' distance is the square of the shortest (straight line)
* distance between the two tiles.
* Also known as euclidian- or L2-Norm squared.
* Also known as Euclidean- or L2-Norm squared.
* @param t0 the start tile
* @param t1 the end tile
* @return the distance