lua: add missing get_image_from_arg() function

This commit is contained in:
David Capello 2018-09-13 11:53:41 -03:00
parent 415a37ade0
commit 6108d2d5ad
2 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,7 @@ namespace app {
doc::color_t convert_args_into_pixel_color(lua_State* L, int index);
doc::Palette* get_palette_from_arg(lua_State* L, int index);
doc::Image* may_get_image_from_arg(lua_State* L, int index);
doc::Image* get_image_from_arg(lua_State* L, int index);
doc::Cel* get_image_cel_from_arg(lua_State* L, int index);
} // namespace script

View File

@ -249,6 +249,11 @@ doc::Image* may_get_image_from_arg(lua_State* L, int index)
return nullptr;
}
doc::Image* get_image_from_arg(lua_State* L, int index)
{
return get_obj<ImageObj>(L, index)->image.get();
}
doc::Cel* get_image_cel_from_arg(lua_State* L, int index)
{
return get_obj<ImageObj>(L, index)->cel;