mirror of https://github.com/OpenRCT2/OpenRCT2.git
Part of #21421: refactor TUNNEL_MAX_COUNT
This commit is contained in:
parent
893392d987
commit
aaf6e63441
|
@ -125,7 +125,7 @@ struct TunnelEntry
|
|||
// the quadrant index is based on the x and y components combined.
|
||||
static constexpr int32_t MaxPaintQuadrants = kMaximumMapSizeTechnical * 2;
|
||||
|
||||
#define TUNNEL_MAX_COUNT 65
|
||||
constexpr uint8_t kTunnelMaxCount = 65;
|
||||
|
||||
/**
|
||||
* A pool of PaintEntry instances that can be rented out.
|
||||
|
@ -202,8 +202,8 @@ struct PaintSessionCore
|
|||
SupportHeight SupportSegments[9];
|
||||
SupportHeight Support;
|
||||
uint16_t WaterHeight;
|
||||
TunnelEntry LeftTunnels[TUNNEL_MAX_COUNT];
|
||||
TunnelEntry RightTunnels[TUNNEL_MAX_COUNT];
|
||||
TunnelEntry LeftTunnels[kTunnelMaxCount];
|
||||
TunnelEntry RightTunnels[kTunnelMaxCount];
|
||||
uint8_t LeftTunnelCount;
|
||||
uint8_t RightTunnelCount;
|
||||
uint8_t VerticalTunnelHeight;
|
||||
|
|
|
@ -629,7 +629,7 @@ static void ViewportSurfaceDrawTileSideBottom(
|
|||
|
||||
neighbourCornerHeight1 = cornerHeight2;
|
||||
|
||||
for (uint32_t tunnelIndex = 0; tunnelIndex < TUNNEL_MAX_COUNT;)
|
||||
for (uint8_t tunnelIndex = 0; tunnelIndex < kTunnelMaxCount;)
|
||||
{
|
||||
if (curHeight >= cornerHeight1 || curHeight >= cornerHeight2)
|
||||
{
|
||||
|
|
|
@ -335,7 +335,7 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor
|
|||
void PaintUtilPushTunnelLeft(PaintSession& session, uint16_t height, uint8_t type)
|
||||
{
|
||||
session.LeftTunnels[session.LeftTunnelCount] = { static_cast<uint8_t>((height / 16)), type };
|
||||
if (session.LeftTunnelCount < TUNNEL_MAX_COUNT - 1)
|
||||
if (session.LeftTunnelCount < kTunnelMaxCount - 1)
|
||||
{
|
||||
session.LeftTunnels[session.LeftTunnelCount + 1] = { 0xFF, 0xFF };
|
||||
session.LeftTunnelCount++;
|
||||
|
@ -345,7 +345,7 @@ void PaintUtilPushTunnelLeft(PaintSession& session, uint16_t height, uint8_t typ
|
|||
void PaintUtilPushTunnelRight(PaintSession& session, uint16_t height, uint8_t type)
|
||||
{
|
||||
session.RightTunnels[session.RightTunnelCount] = { static_cast<uint8_t>((height / 16)), type };
|
||||
if (session.RightTunnelCount < TUNNEL_MAX_COUNT - 1)
|
||||
if (session.RightTunnelCount < kTunnelMaxCount - 1)
|
||||
{
|
||||
session.RightTunnels[session.RightTunnelCount + 1] = { 0xFF, 0xFF };
|
||||
session.RightTunnelCount++;
|
||||
|
|
Loading…
Reference in New Issue