f1ced24f05
* multi swapchain draft * uwp fix * swapchain resize handling * swapchain buffercount * vsync toggle * tests fix * update * everything removed from graphicsdevice regarding global screen params, engine refactor * added GetSwapChainTexture() function to graphics device; screenshot() now requires swapChain * linux fix: vulkan device needs window handle for instance creation * refactor * removed unused includes * shader refactor and lensflare fix * swapchain clearcolor and other refactors * vulkan: no vector allocation in submit * tests fix * refactors * lens flare canvas size fix * gui refactor for canvas support * refactors * removed global canvas state * msaa fix * fixes * refactor to minimize interface changes * gui changes * checkbox fix * gui fixes * fixes * input system will accept window handle * editor fixes * refactor and removed resolution related system events * small editor update * refactor: renderpath inherits from canvas * fixed tests duh * image refactor * image fix * removed every using namespace std * pushconstant fix * editor: object picking only when necessary * removed include * dx12: copy fence waiting performed on CPU * dx12 copyallocator update * vulkan: copy allocator with timeline semaphores * missing include * dx12 copy allocator update * refactor * editor update * vulkan copy allocator fix * dx12 update * vulkan, dx12 fixes * version bump * vsync event helper * documentation update * updated vulkan, dx12, dxc
95 lines
2.0 KiB
C++
95 lines
2.0 KiB
C++
#include "wiSprite_BindLua.h"
|
|
#include "wiImageParams_BindLua.h"
|
|
#include "SpriteAnim_BindLua.h"
|
|
|
|
const char wiSprite_BindLua::className[] = "Sprite";
|
|
|
|
Luna<wiSprite_BindLua>::FunctionType wiSprite_BindLua::methods[] = {
|
|
lunamethod(wiSprite_BindLua, SetParams),
|
|
lunamethod(wiSprite_BindLua, GetParams),
|
|
lunamethod(wiSprite_BindLua, SetAnim),
|
|
lunamethod(wiSprite_BindLua, GetAnim),
|
|
|
|
{ NULL, NULL }
|
|
};
|
|
Luna<wiSprite_BindLua>::PropertyType wiSprite_BindLua::properties[] = {
|
|
{ NULL, NULL }
|
|
};
|
|
|
|
wiSprite_BindLua::wiSprite_BindLua(const wiSprite& sprite) :sprite(sprite)
|
|
{
|
|
}
|
|
|
|
wiSprite_BindLua::wiSprite_BindLua(lua_State *L)
|
|
{
|
|
std::string name = "", mask = "";
|
|
int argc = wiLua::SGetArgCount(L);
|
|
if (argc > 0)
|
|
{
|
|
name = wiLua::SGetString(L, 1);
|
|
name = wiLua::GetScriptPath() + name;
|
|
if (argc > 1)
|
|
{
|
|
mask = wiLua::SGetString(L, 2);
|
|
mask = wiLua::GetScriptPath() + mask;
|
|
}
|
|
}
|
|
sprite = wiSprite(name, mask);
|
|
}
|
|
|
|
int wiSprite_BindLua::SetParams(lua_State *L)
|
|
{
|
|
int argc = wiLua::SGetArgCount(L);
|
|
if (argc > 0)
|
|
{
|
|
wiImageParams_BindLua* params = Luna<wiImageParams_BindLua>::check(L, 1);
|
|
if (params != nullptr)
|
|
{
|
|
sprite.params = params->params;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
wiLua::SError(L, "SetParams(ImageEffects effects) not enough arguments!");
|
|
}
|
|
return 0;
|
|
}
|
|
int wiSprite_BindLua::GetParams(lua_State *L)
|
|
{
|
|
Luna<wiImageParams_BindLua>::push(L, new wiImageParams_BindLua(sprite.params));
|
|
return 1;
|
|
}
|
|
int wiSprite_BindLua::SetAnim(lua_State *L)
|
|
{
|
|
int argc = wiLua::SGetArgCount(L);
|
|
if (argc > 0)
|
|
{
|
|
SpriteAnim_BindLua* anim = Luna<SpriteAnim_BindLua>::check(L, 1);
|
|
if (anim != nullptr)
|
|
{
|
|
sprite.anim = anim->anim;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
wiLua::SError(L, "SetAnim(SpriteAnim anim) not enough arguments!");
|
|
}
|
|
return 0;
|
|
}
|
|
int wiSprite_BindLua::GetAnim(lua_State *L)
|
|
{
|
|
Luna<SpriteAnim_BindLua>::push(L, new SpriteAnim_BindLua(sprite.anim));
|
|
return 1;
|
|
}
|
|
|
|
void wiSprite_BindLua::Bind()
|
|
{
|
|
static bool initialized = false;
|
|
if (!initialized)
|
|
{
|
|
initialized = true;
|
|
Luna<wiSprite_BindLua>::Register(wiLua::GetLuaState());
|
|
}
|
|
}
|
|
|