- Adaptat exemple a la nova API
- [NEW] viewport.resetClipping()
This commit is contained in:
20
lua.cpp
20
lua.cpp
@@ -315,16 +315,17 @@ extern "C" {
|
||||
// viewport
|
||||
// ===============================================
|
||||
|
||||
static int cpp_viewport_resetClipping(lua_State *L) {
|
||||
clip();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_viewport_setClipping(lua_State *L) {
|
||||
if (lua_gettop(L) == 0) {
|
||||
clip();
|
||||
} else {
|
||||
int x = luaL_checknumber(L, 1);
|
||||
int y = luaL_checknumber(L, 2);
|
||||
int w = luaL_checknumber(L, 3);
|
||||
int h = luaL_checknumber(L, 4);
|
||||
clip(x, y, w, h);
|
||||
}
|
||||
int x = luaL_checknumber(L, 1);
|
||||
int y = luaL_checknumber(L, 2);
|
||||
int w = luaL_checknumber(L, 3);
|
||||
int h = luaL_checknumber(L, 4);
|
||||
clip(x, y, w, h);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -857,6 +858,7 @@ void push_lua_funcs() {
|
||||
lua_setglobal(L, "subpalette");
|
||||
|
||||
lua_newtable(L);
|
||||
lua_pushcfunction(L,cpp_viewport_resetClipping);lua_setfield(L, -2, "resetClipping");
|
||||
lua_pushcfunction(L,cpp_viewport_setClipping); lua_setfield(L, -2, "setClipping");
|
||||
lua_pushcfunction(L,cpp_viewport_setOrigin); lua_setfield(L, -2, "setOrigin");
|
||||
lua_pushcfunction(L,cpp_viewport_getOrigin); lua_setfield(L, -2, "getOrigin");
|
||||
|
||||
Reference in New Issue
Block a user