Refactor Entrance painting to use ImageId

This commit is contained in:
Ted John
2021-12-03 19:55:25 +00:00
parent b270688635
commit f8431d2b2e
6 changed files with 243 additions and 229 deletions

View File

@@ -65,3 +65,20 @@ void EntranceObject::ReadJson(IReadObjectContext* context, json_t& root)
PopulateTablesFromJson(context, root);
}
ImageIndex EntranceObject::GetImage(uint8_t sequence, Direction direction) const
{
if (sequence > 2)
return ImageIndexUndefined;
return _legacyType.image_id + ((direction & 3) * 3) + sequence;
}
uint8_t EntranceObject::GetScrollingMode() const
{
return _legacyType.scrolling_mode;
}
uint8_t EntranceObject::GetTextHeight() const
{
return _legacyType.text_height;
}

View File

@@ -10,6 +10,7 @@
#pragma once
#include "../world/Entrance.h"
#include "../world/Location.hpp"
#include "Object.h"
class EntranceObject final : public Object
@@ -29,4 +30,8 @@ public:
void Unload() override;
void DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const override;
ImageIndex GetImage(uint8_t sequence, Direction direction) const;
uint8_t GetScrollingMode() const;
uint8_t GetTextHeight() const;
};

File diff suppressed because it is too large Load Diff

View File

@@ -77,7 +77,6 @@ enum
SPR_TERRAIN_SELECTION_QUARTER = 3081,
SPR_WATER_MASK = 5048,
SPR_WATER_OVERLAY = 5053,
SPR_HEIGHT_MARKER_BASE = 5769,
SPR_TERRAIN_BOUNDARY_FENCES_1 = 22872,
SPR_TERRAIN_BOUNDARY_FENCES_2 = 22873,

View File

@@ -534,6 +534,8 @@ enum
SPR_CONSTRUCTION_FOOTPATH_LAND = 5639,
SPR_CONSTRUCTION_FOOTPATH_BRIDGE = 5640,
SPR_HEIGHT_MARKER_BASE = 5769,
SPR_6410 = 6410,
SPR_PEEP_PICKUP_COUNT = 12,

View File

@@ -34,6 +34,13 @@ enum
ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 0),
};
namespace EntranceSequence
{
constexpr const uint8_t Centre = 0;
constexpr const uint8_t Left = 1;
constexpr const uint8_t Right = 2;
};
constexpr const uint8_t ParkEntranceHeight = 12 * COORDS_Z_STEP;
constexpr const uint8_t RideEntranceHeight = 7 * COORDS_Z_STEP;
constexpr const uint8_t RideExitHeight = 5 * COORDS_Z_STEP;