mirror of https://github.com/OpenRCT2/OpenRCT2.git
add drawing of other object previews
This commit is contained in:
parent
ebcbb085d2
commit
aa62c3f03f
|
@ -68,6 +68,16 @@ void BannerObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void BannerObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
|
||||
uint32 imageId = 0x20D00000 | _legacyType.image;
|
||||
gfx_draw_sprite(dpi, imageId + 0, x - 12, y + 8, 0);
|
||||
gfx_draw_sprite(dpi, imageId + 1, x - 12, y + 8, 0);
|
||||
}
|
||||
|
||||
const utf8 * BannerObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -38,5 +38,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
};
|
||||
|
|
|
@ -51,6 +51,17 @@ void EntranceObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image_id, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void EntranceObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
|
||||
uint32 imageId = _legacyType.image_id;
|
||||
gfx_draw_sprite(dpi, imageId + 1, x - 32, y + 14, 0);
|
||||
gfx_draw_sprite(dpi, imageId + 0, x + 0, y + 28, 0);
|
||||
gfx_draw_sprite(dpi, imageId + 2, x + 32, y + 44, 0);
|
||||
}
|
||||
|
||||
const utf8 * EntranceObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -37,5 +37,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
};
|
||||
|
|
|
@ -67,6 +67,13 @@ void FootpathItemObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void FootpathItemObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
gfx_draw_sprite(dpi, _legacyType.image, x - 22, y - 24, 0);
|
||||
}
|
||||
|
||||
const utf8 * FootpathItemObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -38,5 +38,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
};
|
||||
|
|
|
@ -56,6 +56,14 @@ void FootpathObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void FootpathObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
gfx_draw_sprite(dpi, _legacyType.image + 71, x - 49, y - 17, 0);
|
||||
gfx_draw_sprite(dpi, _legacyType.image + 72, x + 4, y - 17, 0);
|
||||
}
|
||||
|
||||
const utf8 * FootpathObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -37,5 +37,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
};
|
||||
|
|
|
@ -102,6 +102,15 @@ void LargeSceneryObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void LargeSceneryObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = (dpi->height / 2) - 39;
|
||||
|
||||
uint32 imageId = 0xB2D00000 | _legacyType.image;
|
||||
gfx_draw_sprite(dpi, imageId, x, y, 0);
|
||||
}
|
||||
|
||||
const utf8 * LargeSceneryObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const;
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
const utf8 * GetDescription() const;
|
||||
|
|
|
@ -85,6 +85,15 @@ void SceneryGroupObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void SceneryGroupObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
|
||||
uint32 imageId = _legacyType.image + 0x20600001;
|
||||
gfx_draw_sprite(dpi, imageId, x - 15, y - 14, 0);
|
||||
}
|
||||
|
||||
const utf8 * SceneryGroupObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const;
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
|
||||
|
|
|
@ -56,6 +56,14 @@ void StexObject::Unload()
|
|||
language_free_object_string(_legacyType.details);
|
||||
}
|
||||
|
||||
void StexObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
// Write (no image)
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
gfx_draw_string_centred(dpi, 3326, x, y, 0, nullptr);
|
||||
}
|
||||
|
||||
const utf8 * StexObject::GetName() const
|
||||
{
|
||||
return GetScenarioName();
|
||||
|
|
|
@ -37,6 +37,8 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
|
||||
const utf8 * GetScenarioName() const;
|
||||
|
|
|
@ -71,6 +71,34 @@ void WallObject::Unload()
|
|||
gfx_object_free_images(_legacyType.image, GetImageTable()->GetCount());
|
||||
}
|
||||
|
||||
void WallObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
||||
{
|
||||
int x = dpi->width / 2;
|
||||
int y = dpi->height / 2;
|
||||
|
||||
x += 14;
|
||||
y += (_legacyType.wall.height * 2) + 16;
|
||||
|
||||
uint32 imageId = 0x20D00000 | _legacyType.image;
|
||||
if (_legacyType.wall.flags & WALL_SCENERY_HAS_SECONDARY_COLOUR)
|
||||
{
|
||||
imageId |= 0x92000000;
|
||||
}
|
||||
|
||||
gfx_draw_sprite(dpi, imageId, x, y, 0);
|
||||
|
||||
if (_legacyType.wall.flags & WALL_SCENERY_FLAG2)
|
||||
{
|
||||
imageId = _legacyType.image + 0x44500006;
|
||||
gfx_draw_sprite(dpi, imageId, x, y, 0);
|
||||
}
|
||||
else if (_legacyType.wall.flags & WALL_SCENERY_IS_DOOR)
|
||||
{
|
||||
imageId++;
|
||||
gfx_draw_sprite(dpi, imageId, x, y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
const utf8 * WallObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
|
@ -38,5 +38,7 @@ public:
|
|||
void Load() override;
|
||||
void Unload() override;
|
||||
|
||||
void DrawPreview(rct_drawpixelinfo * dpi) const override;
|
||||
|
||||
const utf8 * GetName() const override;
|
||||
};
|
||||
|
|
|
@ -67,7 +67,6 @@ void WaterObject::DrawPreview(rct_drawpixelinfo * dpi) const
|
|||
gfx_draw_string_centred(dpi, 3326, x, y, 0, nullptr);
|
||||
}
|
||||
|
||||
|
||||
const utf8 * WaterObject::GetName() const
|
||||
{
|
||||
const utf8 * name = GetStringTable()->GetString(OBJ_STRING_ID_NAME);
|
||||
|
|
Loading…
Reference in New Issue