mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CLuaInstance: Add script fumction 'scale2Res'
- Set Lua api version to 1.69
This commit is contained in:
@@ -4,4 +4,4 @@
|
|||||||
* to luainstance.h changes
|
* to luainstance.h changes
|
||||||
*/
|
*/
|
||||||
#define LUA_API_VERSION_MAJOR 1
|
#define LUA_API_VERSION_MAJOR 1
|
||||||
#define LUA_API_VERSION_MINOR 68
|
#define LUA_API_VERSION_MINOR 69
|
||||||
|
@@ -568,6 +568,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/)
|
|||||||
{ "saveScreen", CLuaInstance::saveScreen },
|
{ "saveScreen", CLuaInstance::saveScreen },
|
||||||
{ "restoreScreen", CLuaInstance::restoreScreen },
|
{ "restoreScreen", CLuaInstance::restoreScreen },
|
||||||
{ "deleteSavedScreen", CLuaInstance::deleteSavedScreen },
|
{ "deleteSavedScreen", CLuaInstance::deleteSavedScreen },
|
||||||
|
{ "scale2Res", CLuaInstance::scale2Res },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
lua_misc.cpp
|
lua_misc.cpp
|
||||||
@@ -1183,4 +1184,22 @@ int CLuaInstance::deleteSavedScreen(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CLuaInstance::scale2Res(lua_State *L)
|
||||||
|
{
|
||||||
|
CLuaData *W = CheckData(L, 1);
|
||||||
|
if (!W || !W->fbwin) return 0;
|
||||||
|
|
||||||
|
int value, ret;
|
||||||
|
value = luaL_checkint(L, 2);
|
||||||
|
|
||||||
|
/* Remove this when pu/fb-setmode branch is merged to master */
|
||||||
|
#ifdef SCALE2RES_DEFINED
|
||||||
|
ret = CFrameBuffer::getInstance()->scale2Res(value);
|
||||||
|
#else
|
||||||
|
ret = value;
|
||||||
|
#endif
|
||||||
|
lua_pushinteger(L, ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------- */
|
/* --------------------------------------------------------------- */
|
||||||
|
@@ -73,6 +73,7 @@ public:
|
|||||||
static int saveScreen(lua_State *L);
|
static int saveScreen(lua_State *L);
|
||||||
static int restoreScreen(lua_State *L);
|
static int restoreScreen(lua_State *L);
|
||||||
static int deleteSavedScreen(lua_State *L);
|
static int deleteSavedScreen(lua_State *L);
|
||||||
|
static int scale2Res(lua_State *L);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
lua_State* lua;
|
lua_State* lua;
|
||||||
|
Reference in New Issue
Block a user