mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Split off MapLimits.h from Map.h
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <openrct2/paint/Paint.h>
|
||||
#include <openrct2/ui/WindowManager.h>
|
||||
#include <openrct2/world/Location.hpp>
|
||||
#include <openrct2/world/Map.h>
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "world/Climate.h"
|
||||
#include "world/Entrance.h"
|
||||
#include "world/Footpath.h"
|
||||
#include "world/MapLimits.h"
|
||||
#include "world/Park.h"
|
||||
#include "world/Scenery.h"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../world/Map.h"
|
||||
#include "../world/Location.hpp"
|
||||
#include "GameAction.h"
|
||||
|
||||
namespace OpenRCT2::GameActions
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core/FlagHolder.hpp"
|
||||
#include "../world/Map.h"
|
||||
#include "../world/Location.hpp"
|
||||
#include "EntityBase.h"
|
||||
|
||||
class DataSerialiser;
|
||||
@@ -28,6 +28,8 @@ namespace OpenRCT2
|
||||
direction = 7,
|
||||
};
|
||||
using FountainFlags = FlagHolder<uint8_t, FountainFlag>;
|
||||
|
||||
struct TileElement;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
enum class JumpingFountainType : uint8_t
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../world/Map.h"
|
||||
#include "../world/MapLimits.h"
|
||||
#include "Staff.h"
|
||||
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
// The number of elements in the GameState_t.StaffPatrolAreas array per staff member. Every bit in the array represents a 4x4
|
||||
// square. Right now, it's a 32-bit array like in RCT2. 32 * 128 = 4096 bits, which is also the number of 4x4 squares on a
|
||||
|
||||
@@ -11,13 +11,19 @@
|
||||
|
||||
#include "../core/EnumUtils.hpp"
|
||||
#include "../core/Money.hpp"
|
||||
#include "../world/Map.h"
|
||||
#include "Peep.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct TileElement;
|
||||
struct PathElement;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
class DataSerialiser;
|
||||
class PatrolArea;
|
||||
struct Ride;
|
||||
|
||||
using colour_t = uint8_t;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "../Game.h"
|
||||
#include "../core/Money.hpp"
|
||||
#include "../world/Map.h"
|
||||
#include "../world/Location.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../drawing/Drawing.h"
|
||||
#include "../interface/Colour.h"
|
||||
#include "../world/Location.hpp"
|
||||
#include "../world/Map.h"
|
||||
#include "../world/MapLimits.h"
|
||||
#include "Boundbox.h"
|
||||
#include "tile_element/Paint.Tunnel.h"
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct PathElement;
|
||||
}
|
||||
|
||||
void Sub6A3F61PathAddition(
|
||||
PaintSession& session, const OpenRCT2::PathElement& pathElement, uint16_t height, ImageId sceneryImageTemplate);
|
||||
void PaintLampLightEffects(PaintSession& session, const OpenRCT2::PathElement& pathEl, uint16_t height);
|
||||
|
||||
@@ -9,7 +9,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../world/Map.h"
|
||||
#include "../../world/Location.hpp"
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct BannerElement;
|
||||
struct EntranceElement;
|
||||
struct LargeSceneryElement;
|
||||
struct PathElement;
|
||||
struct SmallSceneryElement;
|
||||
struct SurfaceElement;
|
||||
struct TrackElement;
|
||||
struct WallElement;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
struct PaintSession;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "../paint/support/MetalSupports.h"
|
||||
#include "../paint/tile_element/Paint.TileElement.h"
|
||||
#include "../paint/track/Support.h"
|
||||
#include "../world/Map.h"
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "../core/Console.hpp"
|
||||
#include "../core/EnumMap.hpp"
|
||||
#include "../ride/Vehicle.h"
|
||||
#include "../world/Map.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <dukglue/dukglue.h>
|
||||
|
||||
@@ -10,20 +10,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core/Numerics.hpp"
|
||||
#include "../world/MapLimits.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
constexpr int16_t kLocationNull = -32768;
|
||||
|
||||
constexpr int32_t kCoordsXYStep = 32;
|
||||
constexpr int32_t kCoordsXYHalfTile = (kCoordsXYStep / 2);
|
||||
constexpr int32_t kCoordsZStep = 8;
|
||||
constexpr int32_t kCoordsZPerTinyZ = 16;
|
||||
constexpr int32_t kCoordsNull = 0xFFFF8000;
|
||||
|
||||
constexpr auto kNumOrthogonalDirections = 4;
|
||||
|
||||
constexpr int32_t kCoordsNull = 0xFFFF8000;
|
||||
|
||||
constexpr int32_t kScreenCoordsTileWidth = 64;
|
||||
constexpr int32_t kScreenCoordsTileWidthHalf = kScreenCoordsTileWidth / 2;
|
||||
constexpr int32_t kScreenCoordsTileHeight = 32;
|
||||
|
||||
@@ -17,34 +17,7 @@
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
constexpr uint8_t kMinimumLandHeight = 2;
|
||||
constexpr uint8_t kMaximumLandHeight = 254;
|
||||
constexpr uint8_t kMinimumWaterHeight = 2;
|
||||
constexpr uint8_t kMaximumWaterHeight = 254;
|
||||
/**
|
||||
* The land height that counts as 0 metres/feet for the land height labels and altitude graphs.
|
||||
*/
|
||||
constexpr uint8_t kMapBaseZ = 7;
|
||||
|
||||
constexpr uint8_t kMinimumMapSizeTechnical = 5;
|
||||
constexpr uint16_t kMaximumMapSizeTechnical = 1001;
|
||||
constexpr int16_t kMinimumMapSizePractical = (kMinimumMapSizeTechnical - 2);
|
||||
constexpr int16_t kMaximumMapSizePractical = (kMaximumMapSizeTechnical - 2);
|
||||
constexpr const int32_t kMaximumMapSizeBig = kCoordsXYStep * kMaximumMapSizeTechnical;
|
||||
constexpr int32_t kMaximumTileStartXY = kMaximumMapSizeBig - kCoordsXYStep;
|
||||
constexpr const int32_t kLandHeightStep = 2 * kCoordsZStep;
|
||||
constexpr const int32_t kWaterHeightStep = 2 * kCoordsZStep;
|
||||
constexpr const int32_t kMinimumLandZ = kMinimumLandHeight * kCoordsZStep;
|
||||
constexpr TileCoordsXY kDefaultMapSize = { 150, 150 };
|
||||
// How high construction has to be off the ground when the player owns construction rights, in tile coords.
|
||||
constexpr uint8_t kConstructionRightsClearanceSmall = 3;
|
||||
// Same as previous, but in big coords.
|
||||
constexpr const uint8_t kConstructionRightsClearanceBig = 3 * kCoordsZStep;
|
||||
|
||||
constexpr int16_t kMapMinimumXY = (-kMaximumMapSizeTechnical);
|
||||
|
||||
constexpr uint32_t kMaxTileElementsWithSpaceRoom = 0x1000000;
|
||||
constexpr uint32_t kMaxTileElements = kMaxTileElementsWithSpaceRoom - 512;
|
||||
|
||||
using PeepSpawn = CoordsXYZD;
|
||||
|
||||
|
||||
45
src/openrct2/world/MapLimits.h
Normal file
45
src/openrct2/world/MapLimits.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2025 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
constexpr int32_t kCoordsXYStep = 32;
|
||||
constexpr int32_t kCoordsXYHalfTile = (kCoordsXYStep / 2);
|
||||
constexpr int32_t kCoordsZStep = 8;
|
||||
constexpr int32_t kCoordsZPerTinyZ = 16;
|
||||
|
||||
constexpr uint8_t kMinimumMapSizeTechnical = 5;
|
||||
constexpr uint16_t kMaximumMapSizeTechnical = 1001;
|
||||
constexpr int16_t kMinimumMapSizePractical = (kMinimumMapSizeTechnical - 2);
|
||||
constexpr int16_t kMaximumMapSizePractical = (kMaximumMapSizeTechnical - 2);
|
||||
constexpr int32_t kMaximumMapSizeBig = kCoordsXYStep * kMaximumMapSizeTechnical;
|
||||
|
||||
constexpr uint8_t kMinimumLandHeight = 2;
|
||||
constexpr uint8_t kMaximumLandHeight = 254;
|
||||
constexpr uint8_t kMinimumWaterHeight = 2;
|
||||
constexpr uint8_t kMaximumWaterHeight = 254;
|
||||
|
||||
constexpr int16_t kMapMinimumXY = (-kMaximumMapSizeTechnical);
|
||||
constexpr int32_t kMaximumTileStartXY = kMaximumMapSizeBig - kCoordsXYStep;
|
||||
constexpr int32_t kLandHeightStep = 2 * kCoordsZStep;
|
||||
constexpr int32_t kWaterHeightStep = 2 * kCoordsZStep;
|
||||
constexpr int32_t kMinimumLandZ = kMinimumLandHeight * kCoordsZStep;
|
||||
|
||||
// The land height that counts as 0 metres/feet for the land height labels and altitude graphs.
|
||||
constexpr uint8_t kMapBaseZ = 7;
|
||||
|
||||
// How high construction has to be off the ground when the player owns construction rights, in tile coords.
|
||||
constexpr uint8_t kConstructionRightsClearanceSmall = 3;
|
||||
// Same as previous, but in big coords.
|
||||
constexpr uint8_t kConstructionRightsClearanceBig = 3 * kCoordsZStep;
|
||||
|
||||
constexpr uint32_t kMaxTileElementsWithSpaceRoom = 0x1000000;
|
||||
constexpr uint32_t kMaxTileElements = kMaxTileElementsWithSpaceRoom - 512;
|
||||
@@ -10,12 +10,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "Location.hpp"
|
||||
#include "Map.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct TileElement;
|
||||
|
||||
namespace Detail
|
||||
{
|
||||
template<typename T, typename T2>
|
||||
|
||||
Reference in New Issue
Block a user