mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move Boundbox to its own file, remove non-Coords constructors
This commit is contained in:
parent
b5ba892bd9
commit
b4ab72416e
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
};
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue