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

Auto create map animations

This commit is contained in:
Ted John
2018-12-30 02:17:33 +00:00
parent c4b32adada
commit a1de07218f

View File

@@ -110,6 +110,8 @@ namespace OpenRCT2
gInitialCash = gCash;
String::Set(gS6Info.name, sizeof(gS6Info.name), gScenarioName.c_str());
String::Set(gS6Info.details, sizeof(gS6Info.details), gScenarioName.c_str());
AutoCreateMapAnimations();
}
void Save(const std::string_view& path)
@@ -459,6 +461,28 @@ namespace OpenRCT2
}
}
void AutoCreateMapAnimations()
{
// Automatically create map animations from tile elements
// TODO this should also be done when importing S4 and S6 files
tile_element_iterator it;
tile_element_iterator_begin(&it);
while (tile_element_iterator_next(&it))
{
auto el = it.element;
switch (el->GetType())
{
case TILE_ELEMENT_TYPE_ENTRANCE:
auto entrance = el->AsEntrance();
if (entrance->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE && entrance->GetSequenceIndex() == 0)
{
map_animation_create(MAP_ANIMATION_TYPE_PARK_ENTRANCE, it.x * 32, it.y * 32, entrance->base_height);
}
break;
}
}
}
static void ReadWriteStringTable(OrcaStream::ChunkStream& cs, std::string& value, const std::string_view& lcode)
{
std::vector<std::tuple<std::string, std::string>> table;