2015-03-18 19:52:27 +00:00
|
|
|
/*****************************************************************************
|
2020-07-21 15:04:34 +02:00
|
|
|
* Copyright (c) 2014-2020 OpenRCT2 developers
|
2015-03-18 19:52:27 +00:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2015-03-18 19:52:27 +00:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2015-03-18 19:52:27 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
#include "MapAnimation.h"
|
2018-03-14 12:44:16 +01:00
|
|
|
|
2018-12-05 20:33:45 +00:00
|
|
|
#include "../Context.h"
|
2017-11-30 18:17:06 +01:00
|
|
|
#include "../Game.h"
|
2021-11-24 16:48:33 +02:00
|
|
|
#include "../entity/EntityList.h"
|
2021-11-25 23:47:24 +02:00
|
|
|
#include "../entity/Peep.h"
|
2018-06-22 23:17:03 +02:00
|
|
|
#include "../interface/Viewport.h"
|
2018-12-05 20:33:45 +00:00
|
|
|
#include "../object/StationObject.h"
|
2017-12-31 13:21:34 +01:00
|
|
|
#include "../ride/Ride.h"
|
2018-01-10 00:00:09 +01:00
|
|
|
#include "../ride/RideData.h"
|
2017-10-17 13:51:47 +02:00
|
|
|
#include "../ride/Track.h"
|
2018-05-01 17:47:00 +02:00
|
|
|
#include "../world/Wall.h"
|
2019-02-14 22:41:48 +01:00
|
|
|
#include "Banner.h"
|
2018-06-22 23:17:03 +02:00
|
|
|
#include "Footpath.h"
|
2018-09-14 12:12:22 +02:00
|
|
|
#include "LargeScenery.h"
|
2018-01-03 14:56:08 +01:00
|
|
|
#include "Map.h"
|
2018-01-11 10:59:26 +01:00
|
|
|
#include "Scenery.h"
|
2017-12-04 20:09:38 +01:00
|
|
|
#include "SmallScenery.h"
|
2018-06-22 23:17:03 +02:00
|
|
|
|
2020-02-29 00:30:50 -03:00
|
|
|
using map_animation_invalidate_event_handler = bool (*)(const CoordsXYZ& loc);
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-08-03 21:18:33 +01:00
|
|
|
static std::vector<MapAnimation> _mapAnimations;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-08-03 21:18:33 +01:00
|
|
|
constexpr size_t MAX_ANIMATED_OBJECTS = 2000;
|
|
|
|
|
|
|
|
|
|
static bool InvalidateMapAnimation(const MapAnimation& obj);
|
|
|
|
|
|
|
|
|
|
static bool DoesAnimationExist(int32_t type, const CoordsXYZ& location)
|
|
|
|
|
{
|
|
|
|
|
for (const auto& a : _mapAnimations)
|
|
|
|
|
{
|
2019-12-19 18:58:33 +00:00
|
|
|
if (a.type == type && a.location == location)
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
// Animation already exists
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2020-02-29 00:30:50 -03:00
|
|
|
void map_animation_create(int32_t type, const CoordsXYZ& loc)
|
2015-03-22 01:19:23 +00:00
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
if (!DoesAnimationExist(type, loc))
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-08-03 21:18:33 +01:00
|
|
|
if (_mapAnimations.size() < MAX_ANIMATED_OBJECTS)
|
|
|
|
|
{
|
|
|
|
|
// Create new animation
|
2020-04-17 16:08:22 -03:00
|
|
|
_mapAnimations.push_back({ static_cast<uint8_t>(type), loc });
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
log_error("Exceeded the maximum number of animations");
|
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
2015-03-18 19:52:27 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x0068AFAD
|
|
|
|
|
*/
|
|
|
|
|
void map_animation_invalidate_all()
|
|
|
|
|
{
|
2019-08-03 21:18:33 +01:00
|
|
|
auto it = _mapAnimations.begin();
|
|
|
|
|
while (it != _mapAnimations.end())
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-08-03 21:18:33 +01:00
|
|
|
if (InvalidateMapAnimation(*it))
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-08-03 21:18:33 +01:00
|
|
|
// Map animation has finished, remove it
|
|
|
|
|
it = _mapAnimations.erase(it);
|
2018-06-22 23:17:03 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-08-03 21:18:33 +01:00
|
|
|
it++;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x00666670
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_ride_entrance(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2019-12-23 04:35:41 -03:00
|
|
|
auto tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Entrance)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2018-09-26 12:13:44 +02:00
|
|
|
if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2018-12-05 20:33:45 +00:00
|
|
|
auto ride = get_ride(tileElement->AsEntrance()->GetRideIndex());
|
|
|
|
|
if (ride != nullptr)
|
|
|
|
|
{
|
2021-12-18 18:48:52 +01:00
|
|
|
auto stationObj = ride->GetStationObject();
|
2018-12-05 20:33:45 +00:00
|
|
|
if (stationObj != nullptr)
|
|
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
int32_t height = loc.z + stationObj->Height + 8;
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, height, height + 16 });
|
2018-12-05 20:33:45 +00:00
|
|
|
}
|
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006A7BD4
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_queue_banner(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Path)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2019-08-24 22:41:01 +02:00
|
|
|
if (!(tileElement->AsPath()->IsQueue()))
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2018-09-16 16:32:06 +02:00
|
|
|
if (!tileElement->AsPath()->HasQueueBanner())
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2018-09-16 17:24:49 +02:00
|
|
|
int32_t direction = (tileElement->AsPath()->GetQueueBannerDirection() + get_current_rotation()) & 3;
|
2018-06-22 23:17:03 +02:00
|
|
|
if (direction == TILE_ELEMENT_DIRECTION_NORTH || direction == TILE_ELEMENT_DIRECTION_EAST)
|
|
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z + 16, loc.z + 30 });
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
return false;
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006E32C9
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2020-06-06 11:32:37 +01:00
|
|
|
auto tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::SmallScenery)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2019-02-26 10:09:58 +00:00
|
|
|
if (tileElement->IsGhost())
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2021-06-04 02:14:41 +01:00
|
|
|
auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry();
|
2019-02-05 11:02:22 -08:00
|
|
|
if (sceneryEntry == nullptr)
|
|
|
|
|
continue;
|
|
|
|
|
|
2021-10-01 21:50:05 +02:00
|
|
|
if (sceneryEntry->HasFlag(
|
2018-06-22 23:17:03 +02:00
|
|
|
SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_1 | SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_4 | SMALL_SCENERY_FLAG_SWAMP_GOO
|
2021-10-01 21:50:05 +02:00
|
|
|
| SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS))
|
2017-12-04 20:09:38 +01:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2021-10-01 21:50:05 +02:00
|
|
|
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_CLOCK))
|
2017-12-04 20:09:38 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// Peep, looking at scenery
|
2018-06-22 23:17:03 +02:00
|
|
|
if (!(gCurrentTicks & 0x3FF) && game_is_not_paused())
|
|
|
|
|
{
|
2018-09-14 11:14:19 +02:00
|
|
|
int32_t direction = tileElement->GetDirection();
|
2020-06-08 20:13:50 +01:00
|
|
|
auto quad = EntityTileList<Peep>(CoordsXY{ loc } - CoordsDirectionDelta[direction]);
|
|
|
|
|
for (auto peep : quad)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2020-09-28 20:51:49 +02:00
|
|
|
if (peep->State != PeepState::Walking)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2019-12-19 18:38:46 +00:00
|
|
|
if (peep->z != loc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-05-11 09:44:41 +03:00
|
|
|
if (peep->Action < PeepActionType::Idle)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2020-09-30 18:19:10 -03:00
|
|
|
peep->Action = PeepActionType::CheckTime;
|
2020-06-07 20:18:42 -03:00
|
|
|
peep->ActionFrame = 0;
|
2020-06-07 20:23:21 -03:00
|
|
|
peep->ActionSpriteImageOffset = 0;
|
2018-04-01 20:35:41 +01:00
|
|
|
peep->UpdateCurrentActionSpriteType();
|
2020-12-31 18:43:48 +02:00
|
|
|
peep->Invalidate();
|
2017-06-06 23:24:18 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2017-10-15 15:53:16 +02:00
|
|
|
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x00666C63
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_park_entrance(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Entrance)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2018-09-26 12:13:44 +02:00
|
|
|
if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2018-09-26 12:54:44 +02:00
|
|
|
if (tileElement->AsEntrance()->GetSequenceIndex())
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z + 32, loc.z + 64 });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
2015-03-22 01:19:23 +00:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006CE29E
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_track_waterfall(const CoordsXYZ& loc)
|
2015-03-22 01:19:23 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Track)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2020-08-18 07:28:41 +01:00
|
|
|
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Waterfall)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 46 });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006CE2F3
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_track_rapids(const CoordsXYZ& loc)
|
2015-03-22 01:19:23 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Track)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2020-08-18 07:28:41 +01:00
|
|
|
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Rapids)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 18 });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006CE39D
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc)
|
2015-03-22 01:19:23 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Track)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2020-08-18 07:28:41 +01:00
|
|
|
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::OnRidePhoto)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() });
|
2018-06-22 23:17:03 +02:00
|
|
|
if (game_is_paused())
|
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2018-09-18 13:49:58 +02:00
|
|
|
if (tileElement->AsTrack()->IsTakingPhoto())
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2018-09-18 13:49:58 +02:00
|
|
|
tileElement->AsTrack()->DecrementPhotoTimeout();
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
2018-06-22 23:17:03 +02:00
|
|
|
}
|
2021-09-15 22:22:15 +02:00
|
|
|
|
|
|
|
|
return true;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006CE348
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_track_whirlpool(const CoordsXYZ& loc)
|
2015-03-22 01:19:23 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-13 09:24:19 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Track)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2020-08-18 07:28:41 +01:00
|
|
|
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Whirlpool)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 18 });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006CE3FA
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_track_spinningtunnel(const CoordsXYZ& loc)
|
2015-03-22 01:19:23 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Track)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2020-08-18 07:28:41 +01:00
|
|
|
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::SpinningTunnel)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 32 });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-22 01:19:23 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
2015-03-18 19:52:27 +00:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x0068DF8F
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_remove([[maybe_unused]] const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006BA2BB
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_banner(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Banner)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 });
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return true;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006B94EB
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
bool wasInvalidated = false;
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::LargeScenery)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2021-06-04 12:41:23 +01:00
|
|
|
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
|
|
|
|
|
if (sceneryEntry->flags & LARGE_SCENERY_FLAG_ANIMATED)
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 });
|
2017-06-06 23:24:18 +02:00
|
|
|
wasInvalidated = true;
|
|
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return !wasInvalidated;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006E5B50
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
if (gCurrentTicks & 1)
|
|
|
|
|
return false;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
bool removeAnimation = true;
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return removeAnimation;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Wall)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2021-06-03 13:26:00 +01:00
|
|
|
auto* wallEntry = tileElement->AsWall()->GetEntry();
|
|
|
|
|
if (wallEntry == nullptr || !(wallEntry->flags & WALL_SCENERY_IS_DOOR))
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
if (game_is_paused())
|
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2017-02-18 08:26:33 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
bool invalidate = false;
|
2017-02-25 09:36:28 +00:00
|
|
|
|
2018-09-17 14:48:27 +02:00
|
|
|
uint8_t currentFrame = tileElement->AsWall()->GetAnimationFrame();
|
2018-06-22 23:17:03 +02:00
|
|
|
if (currentFrame != 0)
|
|
|
|
|
{
|
|
|
|
|
if (currentFrame == 15)
|
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
currentFrame = 0;
|
2018-06-22 23:17:03 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
removeAnimation = false;
|
2018-06-22 23:17:03 +02:00
|
|
|
if (currentFrame != 5)
|
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
currentFrame++;
|
2021-06-03 13:26:00 +01:00
|
|
|
if (currentFrame == 13 && !(wallEntry->flags & WALL_SCENERY_LONG_DOOR_ANIMATION))
|
2017-06-06 23:24:18 +02:00
|
|
|
currentFrame = 15;
|
2017-02-18 08:26:33 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
invalidate = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-09-17 14:48:27 +02:00
|
|
|
tileElement->AsWall()->SetAnimationFrame(currentFrame);
|
2018-06-22 23:17:03 +02:00
|
|
|
if (invalidate)
|
|
|
|
|
{
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 32 });
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return removeAnimation;
|
2015-03-18 19:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x006E5EE4
|
|
|
|
|
*/
|
2020-02-29 00:30:50 -03:00
|
|
|
static bool map_animation_invalidate_wall(const CoordsXYZ& loc)
|
2015-03-18 19:52:27 +00:00
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
TileCoordsXYZ tileLoc{ loc };
|
2018-11-01 13:53:50 +01:00
|
|
|
TileElement* tileElement;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
bool wasInvalidated = false;
|
2019-12-23 04:35:41 -03:00
|
|
|
tileElement = map_get_first_element_at(loc);
|
2019-10-09 11:02:21 -03:00
|
|
|
if (tileElement == nullptr)
|
|
|
|
|
return true;
|
2018-06-22 23:17:03 +02:00
|
|
|
do
|
|
|
|
|
{
|
2019-12-21 09:07:34 +00:00
|
|
|
if (tileElement->base_height != tileLoc.z)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2021-12-11 00:39:39 +01:00
|
|
|
if (tileElement->GetType() != TileElementType::Wall)
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2021-06-03 13:26:00 +01:00
|
|
|
auto* wallEntry = tileElement->AsWall()->GetEntry();
|
2017-10-15 15:53:16 +02:00
|
|
|
|
2021-06-03 13:26:00 +01:00
|
|
|
if (wallEntry == nullptr
|
|
|
|
|
|| (!(wallEntry->flags2 & WALL_SCENERY_2_ANIMATED) && wallEntry->scrolling_mode == SCROLLING_MODE_NONE))
|
2017-06-06 23:24:18 +02:00
|
|
|
continue;
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2019-12-28 05:44:33 -03:00
|
|
|
map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 });
|
2017-06-06 23:24:18 +02:00
|
|
|
wasInvalidated = true;
|
2018-05-24 11:44:53 +02:00
|
|
|
} while (!(tileElement++)->IsLastForTile());
|
2015-03-18 19:52:27 +00:00
|
|
|
|
2017-06-06 23:24:18 +02:00
|
|
|
return !wasInvalidated;
|
2015-03-22 01:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-11 09:38:37 -06:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* rct2: 0x009819DC
|
|
|
|
|
*/
|
2018-07-21 11:50:45 +02:00
|
|
|
static constexpr const map_animation_invalidate_event_handler _animatedObjectEventHandlers[MAP_ANIMATION_TYPE_COUNT] = {
|
|
|
|
|
map_animation_invalidate_ride_entrance,
|
|
|
|
|
map_animation_invalidate_queue_banner,
|
|
|
|
|
map_animation_invalidate_small_scenery,
|
|
|
|
|
map_animation_invalidate_park_entrance,
|
|
|
|
|
map_animation_invalidate_track_waterfall,
|
|
|
|
|
map_animation_invalidate_track_rapids,
|
|
|
|
|
map_animation_invalidate_track_onridephoto,
|
|
|
|
|
map_animation_invalidate_track_whirlpool,
|
|
|
|
|
map_animation_invalidate_track_spinningtunnel,
|
|
|
|
|
map_animation_invalidate_remove,
|
|
|
|
|
map_animation_invalidate_banner,
|
|
|
|
|
map_animation_invalidate_large_scenery,
|
|
|
|
|
map_animation_invalidate_wall_door,
|
2021-10-17 15:31:56 +02:00
|
|
|
map_animation_invalidate_wall,
|
2018-07-21 11:50:45 +02:00
|
|
|
};
|
2018-01-11 10:59:26 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @returns true if the animation should be removed.
|
|
|
|
|
*/
|
2019-08-03 21:18:33 +01:00
|
|
|
static bool InvalidateMapAnimation(const MapAnimation& a)
|
2018-01-11 10:59:26 +01:00
|
|
|
{
|
2019-08-03 21:18:33 +01:00
|
|
|
if (a.type < std::size(_animatedObjectEventHandlers))
|
|
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
return _animatedObjectEventHandlers[a.type](a.location);
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2018-06-22 23:17:03 +02:00
|
|
|
|
2019-08-03 21:18:33 +01:00
|
|
|
const std::vector<MapAnimation>& GetMapAnimations()
|
|
|
|
|
{
|
|
|
|
|
return _mapAnimations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ClearMapAnimations()
|
|
|
|
|
{
|
|
|
|
|
_mapAnimations.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AutoCreateMapAnimations()
|
|
|
|
|
{
|
|
|
|
|
ClearMapAnimations();
|
|
|
|
|
|
|
|
|
|
tile_element_iterator it;
|
|
|
|
|
tile_element_iterator_begin(&it);
|
|
|
|
|
while (tile_element_iterator_next(&it))
|
|
|
|
|
{
|
|
|
|
|
auto el = it.element;
|
2020-03-13 12:03:43 +01:00
|
|
|
auto loc = CoordsXYZ{ TileCoordsXY(it.x, it.y).ToCoordsXY(), el->GetBaseZ() };
|
2021-12-11 00:39:39 +01:00
|
|
|
switch (el->GetType())
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::Banner:
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_BANNER, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
break;
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::Wall:
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
auto wallEl = el->AsWall();
|
2021-06-03 13:26:00 +01:00
|
|
|
auto* entry = wallEl->GetEntry();
|
2019-08-03 21:18:33 +01:00
|
|
|
if (entry != nullptr
|
2021-06-03 13:26:00 +01:00
|
|
|
&& ((entry->flags2 & WALL_SCENERY_2_ANIMATED) || entry->scrolling_mode != SCROLLING_MODE_NONE))
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_WALL, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::SmallScenery:
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
auto sceneryEl = el->AsSmallScenery();
|
2021-06-04 02:14:41 +01:00
|
|
|
auto* sceneryEntry = sceneryEl->GetEntry();
|
2021-10-01 21:50:05 +02:00
|
|
|
if (sceneryEntry != nullptr && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED))
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::LargeScenery:
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
auto sceneryEl = el->AsLargeScenery();
|
|
|
|
|
auto entry = sceneryEl->GetEntry();
|
2021-06-04 12:41:23 +01:00
|
|
|
if (entry != nullptr && (entry->flags & LARGE_SCENERY_FLAG_ANIMATED))
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_LARGE_SCENERY, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::Path:
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
auto path = el->AsPath();
|
|
|
|
|
if (path->HasQueueBanner())
|
|
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::Entrance:
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
auto entrance = el->AsEntrance();
|
|
|
|
|
switch (entrance->GetEntranceType())
|
|
|
|
|
{
|
|
|
|
|
case ENTRANCE_TYPE_PARK_ENTRANCE:
|
|
|
|
|
if (entrance->GetSequenceIndex() == 0)
|
|
|
|
|
{
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_PARK_ENTRANCE, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ENTRANCE_TYPE_RIDE_ENTRANCE:
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_RIDE_ENTRANCE, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::Track:
|
2019-08-03 21:18:33 +01:00
|
|
|
{
|
|
|
|
|
auto track = el->AsTrack();
|
|
|
|
|
switch (track->GetTrackType())
|
|
|
|
|
{
|
2020-08-18 07:28:41 +01:00
|
|
|
case TrackElemType::Waterfall:
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
break;
|
2020-08-18 07:28:41 +01:00
|
|
|
case TrackElemType::Rapids:
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
break;
|
2020-08-18 07:28:41 +01:00
|
|
|
case TrackElemType::Whirlpool:
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
break;
|
2020-08-18 07:28:41 +01:00
|
|
|
case TrackElemType::SpinningTunnel:
|
2019-12-19 18:38:46 +00:00
|
|
|
map_animation_create(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, loc);
|
2019-08-03 21:18:33 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-12-11 00:39:39 +01:00
|
|
|
case TileElementType::Surface:
|
2021-12-11 00:30:59 +01:00
|
|
|
break;
|
2019-08-03 21:18:33 +01:00
|
|
|
}
|
|
|
|
|
}
|
2018-01-11 10:59:26 +01:00
|
|
|
}
|