mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Use lowerCamelCase in entrance element
This commit is contained in:
@@ -440,7 +440,7 @@ static Widget _trackPlaceWidgets[] = {
|
||||
{
|
||||
for (const auto& entrance : td6.entranceElements)
|
||||
{
|
||||
auto rotatedAndOffsetEntrance = origin + entrance.Location.ToCoordsXY().Rotate(rotation);
|
||||
auto rotatedAndOffsetEntrance = origin + entrance.location.ToCoordsXY().Rotate(rotation);
|
||||
|
||||
if (pass == 0)
|
||||
{
|
||||
@@ -455,7 +455,7 @@ static Widget _trackPlaceWidgets[] = {
|
||||
if (DrawMiniPreviewIsPixelInBounds(pixelPosition))
|
||||
{
|
||||
uint8_t* pixel = DrawMiniPreviewGetPixelPtr(pixelPosition);
|
||||
uint8_t colour = entrance.IsExit ? _PaletteIndexColourExit : _PaletteIndexColourEntrance;
|
||||
uint8_t colour = entrance.isExit ? _PaletteIndexColourExit : _PaletteIndexColourEntrance;
|
||||
for (int32_t i = 0; i < 4; i++)
|
||||
{
|
||||
pixel[338 + i] = colour; // x + 2, y + 2
|
||||
|
||||
@@ -724,20 +724,20 @@ template<> struct DataSerializerTraitsT<TrackDesignEntranceElement>
|
||||
{
|
||||
static void encode(OpenRCT2::IStream* stream, const TrackDesignEntranceElement& val)
|
||||
{
|
||||
stream->Write(&val.Location);
|
||||
stream->Write(&val.IsExit);
|
||||
stream->Write(&val.location);
|
||||
stream->Write(&val.isExit);
|
||||
}
|
||||
static void decode(OpenRCT2::IStream* stream, TrackDesignEntranceElement& val)
|
||||
{
|
||||
stream->Read(&val.Location);
|
||||
stream->Read(&val.IsExit);
|
||||
stream->Read(&val.location);
|
||||
stream->Read(&val.isExit);
|
||||
}
|
||||
static void log(OpenRCT2::IStream* stream, const TrackDesignEntranceElement& val)
|
||||
{
|
||||
char msg[128] = {};
|
||||
snprintf(
|
||||
msg, sizeof(msg), "TrackDesignEntranceElement(x = %d, y = %d, z = %d, dir = %d, isExit = %d)", val.Location.x,
|
||||
val.Location.y, val.Location.z, val.Location.direction, val.IsExit);
|
||||
msg, sizeof(msg), "TrackDesignEntranceElement(x = %d, y = %d, z = %d, dir = %d, isExit = %d)", val.location.x,
|
||||
val.location.y, val.location.z, val.location.direction, val.isExit);
|
||||
stream->Write(msg, strlen(msg));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -939,8 +939,8 @@ void ImportMazeElement(TrackDesign& td, const TD46MazeElement& td46MazeElement)
|
||||
if (td46MazeElement.IsEntrance() || td46MazeElement.IsExit())
|
||||
{
|
||||
TrackDesignEntranceElement element{};
|
||||
element.Location = TileCoordsXYZD(td46MazeElement.x, td46MazeElement.y, 0, td46MazeElement.Direction);
|
||||
element.IsExit = td46MazeElement.IsExit();
|
||||
element.location = TileCoordsXYZD(td46MazeElement.x, td46MazeElement.y, 0, td46MazeElement.Direction);
|
||||
element.isExit = td46MazeElement.IsExit();
|
||||
td.entranceElements.push_back(element);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -109,11 +109,11 @@ namespace RCT2
|
||||
|
||||
for (const auto& entranceElement : _trackDesign->entranceElements)
|
||||
{
|
||||
tempStream.WriteValue<int8_t>(entranceElement.Location.x);
|
||||
tempStream.WriteValue<int8_t>(entranceElement.Location.y);
|
||||
tempStream.WriteValue<int8_t>(entranceElement.Location.direction);
|
||||
tempStream.WriteValue<int8_t>(entranceElement.location.x);
|
||||
tempStream.WriteValue<int8_t>(entranceElement.location.y);
|
||||
tempStream.WriteValue<int8_t>(entranceElement.location.direction);
|
||||
tempStream.WriteValue<int8_t>(
|
||||
EnumValue(entranceElement.IsExit ? TD46MazeElementType::Exit : TD46MazeElementType::Entrance));
|
||||
EnumValue(entranceElement.isExit ? TD46MazeElementType::Exit : TD46MazeElementType::Entrance));
|
||||
}
|
||||
|
||||
tempStream.WriteValue<uint32_t>(0);
|
||||
@@ -137,9 +137,9 @@ namespace RCT2
|
||||
for (const auto& entranceElement : _trackDesign->entranceElements)
|
||||
{
|
||||
tempStream.WriteValue<uint8_t>(
|
||||
entranceElement.Location.z == -1 ? static_cast<uint8_t>(0x80) : entranceElement.Location.z);
|
||||
tempStream.WriteValue<uint8_t>(entranceElement.Location.direction | (entranceElement.IsExit << 7));
|
||||
auto xy = entranceElement.Location.ToCoordsXY();
|
||||
entranceElement.location.z == -1 ? static_cast<uint8_t>(0x80) : entranceElement.location.z);
|
||||
tempStream.WriteValue<uint8_t>(entranceElement.location.direction | (entranceElement.isExit << 7));
|
||||
auto xy = entranceElement.location.ToCoordsXY();
|
||||
tempStream.WriteValue<int16_t>(xy.x);
|
||||
tempStream.WriteValue<int16_t>(xy.y);
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ namespace RCT2
|
||||
TrackDesignEntranceElement entranceElement{};
|
||||
auto xy = CoordsXY(t6EntranceElement.x, t6EntranceElement.y);
|
||||
auto z = (t6EntranceElement.z == -128) ? -1 : t6EntranceElement.z;
|
||||
entranceElement.Location = TileCoordsXYZD(TileCoordsXY(xy), z, t6EntranceElement.GetDirection());
|
||||
entranceElement.IsExit = t6EntranceElement.IsExit();
|
||||
entranceElement.location = TileCoordsXYZD(TileCoordsXY(xy), z, t6EntranceElement.GetDirection());
|
||||
entranceElement.isExit = t6EntranceElement.IsExit();
|
||||
td->entranceElements.push_back(entranceElement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,12 +321,12 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con
|
||||
}
|
||||
|
||||
TrackDesignEntranceElement entrance{};
|
||||
entrance.Location = TileCoordsXYZD(rotatedMapLocation, z, entranceDirection);
|
||||
entrance.location = TileCoordsXYZD(rotatedMapLocation, z, entranceDirection);
|
||||
|
||||
// If this is the exit version
|
||||
if (i == 1)
|
||||
{
|
||||
entrance.IsExit = true;
|
||||
entrance.isExit = true;
|
||||
}
|
||||
entranceElements.push_back(entrance);
|
||||
}
|
||||
@@ -414,8 +414,8 @@ ResultWithMessage TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, cons
|
||||
|
||||
auto entranceOffset = entranceLoc - startLoc;
|
||||
TrackDesignEntranceElement mazeEntrance{};
|
||||
mazeEntrance.Location = TileCoordsXYZD(CoordsXYZD(entranceOffset, 0, tileElement->GetDirection()));
|
||||
mazeEntrance.IsExit = false;
|
||||
mazeEntrance.location = TileCoordsXYZD(CoordsXYZD(entranceOffset, 0, tileElement->GetDirection()));
|
||||
mazeEntrance.isExit = false;
|
||||
entranceElements.push_back(mazeEntrance);
|
||||
|
||||
location = ride.GetStation().Exit;
|
||||
@@ -441,8 +441,8 @@ ResultWithMessage TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, cons
|
||||
|
||||
auto exitOffset = exitLoc - startLoc;
|
||||
TrackDesignEntranceElement mazeExit{};
|
||||
mazeExit.Location = TileCoordsXYZD(CoordsXYZD(exitOffset, 0, tileElement->GetDirection()));
|
||||
mazeExit.IsExit = true;
|
||||
mazeExit.location = TileCoordsXYZD(CoordsXYZD(exitOffset, 0, tileElement->GetDirection()));
|
||||
mazeExit.isExit = true;
|
||||
entranceElements.push_back(mazeExit);
|
||||
|
||||
// Save global vars as they are still used by scenery????
|
||||
@@ -872,10 +872,10 @@ static void TrackDesignMirrorEntrances(TrackDesign& td)
|
||||
{
|
||||
for (auto& entrance : td.entranceElements)
|
||||
{
|
||||
entrance.Location.y = -entrance.Location.y;
|
||||
if (entrance.Location.direction & 1)
|
||||
entrance.location.y = -entrance.location.y;
|
||||
if (entrance.location.direction & 1)
|
||||
{
|
||||
entrance.Location.direction = DirectionReverse(entrance.Location.direction);
|
||||
entrance.location.direction = DirectionReverse(entrance.location.direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ static std::optional<GameActions::Result> TrackDesignPlaceEntrances(
|
||||
for (const auto& entrance : td.entranceElements)
|
||||
{
|
||||
auto rotation = _currentTrackPieceDirection & 3;
|
||||
CoordsXY entranceMapPos = entrance.Location.ToCoordsXY();
|
||||
CoordsXY entranceMapPos = entrance.location.ToCoordsXY();
|
||||
auto rotatedEntranceMapPos = entranceMapPos.Rotate(rotation);
|
||||
newCoords = { rotatedEntranceMapPos + tds.Origin, newCoords.z };
|
||||
|
||||
@@ -1358,8 +1358,8 @@ static std::optional<GameActions::Result> TrackDesignPlaceEntrances(
|
||||
case PTD_OPERATION_PLACE_GHOST:
|
||||
case PTD_OPERATION_PLACE_TRACK_PREVIEW:
|
||||
{
|
||||
rotation = (rotation + entrance.Location.direction) & 3;
|
||||
newCoords.z = entrance.Location.z * COORDS_Z_STEP;
|
||||
rotation = (rotation + entrance.location.direction) & 3;
|
||||
newCoords.z = entrance.location.z * COORDS_Z_STEP;
|
||||
newCoords.z += tds.Origin.z;
|
||||
|
||||
if (tds.PlaceOperation != PTD_OPERATION_PLACE_QUERY)
|
||||
@@ -1405,7 +1405,7 @@ static std::optional<GameActions::Result> TrackDesignPlaceEntrances(
|
||||
}
|
||||
|
||||
auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction(
|
||||
newCoords, rotation, rideId, stationIndex, entrance.IsExit);
|
||||
newCoords, rotation, rideId, stationIndex, entrance.isExit);
|
||||
rideEntranceExitPlaceAction.SetFlags(flags);
|
||||
auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&rideEntranceExitPlaceAction)
|
||||
: GameActions::QueryNested(&rideEntranceExitPlaceAction);
|
||||
|
||||
@@ -40,8 +40,8 @@ struct TrackDesignState
|
||||
/* Track Entrance entry */
|
||||
struct TrackDesignEntranceElement
|
||||
{
|
||||
TileCoordsXYZD Location{};
|
||||
bool IsExit{};
|
||||
TileCoordsXYZD location{};
|
||||
bool isExit{};
|
||||
};
|
||||
|
||||
struct TrackDesignSceneryElement
|
||||
|
||||
Reference in New Issue
Block a user