1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 14:54:30 +01:00

Expose obj image offset and num images to plugins (#17567)

Co-authored-by: Duncan <duncans_pumpkin@hotmail.co.uk>
This commit is contained in:
Nikolas Parshook
2023-04-13 15:09:15 -04:00
committed by GitHub
parent d0c7d0f6fb
commit ef35dfa40a
22 changed files with 106 additions and 52 deletions

View File

@@ -13,7 +13,6 @@
#include "../core/Json.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Image.h"
#include "../localisation/Localisation.h"
#include "../world/Banner.h"
@@ -25,7 +24,7 @@ void StationObject::Load()
auto numImages = GetImageTable().GetCount();
if (numImages != 0)
{
BaseImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
BaseImageId = LoadImages();
uint32_t shelterOffset = (Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT) ? 32 : 16;
if (numImages > shelterOffset)
@@ -38,7 +37,7 @@ void StationObject::Load()
void StationObject::Unload()
{
LanguageFreeObjectString(NameStringId);
GfxObjectFreeImages(BaseImageId, GetImageTable().GetCount());
UnloadImages();
NameStringId = 0;
BaseImageId = ImageIndexUndefined;