mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 07:13:07 +01:00
Do not use td6 as a variable name for TrackDesign
This commit is contained in:
@@ -169,8 +169,8 @@ static Widget window_install_track_widgets[] = {
|
|||||||
screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 };
|
screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 };
|
||||||
|
|
||||||
// Warnings
|
// Warnings
|
||||||
const TrackDesign* td6 = _trackDesign.get();
|
const TrackDesign* td = _trackDesign.get();
|
||||||
if (td6->trackFlags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE)
|
if (td->trackFlags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE)
|
||||||
{
|
{
|
||||||
if (!gTrackDesignSceneryToggle)
|
if (!gTrackDesignSceneryToggle)
|
||||||
{
|
{
|
||||||
@@ -198,17 +198,17 @@ static Widget window_install_track_widgets[] = {
|
|||||||
{
|
{
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
|
|
||||||
const auto* objectEntry = ObjectManagerLoadObject(&td6->vehicleObject.Entry);
|
const auto* objectEntry = ObjectManagerLoadObject(&td->vehicleObject.Entry);
|
||||||
if (objectEntry != nullptr)
|
if (objectEntry != nullptr)
|
||||||
{
|
{
|
||||||
auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(objectEntry);
|
auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(objectEntry);
|
||||||
auto rideName = GetRideNaming(td6->type, *GetRideEntryByIndex(groupIndex));
|
auto rideName = GetRideNaming(td->type, *GetRideEntryByIndex(groupIndex));
|
||||||
ft.Add<StringId>(rideName.Name);
|
ft.Add<StringId>(rideName.Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Fall back on the technical track name if the vehicle object cannot be loaded
|
// Fall back on the technical track name if the vehicle object cannot be loaded
|
||||||
ft.Add<StringId>(GetRideTypeDescriptor(td6->type).Naming.Name);
|
ft.Add<StringId>(GetRideTypeDescriptor(td->type).Naming.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft);
|
DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft);
|
||||||
@@ -217,34 +217,34 @@ static Widget window_install_track_widgets[] = {
|
|||||||
|
|
||||||
// Stats
|
// Stats
|
||||||
{
|
{
|
||||||
fixed32_2dp rating = td6->statistics.excitement * 10;
|
fixed32_2dp rating = td->statistics.excitement * 10;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(rating);
|
ft.Add<int32_t>(rating);
|
||||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
|
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft);
|
||||||
screenPos.y += kListRowHeight;
|
screenPos.y += kListRowHeight;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
fixed32_2dp rating = td6->statistics.intensity * 10;
|
fixed32_2dp rating = td->statistics.intensity * 10;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(rating);
|
ft.Add<int32_t>(rating);
|
||||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
|
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft);
|
||||||
screenPos.y += kListRowHeight;
|
screenPos.y += kListRowHeight;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
fixed32_2dp rating = td6->statistics.nausea * 10;
|
fixed32_2dp rating = td->statistics.nausea * 10;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(rating);
|
ft.Add<int32_t>(rating);
|
||||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
|
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft);
|
||||||
screenPos.y += kListRowHeight + 4;
|
screenPos.y += kListRowHeight + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& rtd = GetRideTypeDescriptor(td6->type);
|
const auto& rtd = GetRideTypeDescriptor(td->type);
|
||||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||||
{
|
{
|
||||||
if (td6->type == RIDE_TYPE_MINI_GOLF)
|
if (td->type == RIDE_TYPE_MINI_GOLF)
|
||||||
{
|
{
|
||||||
// Holes
|
// Holes
|
||||||
uint16_t holes = td6->statistics.holes & 0x1F;
|
uint16_t holes = td->statistics.holes & 0x1F;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<uint16_t>(holes);
|
ft.Add<uint16_t>(holes);
|
||||||
DrawTextBasic(dpi, screenPos, STR_HOLES, ft);
|
DrawTextBasic(dpi, screenPos, STR_HOLES, ft);
|
||||||
@@ -254,7 +254,7 @@ static Widget window_install_track_widgets[] = {
|
|||||||
{
|
{
|
||||||
// Maximum speed
|
// Maximum speed
|
||||||
{
|
{
|
||||||
uint16_t speed = ((td6->statistics.maxSpeed << 16) * 9) >> 18;
|
uint16_t speed = ((td->statistics.maxSpeed << 16) * 9) >> 18;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<uint16_t>(speed);
|
ft.Add<uint16_t>(speed);
|
||||||
DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft);
|
DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft);
|
||||||
@@ -262,7 +262,7 @@ static Widget window_install_track_widgets[] = {
|
|||||||
}
|
}
|
||||||
// Average speed
|
// Average speed
|
||||||
{
|
{
|
||||||
uint16_t speed = ((td6->statistics.averageSpeed << 16) * 9) >> 18;
|
uint16_t speed = ((td->statistics.averageSpeed << 16) * 9) >> 18;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<uint16_t>(speed);
|
ft.Add<uint16_t>(speed);
|
||||||
DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft);
|
DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft);
|
||||||
@@ -273,16 +273,16 @@ static Widget window_install_track_widgets[] = {
|
|||||||
// Ride length
|
// Ride length
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<StringId>(STR_RIDE_LENGTH_ENTRY);
|
ft.Add<StringId>(STR_RIDE_LENGTH_ENTRY);
|
||||||
ft.Add<uint16_t>(td6->statistics.rideLength);
|
ft.Add<uint16_t>(td->statistics.rideLength);
|
||||||
DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft);
|
DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft);
|
||||||
screenPos.y += kListRowHeight;
|
screenPos.y += kListRowHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
if (GetRideTypeDescriptor(td->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||||
{
|
{
|
||||||
// Maximum positive vertical Gs
|
// Maximum positive vertical Gs
|
||||||
{
|
{
|
||||||
int32_t gForces = td6->statistics.maxPositiveVerticalG * 32;
|
int32_t gForces = td->statistics.maxPositiveVerticalG * 32;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(gForces);
|
ft.Add<int32_t>(gForces);
|
||||||
DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
|
DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft);
|
||||||
@@ -290,7 +290,7 @@ static Widget window_install_track_widgets[] = {
|
|||||||
}
|
}
|
||||||
// Maximum negative vertical Gs
|
// Maximum negative vertical Gs
|
||||||
{
|
{
|
||||||
int32_t gForces = td6->statistics.maxNegativeVerticalG * 32;
|
int32_t gForces = td->statistics.maxNegativeVerticalG * 32;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(gForces);
|
ft.Add<int32_t>(gForces);
|
||||||
DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
|
DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft);
|
||||||
@@ -298,16 +298,16 @@ static Widget window_install_track_widgets[] = {
|
|||||||
}
|
}
|
||||||
// Maximum lateral Gs
|
// Maximum lateral Gs
|
||||||
{
|
{
|
||||||
int32_t gForces = td6->statistics.maxLateralG * 32;
|
int32_t gForces = td->statistics.maxLateralG * 32;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(gForces);
|
ft.Add<int32_t>(gForces);
|
||||||
DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft);
|
DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft);
|
||||||
screenPos.y += kListRowHeight;
|
screenPos.y += kListRowHeight;
|
||||||
}
|
}
|
||||||
if (td6->statistics.totalAirTime != 0)
|
if (td->statistics.totalAirTime != 0)
|
||||||
{
|
{
|
||||||
// Total air time
|
// Total air time
|
||||||
int32_t airTime = td6->statistics.totalAirTime * 25;
|
int32_t airTime = td->statistics.totalAirTime * 25;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<int32_t>(airTime);
|
ft.Add<int32_t>(airTime);
|
||||||
DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
|
DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft);
|
||||||
@@ -315,10 +315,10 @@ static Widget window_install_track_widgets[] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
|
if (GetRideTypeDescriptor(td->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
|
||||||
{
|
{
|
||||||
// Drops
|
// Drops
|
||||||
uint16_t drops = td6->statistics.drops & 0x3F;
|
uint16_t drops = td->statistics.drops & 0x3F;
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<uint16_t>(drops);
|
ft.Add<uint16_t>(drops);
|
||||||
DrawTextBasic(dpi, screenPos, STR_DROPS, ft);
|
DrawTextBasic(dpi, screenPos, STR_DROPS, ft);
|
||||||
@@ -329,9 +329,9 @@ static Widget window_install_track_widgets[] = {
|
|||||||
screenPos.y += kListRowHeight;
|
screenPos.y += kListRowHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (td6->type != RIDE_TYPE_MINI_GOLF)
|
if (td->type != RIDE_TYPE_MINI_GOLF)
|
||||||
{
|
{
|
||||||
uint16_t inversions = td6->statistics.inversions & 0x1F;
|
uint16_t inversions = td->statistics.inversions & 0x1F;
|
||||||
if (inversions != 0)
|
if (inversions != 0)
|
||||||
{
|
{
|
||||||
// Inversions
|
// Inversions
|
||||||
@@ -343,20 +343,20 @@ static Widget window_install_track_widgets[] = {
|
|||||||
}
|
}
|
||||||
screenPos.y += 4;
|
screenPos.y += 4;
|
||||||
|
|
||||||
if (!td6->statistics.spaceRequired.IsNull())
|
if (!td->statistics.spaceRequired.IsNull())
|
||||||
{
|
{
|
||||||
// Space required
|
// Space required
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<uint16_t>(td6->statistics.spaceRequired.x);
|
ft.Add<uint16_t>(td->statistics.spaceRequired.x);
|
||||||
ft.Add<uint16_t>(td6->statistics.spaceRequired.y);
|
ft.Add<uint16_t>(td->statistics.spaceRequired.y);
|
||||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft);
|
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft);
|
||||||
screenPos.y += kListRowHeight;
|
screenPos.y += kListRowHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (td6->cost != 0)
|
if (td->cost != 0)
|
||||||
{
|
{
|
||||||
auto ft = Formatter();
|
auto ft = Formatter();
|
||||||
ft.Add<money64>(td6->cost);
|
ft.Add<money64>(td->cost);
|
||||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
|
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ static Widget _trackPlaceWidgets[] = {
|
|||||||
_trackDesign = std::move(trackDesign);
|
_trackDesign = std::move(trackDesign);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawMiniPreview(TrackDesign* td6)
|
void DrawMiniPreview(TrackDesign* td)
|
||||||
{
|
{
|
||||||
ClearMiniPreview();
|
ClearMiniPreview();
|
||||||
|
|
||||||
@@ -366,14 +366,14 @@ static Widget _trackPlaceWidgets[] = {
|
|||||||
origin.y -= ((max.y + min.y) >> 6) * COORDS_XY_STEP;
|
origin.y -= ((max.y + min.y) >> 6) * COORDS_XY_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& rtd = GetRideTypeDescriptor(td6->type);
|
const auto& rtd = GetRideTypeDescriptor(td->type);
|
||||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||||
{
|
{
|
||||||
DrawMiniPreviewMaze(td6, pass, origin, min, max);
|
DrawMiniPreviewMaze(td, pass, origin, min, max);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawMiniPreviewTrack(td6, pass, origin, min, max);
|
DrawMiniPreviewTrack(td, pass, origin, min, max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -436,9 +436,9 @@ static Widget _trackPlaceWidgets[] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DrawMiniPreviewEntrances(
|
void DrawMiniPreviewEntrances(
|
||||||
const TrackDesign& td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max, Direction rotation)
|
const TrackDesign& td, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max, Direction rotation)
|
||||||
{
|
{
|
||||||
for (const auto& entrance : td6.entranceElements)
|
for (const auto& entrance : td.entranceElements)
|
||||||
{
|
{
|
||||||
auto rotatedAndOffsetEntrance = origin + entrance.location.ToCoordsXY().Rotate(rotation);
|
auto rotatedAndOffsetEntrance = origin + entrance.location.ToCoordsXY().Rotate(rotation);
|
||||||
|
|
||||||
@@ -468,13 +468,13 @@ static Widget _trackPlaceWidgets[] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawMiniPreviewTrack(TrackDesign* td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max)
|
void DrawMiniPreviewTrack(TrackDesign* td, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max)
|
||||||
{
|
{
|
||||||
const uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3;
|
const uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3;
|
||||||
|
|
||||||
CoordsXY curTrackStart = origin;
|
CoordsXY curTrackStart = origin;
|
||||||
uint8_t curTrackRotation = rotation;
|
uint8_t curTrackRotation = rotation;
|
||||||
for (const auto& trackElement : td6->trackElements)
|
for (const auto& trackElement : td->trackElements)
|
||||||
{
|
{
|
||||||
// Follow a single track piece shape
|
// Follow a single track piece shape
|
||||||
const auto& ted = GetTrackElementDescriptor(trackElement.type);
|
const auto& ted = GetTrackElementDescriptor(trackElement.type);
|
||||||
@@ -539,13 +539,13 @@ static Widget _trackPlaceWidgets[] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawMiniPreviewEntrances(*td6, pass, origin, min, max, rotation);
|
DrawMiniPreviewEntrances(*td, pass, origin, min, max, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawMiniPreviewMaze(TrackDesign* td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max)
|
void DrawMiniPreviewMaze(TrackDesign* td, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max)
|
||||||
{
|
{
|
||||||
uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3;
|
uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3;
|
||||||
for (const auto& mazeElement : td6->mazeElements)
|
for (const auto& mazeElement : td->mazeElements)
|
||||||
{
|
{
|
||||||
auto rotatedMazeCoords = origin + mazeElement.location.ToCoordsXY().Rotate(rotation);
|
auto rotatedMazeCoords = origin + mazeElement.location.ToCoordsXY().Rotate(rotation);
|
||||||
|
|
||||||
@@ -575,7 +575,7 @@ static Widget _trackPlaceWidgets[] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawMiniPreviewEntrances(*td6, pass, origin, min, max, rotation);
|
DrawMiniPreviewEntrances(*td, pass, origin, min, max, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenCoordsXY DrawMiniPreviewGetPixelPosition(const CoordsXY& location)
|
ScreenCoordsXY DrawMiniPreviewGetPixelPosition(const CoordsXY& location)
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ GameActions::Result TrackDesignAction::Query() const
|
|||||||
auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicleObject);
|
auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicleObject);
|
||||||
if (entryIndex == OBJECT_ENTRY_INDEX_NULL)
|
if (entryIndex == OBJECT_ENTRY_INDEX_NULL)
|
||||||
{
|
{
|
||||||
// Force a fallback if the entry is not invented yet a td6 of it is selected,
|
// Force a fallback if the entry is not invented yet a track design of it is selected,
|
||||||
// which can happen in select-by-track-type mode
|
// which can happen in select-by-track-type mode
|
||||||
if (!RideEntryIsInvented(entryIndex) && !gameState.Cheats.IgnoreResearchStatus)
|
if (!RideEntryIsInvented(entryIndex) && !gameState.Cheats.IgnoreResearchStatus)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -622,19 +622,19 @@ std::unique_ptr<TrackDesign> TrackDesignImport(const utf8* path)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006ABDB0
|
* rct2: 0x006ABDB0
|
||||||
*/
|
*/
|
||||||
static void TrackDesignLoadSceneryObjects(TrackDesign* td6)
|
static void TrackDesignLoadSceneryObjects(TrackDesign* td)
|
||||||
{
|
{
|
||||||
auto& objectManager = OpenRCT2::GetContext()->GetObjectManager();
|
auto& objectManager = OpenRCT2::GetContext()->GetObjectManager();
|
||||||
objectManager.UnloadAllTransient();
|
objectManager.UnloadAllTransient();
|
||||||
|
|
||||||
// Load ride object
|
// Load ride object
|
||||||
if (td6->vehicleObject.HasValue())
|
if (td->vehicleObject.HasValue())
|
||||||
{
|
{
|
||||||
objectManager.LoadObject(td6->vehicleObject);
|
objectManager.LoadObject(td->vehicleObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load scenery objects
|
// Load scenery objects
|
||||||
for (const auto& scenery : td6->sceneryElements)
|
for (const auto& scenery : td->sceneryElements)
|
||||||
{
|
{
|
||||||
if (scenery.sceneryObject.HasValue())
|
if (scenery.sceneryObject.HasValue())
|
||||||
{
|
{
|
||||||
@@ -753,10 +753,10 @@ static std::optional<TrackSceneryEntry> TrackDesignPlaceSceneryElementGetEntry(c
|
|||||||
*
|
*
|
||||||
* rct2: 0x006D247A
|
* rct2: 0x006D247A
|
||||||
*/
|
*/
|
||||||
static void TrackDesignMirrorScenery(TrackDesign* td6)
|
static void TrackDesignMirrorScenery(TrackDesign* td)
|
||||||
{
|
{
|
||||||
auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||||
for (auto& scenery : td6->sceneryElements)
|
for (auto& scenery : td->sceneryElements)
|
||||||
{
|
{
|
||||||
auto entryInfo = TrackDesignPlaceSceneryElementGetEntry(scenery);
|
auto entryInfo = TrackDesignPlaceSceneryElementGetEntry(scenery);
|
||||||
if (!entryInfo)
|
if (!entryInfo)
|
||||||
@@ -871,9 +871,9 @@ static void TrackDesignMirrorEntrances(TrackDesign& td)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006D2443
|
* rct2: 0x006D2443
|
||||||
*/
|
*/
|
||||||
static void TrackDesignMirrorRide(TrackDesign* td6)
|
static void TrackDesignMirrorRide(TrackDesign* td)
|
||||||
{
|
{
|
||||||
for (auto& track : td6->trackElements)
|
for (auto& track : td->trackElements)
|
||||||
{
|
{
|
||||||
const auto& ted = GetTrackElementDescriptor(track.type);
|
const auto& ted = GetTrackElementDescriptor(track.type);
|
||||||
track.type = ted.MirrorElement;
|
track.type = ted.MirrorElement;
|
||||||
@@ -889,9 +889,9 @@ static constexpr uint8_t maze_segment_mirror_map[] = {
|
|||||||
*
|
*
|
||||||
* rct2: 0x006D25FA
|
* rct2: 0x006D25FA
|
||||||
*/
|
*/
|
||||||
static void TrackDesignMirrorMaze(TrackDesign* td6)
|
static void TrackDesignMirrorMaze(TrackDesign* td)
|
||||||
{
|
{
|
||||||
for (auto& maze : td6->mazeElements)
|
for (auto& maze : td->mazeElements)
|
||||||
{
|
{
|
||||||
maze.location.y = -maze.location.y;
|
maze.location.y = -maze.location.y;
|
||||||
|
|
||||||
@@ -910,19 +910,19 @@ static void TrackDesignMirrorMaze(TrackDesign* td6)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006D2436
|
* rct2: 0x006D2436
|
||||||
*/
|
*/
|
||||||
void TrackDesignMirror(TrackDesign* td6)
|
void TrackDesignMirror(TrackDesign* td)
|
||||||
{
|
{
|
||||||
const auto& rtd = GetRideTypeDescriptor(td6->type);
|
const auto& rtd = GetRideTypeDescriptor(td->type);
|
||||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||||
{
|
{
|
||||||
TrackDesignMirrorMaze(td6);
|
TrackDesignMirrorMaze(td);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TrackDesignMirrorRide(td6);
|
TrackDesignMirrorRide(td);
|
||||||
}
|
}
|
||||||
TrackDesignMirrorEntrances(*td6);
|
TrackDesignMirrorEntrances(*td);
|
||||||
TrackDesignMirrorScenery(td6);
|
TrackDesignMirrorScenery(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TrackDesignAddSelectedTile(const CoordsXY& coords)
|
static void TrackDesignAddSelectedTile(const CoordsXY& coords)
|
||||||
@@ -1548,7 +1548,7 @@ static GameActions::Result TrackDesignPlaceMaze(
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesign* td6, const CoordsXYZ& origin, Ride& ride)
|
static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesign* td, const CoordsXYZ& origin, Ride& ride)
|
||||||
{
|
{
|
||||||
tds.origin = origin;
|
tds.origin = origin;
|
||||||
if (tds.placeOperation == TrackPlaceOperation::drawOutlines)
|
if (tds.placeOperation == TrackPlaceOperation::drawOutlines)
|
||||||
@@ -1564,7 +1564,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi
|
|||||||
|
|
||||||
// Track elements
|
// Track elements
|
||||||
auto newCoords = origin;
|
auto newCoords = origin;
|
||||||
for (const auto& track : td6->trackElements)
|
for (const auto& track : td->trackElements)
|
||||||
{
|
{
|
||||||
auto trackType = track.type;
|
auto trackType = track.type;
|
||||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||||
@@ -1710,7 +1710,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = TrackDesignPlaceEntrances(tds, *td6, newCoords, ride.id, totalCost);
|
auto result = TrackDesignPlaceEntrances(tds, *td, newCoords, ride.id, totalCost);
|
||||||
if (result.has_value())
|
if (result.has_value())
|
||||||
{
|
{
|
||||||
return result.value();
|
return result.value();
|
||||||
@@ -1742,7 +1742,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi
|
|||||||
* rct2: 0x006D01B3
|
* rct2: 0x006D01B3
|
||||||
*/
|
*/
|
||||||
static GameActions::Result TrackDesignPlaceVirtual(
|
static GameActions::Result TrackDesignPlaceVirtual(
|
||||||
TrackDesignState& tds, TrackDesign* td6, TrackPlaceOperation ptdOperation, bool placeScenery, Ride& ride,
|
TrackDesignState& tds, TrackDesign* td, TrackPlaceOperation ptdOperation, bool placeScenery, Ride& ride,
|
||||||
const CoordsXYZD& coords, bool isReplay = false)
|
const CoordsXYZD& coords, bool isReplay = false)
|
||||||
{
|
{
|
||||||
_trackDesignPlaceStateSceneryUnavailable = false;
|
_trackDesignPlaceStateSceneryUnavailable = false;
|
||||||
@@ -1771,14 +1771,14 @@ static GameActions::Result TrackDesignPlaceVirtual(
|
|||||||
_currentTrackPieceDirection = coords.direction;
|
_currentTrackPieceDirection = coords.direction;
|
||||||
|
|
||||||
GameActions::Result trackPlaceRes;
|
GameActions::Result trackPlaceRes;
|
||||||
const auto& rtd = GetRideTypeDescriptor(td6->type);
|
const auto& rtd = GetRideTypeDescriptor(td->type);
|
||||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||||
{
|
{
|
||||||
trackPlaceRes = TrackDesignPlaceMaze(tds, *td6, coords, ride);
|
trackPlaceRes = TrackDesignPlaceMaze(tds, *td, coords, ride);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trackPlaceRes = TrackDesignPlaceRide(tds, td6, coords, ride);
|
trackPlaceRes = TrackDesignPlaceRide(tds, td, coords, ride);
|
||||||
}
|
}
|
||||||
_currentRideIndex = savedRideId;
|
_currentRideIndex = savedRideId;
|
||||||
_currentTrackPieceDirection = savedTrackPieceDirection;
|
_currentTrackPieceDirection = savedTrackPieceDirection;
|
||||||
@@ -1789,7 +1789,7 @@ static GameActions::Result TrackDesignPlaceVirtual(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Scenery elements
|
// Scenery elements
|
||||||
auto sceneryPlaceRes = TrackDesignPlaceAllScenery(tds, td6->sceneryElements, coords.direction);
|
auto sceneryPlaceRes = TrackDesignPlaceAllScenery(tds, td->sceneryElements, coords.direction);
|
||||||
if (sceneryPlaceRes.Error != GameActions::Status::Ok)
|
if (sceneryPlaceRes.Error != GameActions::Status::Ok)
|
||||||
{
|
{
|
||||||
return sceneryPlaceRes;
|
return sceneryPlaceRes;
|
||||||
@@ -1810,7 +1810,7 @@ static GameActions::Result TrackDesignPlaceVirtual(
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameActions::Result TrackDesignPlace(TrackDesign* td6, uint32_t flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords)
|
GameActions::Result TrackDesignPlace(TrackDesign* td, uint32_t flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords)
|
||||||
{
|
{
|
||||||
TrackPlaceOperation ptdOperation = (flags & GAME_COMMAND_FLAG_APPLY) != 0 ? TrackPlaceOperation::place
|
TrackPlaceOperation ptdOperation = (flags & GAME_COMMAND_FLAG_APPLY) != 0 ? TrackPlaceOperation::place
|
||||||
: TrackPlaceOperation::placeQuery;
|
: TrackPlaceOperation::placeQuery;
|
||||||
@@ -1821,33 +1821,33 @@ GameActions::Result TrackDesignPlace(TrackDesign* td6, uint32_t flags, bool plac
|
|||||||
bool isReplay = flags & GAME_COMMAND_FLAG_REPLAY;
|
bool isReplay = flags & GAME_COMMAND_FLAG_REPLAY;
|
||||||
|
|
||||||
TrackDesignState tds{};
|
TrackDesignState tds{};
|
||||||
return TrackDesignPlaceVirtual(tds, td6, ptdOperation, placeScenery, ride, coords, isReplay);
|
return TrackDesignPlaceVirtual(tds, td, ptdOperation, placeScenery, ride, coords, isReplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackDesignPreviewRemoveGhosts(TrackDesign* td6, Ride& ride, const CoordsXYZD& coords)
|
void TrackDesignPreviewRemoveGhosts(TrackDesign* td, Ride& ride, const CoordsXYZD& coords)
|
||||||
{
|
{
|
||||||
TrackDesignState tds{};
|
TrackDesignState tds{};
|
||||||
TrackDesignPlaceVirtual(tds, td6, TrackPlaceOperation::removeGhost, true, ride, coords);
|
TrackDesignPlaceVirtual(tds, td, TrackPlaceOperation::removeGhost, true, ride, coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, TrackDesign* td6, Ride& ride, const CoordsXYZD& coords)
|
void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, TrackDesign* td, Ride& ride, const CoordsXYZD& coords)
|
||||||
{
|
{
|
||||||
TrackDesignPlaceVirtual(tds, td6, TrackPlaceOperation::drawOutlines, true, ride, coords);
|
TrackDesignPlaceVirtual(tds, td, TrackPlaceOperation::drawOutlines, true, ride, coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t TrackDesignGetZPlacement(TrackDesignState& tds, TrackDesign* td6, Ride& ride, const CoordsXYZD& coords)
|
static int32_t TrackDesignGetZPlacement(TrackDesignState& tds, TrackDesign* td, Ride& ride, const CoordsXYZD& coords)
|
||||||
{
|
{
|
||||||
TrackDesignPlaceVirtual(tds, td6, TrackPlaceOperation::getPlaceZ, true, ride, coords);
|
TrackDesignPlaceVirtual(tds, td, TrackPlaceOperation::getPlaceZ, true, ride, coords);
|
||||||
|
|
||||||
// Change from vanilla: originally, _trackDesignPlaceSceneryZ was not subtracted
|
// Change from vanilla: originally, _trackDesignPlaceSceneryZ was not subtracted
|
||||||
// from _trackDesignPlaceZ, causing bug #259.
|
// from _trackDesignPlaceZ, causing bug #259.
|
||||||
return tds.placeZ - tds.placeSceneryZ;
|
return tds.placeZ - tds.placeSceneryZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TrackDesignGetZPlacement(TrackDesign* td6, Ride& ride, const CoordsXYZD& coords)
|
int32_t TrackDesignGetZPlacement(TrackDesign* td, Ride& ride, const CoordsXYZD& coords)
|
||||||
{
|
{
|
||||||
TrackDesignState tds{};
|
TrackDesignState tds{};
|
||||||
return TrackDesignGetZPlacement(tds, td6, ride, coords);
|
return TrackDesignGetZPlacement(tds, td, ride, coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static money64 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, RideId* outRideIndex)
|
static money64 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, RideId* outRideIndex)
|
||||||
@@ -1875,18 +1875,18 @@ static money64 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flag
|
|||||||
* ebx = ride_id
|
* ebx = ride_id
|
||||||
* cost = edi
|
* cost = edi
|
||||||
*/
|
*/
|
||||||
static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, money64* cost, Ride** outRide, uint8_t* flags)
|
static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td, money64* cost, Ride** outRide, uint8_t* flags)
|
||||||
{
|
{
|
||||||
*outRide = nullptr;
|
*outRide = nullptr;
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
|
|
||||||
auto& gameState = GetGameState();
|
auto& gameState = GetGameState();
|
||||||
auto& objManager = GetContext()->GetObjectManager();
|
auto& objManager = GetContext()->GetObjectManager();
|
||||||
auto entry_index = objManager.GetLoadedObjectEntryIndex(td6->vehicleObject);
|
auto entry_index = objManager.GetLoadedObjectEntryIndex(td->vehicleObject);
|
||||||
|
|
||||||
RideId rideIndex;
|
RideId rideIndex;
|
||||||
uint8_t rideCreateFlags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND;
|
uint8_t rideCreateFlags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND;
|
||||||
if (TrackDesignCreateRide(td6->type, entry_index, rideCreateFlags, &rideIndex) == kMoney64Undefined)
|
if (TrackDesignCreateRide(td->type, entry_index, rideCreateFlags, &rideIndex) == kMoney64Undefined)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1897,24 +1897,24 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon
|
|||||||
|
|
||||||
ride->custom_name = {};
|
ride->custom_name = {};
|
||||||
|
|
||||||
ride->entrance_style = objManager.GetLoadedObjectEntryIndex(td6->appearance.stationObjectIdentifier);
|
ride->entrance_style = objManager.GetLoadedObjectEntryIndex(td->appearance.stationObjectIdentifier);
|
||||||
if (ride->entrance_style == OBJECT_ENTRY_INDEX_NULL)
|
if (ride->entrance_style == OBJECT_ENTRY_INDEX_NULL)
|
||||||
{
|
{
|
||||||
ride->entrance_style = gameState.LastEntranceStyle;
|
ride->entrance_style = gameState.LastEntranceStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < std::min(std::size(ride->track_colour), std::size(td6->appearance.trackColours)); i++)
|
for (size_t i = 0; i < std::min(std::size(ride->track_colour), std::size(td->appearance.trackColours)); i++)
|
||||||
{
|
{
|
||||||
ride->track_colour[i] = td6->appearance.trackColours[i];
|
ride->track_colour[i] = td->appearance.trackColours[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flat rides need their vehicle colours loaded for display
|
// Flat rides need their vehicle colours loaded for display
|
||||||
// in the preview window
|
// in the preview window
|
||||||
if (!GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
if (!GetRideTypeDescriptor(td->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < std::size(ride->vehicle_colours); i++)
|
for (size_t i = 0; i < std::size(ride->vehicle_colours); i++)
|
||||||
{
|
{
|
||||||
ride->vehicle_colours[i] = td6->appearance.vehicleColours[i];
|
ride->vehicle_colours[i] = td->appearance.vehicleColours[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1926,7 +1926,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon
|
|||||||
|
|
||||||
_currentTrackPieceDirection = 0;
|
_currentTrackPieceDirection = 0;
|
||||||
int32_t z = TrackDesignGetZPlacement(
|
int32_t z = TrackDesignGetZPlacement(
|
||||||
tds, td6, RideGetTemporaryForPreview(), { mapSize.x, mapSize.y, 16, _currentTrackPieceDirection });
|
tds, td, RideGetTemporaryForPreview(), { mapSize.x, mapSize.y, 16, _currentTrackPieceDirection });
|
||||||
|
|
||||||
if (tds.hasScenery)
|
if (tds.hasScenery)
|
||||||
{
|
{
|
||||||
@@ -1943,7 +1943,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto res = TrackDesignPlaceVirtual(
|
auto res = TrackDesignPlaceVirtual(
|
||||||
tds, td6, TrackPlaceOperation::placeTrackPreview, placeScenery, *ride,
|
tds, td, TrackPlaceOperation::placeTrackPreview, placeScenery, *ride,
|
||||||
{ mapSize.x, mapSize.y, z, _currentTrackPieceDirection });
|
{ mapSize.x, mapSize.y, z, _currentTrackPieceDirection });
|
||||||
gameState.Park.Flags = backup_park_flags;
|
gameState.Park.Flags = backup_park_flags;
|
||||||
|
|
||||||
@@ -2060,14 +2060,14 @@ bool TrackDesignSceneryElement::operator!=(const TrackDesignSceneryElement& rhs)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006D1EF0
|
* rct2: 0x006D1EF0
|
||||||
*/
|
*/
|
||||||
void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels)
|
void TrackDesignDrawPreview(TrackDesign* td, uint8_t* pixels)
|
||||||
{
|
{
|
||||||
StashMap();
|
StashMap();
|
||||||
TrackDesignPreviewClearMap();
|
TrackDesignPreviewClearMap();
|
||||||
|
|
||||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)
|
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)
|
||||||
{
|
{
|
||||||
TrackDesignLoadSceneryObjects(td6);
|
TrackDesignLoadSceneryObjects(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackDesignState tds{};
|
TrackDesignState tds{};
|
||||||
@@ -2075,14 +2075,14 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels)
|
|||||||
money64 cost;
|
money64 cost;
|
||||||
Ride* ride;
|
Ride* ride;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
if (!TrackDesignPlacePreview(tds, td6, &cost, &ride, &flags))
|
if (!TrackDesignPlacePreview(tds, td, &cost, &ride, &flags))
|
||||||
{
|
{
|
||||||
std::fill_n(pixels, kTrackPreviewImageSize * 4, 0x00);
|
std::fill_n(pixels, kTrackPreviewImageSize * 4, 0x00);
|
||||||
UnstashMap();
|
UnstashMap();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
td6->cost = cost;
|
td->cost = cost;
|
||||||
td6->trackFlags = flags & 7;
|
td->trackFlags = flags & 7;
|
||||||
|
|
||||||
CoordsXYZ centre = { (tds.previewMin.x + tds.previewMax.x) / 2 + 16, (tds.previewMin.y + tds.previewMax.y) / 2 + 16,
|
CoordsXYZ centre = { (tds.previewMin.x + tds.previewMax.x) / 2 + 16, (tds.previewMin.y + tds.previewMax.y) / 2 + 16,
|
||||||
(tds.previewMin.z + tds.previewMax.z) / 2 };
|
(tds.previewMin.z + tds.previewMax.z) / 2 };
|
||||||
@@ -2093,7 +2093,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels)
|
|||||||
|
|
||||||
// Special case for flat rides - Z-axis info is irrelevant
|
// Special case for flat rides - Z-axis info is irrelevant
|
||||||
// and must be zeroed out lest the preview be off-centre
|
// and must be zeroed out lest the preview be off-centre
|
||||||
if (!GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
if (!GetRideTypeDescriptor(td->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||||
{
|
{
|
||||||
centre.z = 0;
|
centre.z = 0;
|
||||||
size_z = 0;
|
size_z = 0;
|
||||||
|
|||||||
@@ -230,17 +230,17 @@ extern RideId gTrackDesignSaveRideIndex;
|
|||||||
|
|
||||||
[[nodiscard]] std::unique_ptr<TrackDesign> TrackDesignImport(const utf8* path);
|
[[nodiscard]] std::unique_ptr<TrackDesign> TrackDesignImport(const utf8* path);
|
||||||
|
|
||||||
void TrackDesignMirror(TrackDesign* td6);
|
void TrackDesignMirror(TrackDesign* td);
|
||||||
|
|
||||||
GameActions::Result TrackDesignPlace(TrackDesign* td6, uint32_t flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords);
|
GameActions::Result TrackDesignPlace(TrackDesign* td, uint32_t flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords);
|
||||||
void TrackDesignPreviewRemoveGhosts(TrackDesign* td6, Ride& ride, const CoordsXYZD& coords);
|
void TrackDesignPreviewRemoveGhosts(TrackDesign* td, Ride& ride, const CoordsXYZD& coords);
|
||||||
void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, TrackDesign* td6, Ride& ride, const CoordsXYZD& coords);
|
void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, TrackDesign* td, Ride& ride, const CoordsXYZD& coords);
|
||||||
int32_t TrackDesignGetZPlacement(TrackDesign* td6, Ride& ride, const CoordsXYZD& coords);
|
int32_t TrackDesignGetZPlacement(TrackDesign* td, Ride& ride, const CoordsXYZD& coords);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Track design preview
|
// Track design preview
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels);
|
void TrackDesignDrawPreview(TrackDesign* td, uint8_t* pixels);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Track design saving
|
// Track design saving
|
||||||
|
|||||||
@@ -73,14 +73,14 @@ public:
|
|||||||
public:
|
public:
|
||||||
std::optional<TrackRepositoryItem> Create(int32_t, const std::string& path) const override
|
std::optional<TrackRepositoryItem> Create(int32_t, const std::string& path) const override
|
||||||
{
|
{
|
||||||
auto td6 = TrackDesignImport(path.c_str());
|
auto td = TrackDesignImport(path.c_str());
|
||||||
if (td6 != nullptr)
|
if (td != nullptr)
|
||||||
{
|
{
|
||||||
TrackRepositoryItem item;
|
TrackRepositoryItem item;
|
||||||
item.Name = GetNameFromTrackPath(path);
|
item.Name = GetNameFromTrackPath(path);
|
||||||
item.Path = path;
|
item.Path = path;
|
||||||
item.RideType = td6->type;
|
item.RideType = td->type;
|
||||||
item.ObjectEntry = std::string(td6->vehicleObject.Entry.name, 8);
|
item.ObjectEntry = std::string(td->vehicleObject.Entry.name, 8);
|
||||||
item.Flags = 0;
|
item.Flags = 0;
|
||||||
if (IsTrackReadOnly(path))
|
if (IsTrackReadOnly(path))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user