1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +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

@@ -15,7 +15,6 @@
#include "../common.h"
#include "../core/IStream.hpp"
#include "../core/Json.hpp"
#include "../drawing/Image.h"
#include "../localisation/Formatter.h"
#include "../localisation/Language.h"
#include "../localisation/StringIds.h"
@@ -38,7 +37,7 @@ void WaterObject::Load()
{
GetStringTable().Sort();
_legacyType.string_idx = LanguageAllocateObjectString(GetName());
_legacyType.image_id = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount());
_legacyType.image_id = LoadImages();
_legacyType.palette_index_1 = _legacyType.image_id + 1;
_legacyType.palette_index_2 = _legacyType.image_id + 4;
@@ -47,7 +46,7 @@ void WaterObject::Load()
void WaterObject::Unload()
{
GfxObjectFreeImages(_legacyType.image_id, GetImageTable().GetCount());
UnloadImages();
LanguageFreeObjectString(_legacyType.string_idx);
_legacyType.string_idx = 0;