1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00

Merge remote-tracking branch 'upstream/develop' into new-save-format

This commit is contained in:
ζeh Matt
2021-10-16 16:50:16 +03:00
7 changed files with 19 additions and 42 deletions

View File

@@ -34,6 +34,7 @@
- Fix: [#15377] Entrance/exit ghost doesn't work on different stations without touching them first.
- Fix: [#15476] Crash when placing/clearing small scenery.
- Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2.
- Fix: [#15490] Tile inspector needlessly updates clearance height when changing surface slopes.
- Fix: [#15496] Crash in paint_swinging_inverter_ship_structure().
- Fix: [#15503] Freeze when doing specific coaster merges with block brakes.
- Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager.

View File

@@ -155,7 +155,7 @@ static void move_research_item(ResearchItem* beforeItem, int32_t scrollIndex)
w->Invalidate();
}
research_remove(&_editorInventionsListDraggedItem);
ResearchRemove(_editorInventionsListDraggedItem);
auto& researchList = scrollIndex == 0 ? gResearchItemsInvented : gResearchItemsUninvented;
if (beforeItem != nullptr)

View File

@@ -346,7 +346,7 @@ static void remove_selected_objects_from_research(const ObjectEntryDescriptor& d
tmp.type = Research::EntryType::Ride;
tmp.entryIndex = entryIndex;
tmp.baseRideType = rideType;
research_remove(&tmp);
ResearchRemove(tmp);
}
break;
}
@@ -355,7 +355,7 @@ static void remove_selected_objects_from_research(const ObjectEntryDescriptor& d
ResearchItem tmp = {};
tmp.type = Research::EntryType::Scenery;
tmp.entryIndex = entryIndex;
research_remove(&tmp);
ResearchRemove(tmp);
break;
}
default:

View File

@@ -421,12 +421,12 @@ static void research_insert_researched(ResearchItem&& item)
*
* rct2: 0x006857CF
*/
void research_remove(ResearchItem* researchItem)
void ResearchRemove(const ResearchItem& researchItem)
{
for (auto it = gResearchItemsUninvented.begin(); it != gResearchItemsUninvented.end(); it++)
{
auto& researchItem2 = *it;
if (researchItem2 == *researchItem)
if (researchItem2 == researchItem)
{
gResearchItemsUninvented.erase(it);
return;
@@ -435,7 +435,7 @@ void research_remove(ResearchItem* researchItem)
for (auto it = gResearchItemsInvented.begin(); it != gResearchItemsInvented.end(); it++)
{
auto& researchItem2 = *it;
if (researchItem2 == *researchItem)
if (researchItem2 == researchItem)
{
gResearchItemsInvented.erase(it);
return;

View File

@@ -176,7 +176,7 @@ void research_populate_list_random();
void research_finish_item(ResearchItem* researchItem);
void research_insert(ResearchItem&& item, bool researched);
void research_remove(ResearchItem* researchItem);
void ResearchRemove(const ResearchItem& researchItem);
bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, ResearchCategory category, bool researched);
void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched);

View File

@@ -651,7 +651,7 @@ static void track_design_load_scenery_objects(TrackDesign* td6)
{
if (scenery.scenery_object.HasValue())
{
objectManager.LoadObject(td6->vehicle_object);
objectManager.LoadObject(scenery.scenery_object);
}
}
}

View File

@@ -544,49 +544,37 @@ namespace OpenRCT2::TileInspector
if (isExecuting)
{
const uint8_t originalSlope = surfaceElement->GetSlope();
const bool diagonal = (originalSlope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) >> 4;
uint8_t newSlope = surfaceElement->GetSlope() ^ (1 << cornerIndex);
surfaceElement->SetSlope(newSlope);
if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
{
surfaceElement->clearance_height = surfaceElement->base_height + 2;
}
else
{
surfaceElement->clearance_height = surfaceElement->base_height;
}
// All corners are raised
if ((surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) == TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
if ((newSlope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) == TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
{
uint8_t slope = TILE_ELEMENT_SLOPE_FLAT;
if (diagonal)
newSlope = TILE_ELEMENT_SLOPE_FLAT;
if ((originalSlope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) != 0)
{
switch (originalSlope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
{
case TILE_ELEMENT_SLOPE_S_CORNER_DN:
slope |= TILE_ELEMENT_SLOPE_N_CORNER_UP;
newSlope |= TILE_ELEMENT_SLOPE_N_CORNER_UP;
break;
case TILE_ELEMENT_SLOPE_W_CORNER_DN:
slope |= TILE_ELEMENT_SLOPE_E_CORNER_UP;
newSlope |= TILE_ELEMENT_SLOPE_E_CORNER_UP;
break;
case TILE_ELEMENT_SLOPE_N_CORNER_DN:
slope |= TILE_ELEMENT_SLOPE_S_CORNER_UP;
newSlope |= TILE_ELEMENT_SLOPE_S_CORNER_UP;
break;
case TILE_ELEMENT_SLOPE_E_CORNER_DN:
slope |= TILE_ELEMENT_SLOPE_W_CORNER_UP;
newSlope |= TILE_ELEMENT_SLOPE_W_CORNER_UP;
break;
}
}
surfaceElement->SetSlope(slope);
// Update base and clearance heights
surfaceElement->base_height += 2;
surfaceElement->clearance_height = surfaceElement->base_height + (diagonal ? 2 : 0);
surfaceElement->clearance_height = surfaceElement->base_height;
}
surfaceElement->SetSlope(newSlope);
map_invalidate_tile_full(loc);
if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr)
@@ -610,18 +598,6 @@ namespace OpenRCT2::TileInspector
{
uint8_t newSlope = surfaceElement->GetSlope() ^ TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT;
surfaceElement->SetSlope(newSlope);
if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT)
{
surfaceElement->clearance_height = surfaceElement->base_height + 4;
}
else if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP)
{
surfaceElement->clearance_height = surfaceElement->base_height + 2;
}
else
{
surfaceElement->clearance_height = surfaceElement->base_height;
}
map_invalidate_tile_full(loc);