1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Pass dpi as ref when drawing object preview

This commit is contained in:
Michael Steenbeek
2023-03-13 16:52:49 +01:00
committed by GitHub
parent ac2afdcfaf
commit 049164c400
35 changed files with 74 additions and 74 deletions

View File

@@ -87,15 +87,15 @@ void MusicObject::Unload()
NameStringId = 0;
}
void MusicObject::DrawPreview(DrawPixelInfo* dpi, int32_t width, int32_t height) const
void MusicObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int32_t height) const
{
// Write (no image)
int32_t x = width / 2;
int32_t y = height / 2;
if (_hasPreview)
GfxDrawSprite(dpi, ImageId(_previewImageId), { 0, 0 });
GfxDrawSprite(&dpi, ImageId(_previewImageId), { 0, 0 });
else
DrawTextBasic(*dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
DrawTextBasic(dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
}
void MusicObject::ReadJson(IReadObjectContext* context, json_t& root)