mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
This commit is contained in:
committed by
GitHub
parent
2fd3eb47e7
commit
98aa816e5f
@@ -62,6 +62,7 @@ struct SmallSceneryEntry
|
||||
money64 price;
|
||||
money64 removal_price;
|
||||
uint8_t* frame_offsets;
|
||||
uint16_t FrameOffsetCount;
|
||||
uint16_t animation_delay;
|
||||
uint16_t animation_mask;
|
||||
uint16_t num_frames;
|
||||
|
||||
@@ -76,10 +76,12 @@ void SmallSceneryObject::Load()
|
||||
_legacyType.image = LoadImages();
|
||||
|
||||
_legacyType.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
|
||||
_legacyType.FrameOffsetCount = 0;
|
||||
|
||||
if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS))
|
||||
{
|
||||
_legacyType.frame_offsets = _frameOffsets.data();
|
||||
_legacyType.FrameOffsetCount = static_cast<uint16_t>(_frameOffsets.size());
|
||||
}
|
||||
|
||||
PerformFixes();
|
||||
|
||||
@@ -277,7 +277,7 @@ static void PaintSmallSceneryBody(
|
||||
frame = (frame >> delay) & sceneryEntry->animation_mask;
|
||||
|
||||
auto imageIndex = 0;
|
||||
if (frame < sceneryEntry->num_frames)
|
||||
if (frame < sceneryEntry->FrameOffsetCount)
|
||||
{
|
||||
imageIndex = sceneryEntry->frame_offsets[frame];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user