Move Boundbox to its own file, remove non-Coords constructors

This commit is contained in:
Gymnasiast 2022-09-07 20:48:25 +02:00
parent b5ba892bd9
commit b4ab72416e
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
11 changed files with 62 additions and 51 deletions

View File

@ -315,6 +315,7 @@
<ClInclude Include="object\WallObject.h" />
<ClInclude Include="object\WaterObject.h" />
<ClInclude Include="OpenRCT2.h" />
<ClInclude Include="paint\Boundbox.h" />
<ClInclude Include="paint\Paint.Entity.h" />
<ClInclude Include="paint\Paint.h" />
<ClInclude Include="paint\Painter.h" />
@ -1001,4 +1002,4 @@
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>

View File

@ -0,0 +1,40 @@
/*****************************************************************************
* Copyright (c) 2014-2022 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 "../world/Location.hpp"
#include <cstdint>
struct BoundBoxXY
{
CoordsXY length{};
CoordsXY offset{};
constexpr BoundBoxXY() = default;
constexpr BoundBoxXY(CoordsXY _length, CoordsXY _offset)
: length(_length)
, offset(_offset)
{
}
};
struct BoundBoxXYZ
{
CoordsXYZ length{};
CoordsXYZ offset{};
constexpr BoundBoxXYZ() = default;
constexpr BoundBoxXYZ(CoordsXYZ _length, CoordsXYZ _offset)
: length(_length)
, offset(_offset)
{
}
};

View File

@ -14,6 +14,7 @@
#include "../sprites.h"
#include "../util/Math.hpp"
#include "../world/Surface.h"
#include "Boundbox.h"
#include "Paint.h"
#include "tile_element/Paint.TileElement.h"

View File

@ -9,6 +9,7 @@
#include "../../entity/EntityRegistry.h"
#include "../../interface/Viewport.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../../ride/Vehicle.h"

View File

@ -10,6 +10,7 @@
#include "../../entity/EntityRegistry.h"
#include "../../entity/Guest.h"
#include "../../interface/Viewport.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../Ride.h"

View File

@ -9,6 +9,7 @@
#include "../../entity/EntityRegistry.h"
#include "../../interface/Viewport.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../Ride.h"

View File

@ -10,6 +10,7 @@
#include "../../entity/EntityRegistry.h"
#include "../../interface/Viewport.h"
#include "../../object/StationObject.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../Ride.h"
@ -46,10 +47,10 @@ static constexpr const int8_t MagicCarpetOscillationXY[] = {
};
static constexpr const BoundBoxXY MagicCarpetBounds[] = {
{ 0, 8, 32, 16 },
{ 8, 0, 16, 32 },
{ 0, 8, 32, 16 },
{ 8, 0, 16, 32 },
{ { 0, 8 }, { 32, 16 } },
{ { 8, 0 }, { 16, 32 } },
{ { 0, 8 }, { 32, 16 } },
{ { 8, 0 }, { 16, 32 } },
};
static ImageIndex GetMagicCarpetFrameImage(Plane plane, Direction direction)

View File

@ -10,6 +10,7 @@
#include "../../entity/EntityRegistry.h"
#include "../../interface/Viewport.h"
#include "../../object/StationObject.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../Ride.h"
@ -36,10 +37,10 @@ static constexpr const uint32_t SwingingInverterShipAnimatingBaseSpriteOffset[]
/** rct2: 0x01428020 */
static constexpr const BoundBoxXY SwingingInverterShipBounds[] = {
{ 0, 8, 32, 16 },
{ 8, 0, 16, 32 },
{ 0, 8, 32, 16 },
{ 8, 0, 16, 32 },
{ { 0, 8 }, { 32, 16 } },
{ { 8, 0 }, { 16, 32 } },
{ { 0, 8 }, { 32, 16 } },
{ { 8, 0 }, { 16, 32 } },
};
enum

View File

@ -10,6 +10,7 @@
#include "../../entity/EntityRegistry.h"
#include "../../interface/Viewport.h"
#include "../../object/StationObject.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../Ride.h"
@ -35,10 +36,10 @@ static constexpr const uint32_t SwingingShipBaseSpriteOffset[] = {
/** rct2: 0x008A83C0 */
static constexpr const BoundBoxXY SwingingShipData[] = {
{ 1, 8, 31, 16 },
{ 8, 1, 16, 31 },
{ 1, 8, 31, 16 },
{ 8, 1, 16, 31 },
{ { 1, 8 }, { 31, 16 } },
{ { 8, 1 }, { 16, 31 } },
{ { 1, 8 }, { 31, 16 } },
{ { 8, 1 }, { 16, 31 } },
};
enum

View File

@ -10,6 +10,7 @@
#include "../../common.h"
#include "../../interface/Viewport.h"
#include "../../object/StationObject.h"
#include "../../paint/Boundbox.h"
#include "../../paint/Paint.h"
#include "../../paint/Supports.h"
#include "../../world/Map.h"

View File

@ -702,44 +702,6 @@ struct TileCoordsXYZD : public TileCoordsXYZ
}
};
struct BoundBoxXY
{
CoordsXY offset{};
CoordsXY length{};
constexpr BoundBoxXY() = default;
constexpr BoundBoxXY(CoordsXY _offset, CoordsXY _length)
: offset(_offset)
, length(_length)
{
}
constexpr BoundBoxXY(int32_t _offX, int32_t _offY, int32_t _lenX, int32_t _lenY)
: offset({ _offX, _offY })
, length({ _lenX, _lenY })
{
}
};
struct BoundBoxXYZ
{
CoordsXYZ offset{};
CoordsXYZ length{};
constexpr BoundBoxXYZ() = default;
constexpr BoundBoxXYZ(CoordsXYZ _offset, CoordsXYZ _length)
: offset(_offset)
, length(_length)
{
}
constexpr BoundBoxXYZ(int32_t _offX, int32_t _offY, int32_t _offZ, int32_t _lenX, int32_t _lenY, int32_t _lenZ)
: offset({ _offX, _offY, _offZ })
, length({ _lenX, _lenY, _lenZ })
{
}
};
/**
* Represents a range of the map using regular coordinates.
*/