OpenRCT2/src/openrct2-ui/scripting/CustomImages.h

32 lines
1.3 KiB
C
Raw Normal View History

/*****************************************************************************
* Copyright (c) 2014-2022 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#ifdef ENABLE_SCRIPTING
2022-02-25 19:49:52 +01:00
# include <openrct2/drawing/Image.h>
# include <openrct2/drawing/ImageId.hpp>
# include <openrct2/scripting/Duktape.hpp>
2022-02-25 19:49:52 +01:00
# include <openrct2/scripting/ScriptEngine.h>
namespace OpenRCT2::Scripting
{
2022-02-25 19:49:52 +01:00
void InitialiseCustomImages(ScriptEngine& scriptEngine);
std::optional<ImageList> AllocateCustomImages(const std::shared_ptr<Plugin>& plugin, uint32_t count);
bool FreeCustomImages(const std::shared_ptr<Plugin>& plugin, ImageList range);
bool DoesPluginOwnImage(const std::shared_ptr<Plugin>& plugin, ImageIndex index);
DukValue DukGetImageInfo(duk_context* ctx, ImageIndex id);
DukValue DukGetImagePixelData(duk_context* ctx, ImageIndex id);
void DukSetPixelData(duk_context* ctx, ImageIndex id, const DukValue& dukPixelData);
} // namespace OpenRCT2::Scripting
#endif