mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 05:23:04 +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:
@@ -15,6 +15,7 @@
|
||||
#include "../core/Memory.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../core/ZipStream.hpp"
|
||||
#include "../drawing/Image.h"
|
||||
#include "../localisation/Language.h"
|
||||
#include "../localisation/LocalisationService.h"
|
||||
#include "../localisation/StringIds.h"
|
||||
@@ -182,6 +183,23 @@ std::string Object::GetName(int32_t language) const
|
||||
return GetString(language, ObjectStringID::NAME);
|
||||
}
|
||||
|
||||
ImageIndex Object::LoadImages()
|
||||
{
|
||||
if (_baseImageId == ImageIndexUndefined)
|
||||
{
|
||||
_baseImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
|
||||
}
|
||||
return _baseImageId;
|
||||
}
|
||||
|
||||
void Object::UnloadImages()
|
||||
{
|
||||
if (_baseImageId != ImageIndexUndefined)
|
||||
{
|
||||
GfxObjectFreeImages(_baseImageId, GetImageTable().GetCount());
|
||||
}
|
||||
}
|
||||
|
||||
void RCTObjectEntry::SetName(std::string_view value)
|
||||
{
|
||||
std::memset(name, ' ', sizeof(name));
|
||||
|
||||
Reference in New Issue
Block a user