OpenRCT2/src/openrct2/object/LargeSceneryObject.h

51 lines
1.7 KiB
C
Raw Normal View History

2016-06-25 23:47:09 +02:00
/*****************************************************************************
* Copyright (c) 2014-2019 OpenRCT2 developers
2016-06-25 23:47:09 +02:00
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
2016-06-25 23:47:09 +02:00
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
2016-06-25 23:47:09 +02:00
*****************************************************************************/
#pragma once
2018-01-11 10:59:26 +01:00
#include "../world/Scenery.h"
#include "SceneryObject.h"
2016-06-25 23:47:09 +02:00
2018-06-22 23:03:20 +02:00
#include <memory>
#include <vector>
class LargeSceneryObject final : public SceneryObject
2016-06-25 23:47:09 +02:00
{
private:
2018-06-22 23:03:20 +02:00
rct_scenery_entry _legacyType = {};
uint32_t _baseImageId = 0;
std::vector<rct_large_scenery_tile> _tiles;
std::unique_ptr<rct_large_scenery_text> _3dFont;
2016-06-25 23:47:09 +02:00
public:
2018-06-22 23:03:20 +02:00
explicit LargeSceneryObject(const rct_object_entry& entry)
: SceneryObject(entry)
{
}
void* GetLegacyData() override
{
return &_legacyType;
}
void ReadLegacy(IReadObjectContext* context, IStream* stream) override;
void ReadJson(IReadObjectContext* context, const json_t* root) override;
2016-06-25 23:47:09 +02:00
void Load() override;
void Unload() override;
2018-06-22 23:03:20 +02:00
void DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const override;
2016-07-02 13:29:13 +02:00
2016-06-25 23:47:09 +02:00
private:
2018-06-22 23:03:20 +02:00
static std::vector<rct_large_scenery_tile> ReadTiles(IStream* stream);
static std::vector<rct_large_scenery_tile> ReadJsonTiles(const json_t* jTiles);
static std::unique_ptr<rct_large_scenery_text> ReadJson3dFont(const json_t* j3dFont);
static std::vector<LocationXY16> ReadJsonOffsets(const json_t* jOffsets);
static std::vector<rct_large_scenery_text_glyph> ReadJsonGlyphs(const json_t* jGlpyhs);
2016-06-25 23:47:09 +02:00
};