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

35 lines
1.4 KiB
C
Raw Normal View History

/*****************************************************************************
* Copyright (c) 2014-2023 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-07-29 18:45:10 +02:00
# include <memory>
2022-02-25 19:49:52 +01:00
# include <openrct2/drawing/Image.h>
# include <openrct2/drawing/ImageId.hpp>
# include <openrct2/scripting/Duktape.hpp>
2022-07-29 18:45:10 +02:00
# include <openrct2/scripting/Plugin.h>
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);
2022-02-25 21:05:10 +01:00
void DukDrawCustomImage(ScriptEngine& scriptEngine, ImageIndex id, ScreenSize size, const DukValue& callback);
} // namespace OpenRCT2::Scripting
#endif