1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Rework path surface and railings descriptor handling

This commit is contained in:
Gymnasiast
2021-09-05 18:44:43 +02:00
parent 2282f24404
commit 4cc717ccdb
27 changed files with 250 additions and 237 deletions

View File

@@ -40,23 +40,23 @@ void FootpathObject::Load()
_legacyType.image = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount());
_legacyType.bridge_image = _legacyType.image + 109;
_pathSurfaceEntry.Name = _legacyType.string_idx;
_pathSurfaceEntry.Image = _legacyType.image;
_pathSurfaceEntry.PreviewImage = _legacyType.GetPreviewImage();
_pathSurfaceEntry.Flags = _legacyType.flags;
_pathSurfaceDescriptor.Name = _legacyType.string_idx;
_pathSurfaceDescriptor.Image = _legacyType.image;
_pathSurfaceDescriptor.PreviewImage = _legacyType.GetPreviewImage();
_pathSurfaceDescriptor.Flags = _legacyType.flags;
_queueEntry.Name = _legacyType.string_idx;
_queueEntry.Image = _legacyType.GetQueueImage();
_queueEntry.PreviewImage = _legacyType.GetQueuePreviewImage();
_queueEntry.Flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE;
_queueSurfaceDescriptor.Name = _legacyType.string_idx;
_queueSurfaceDescriptor.Image = _legacyType.GetQueueImage();
_queueSurfaceDescriptor.PreviewImage = _legacyType.GetQueuePreviewImage();
_queueSurfaceDescriptor.Flags = _legacyType.flags | FOOTPATH_ENTRY_FLAG_IS_QUEUE;
_pathRailingsEntry.Name = _legacyType.string_idx;
_pathRailingsEntry.BridgeImage = _legacyType.bridge_image;
_pathRailingsEntry.PreviewImage = _legacyType.GetPreviewImage();
_pathRailingsEntry.Flags = _legacyType.flags;
_pathRailingsEntry.ScrollingMode = _legacyType.scrolling_mode;
_pathRailingsEntry.SupportType = _legacyType.support_type;
_pathRailingsEntry.RailingsImage = _legacyType.GetRailingsImage();
_pathRailingsDescriptor.Name = _legacyType.string_idx;
_pathRailingsDescriptor.BridgeImage = _legacyType.bridge_image;
_pathRailingsDescriptor.PreviewImage = _legacyType.GetPreviewImage();
_pathRailingsDescriptor.Flags = _legacyType.flags;
_pathRailingsDescriptor.ScrollingMode = _legacyType.scrolling_mode;
_pathRailingsDescriptor.SupportType = _legacyType.support_type;
_pathRailingsDescriptor.RailingsImage = _legacyType.GetRailingsImage();
}
void FootpathObject::Unload()
@@ -71,8 +71,8 @@ void FootpathObject::Unload()
void FootpathObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const
{
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
gfx_draw_sprite(dpi, _pathSurfaceEntry.PreviewImage, screenCoords - ScreenCoordsXY{ 49, 17 }, 0);
gfx_draw_sprite(dpi, _queueEntry.PreviewImage, screenCoords + ScreenCoordsXY{ 4, -17 }, 0);
gfx_draw_sprite(dpi, _pathSurfaceDescriptor.PreviewImage, screenCoords - ScreenCoordsXY{ 49, 17 }, 0);
gfx_draw_sprite(dpi, _queueSurfaceDescriptor.PreviewImage, screenCoords + ScreenCoordsXY{ 4, -17 }, 0);
}
static RailingEntrySupportType ParseSupportType(const std::string& s)