diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 4fe489c53..7b4bdb8c0 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -34,6 +34,7 @@ #include #include #include "luainstance.h" +#include /* the magic color that tells us we are using one of the palette colors */ #define MAGIC_COLOR 0x42424200 @@ -457,6 +458,9 @@ const luaL_Reg CLuaInstance::methods[] = { "getRenderWidth", CLuaInstance::getRenderWidth }, { "GetSize", CLuaInstance::GetSize }, { "DisplayImage", CLuaInstance::DisplayImage }, + { "setBlank", CLuaInstance::setBlank }, + { "ShowPicture", CLuaInstance::ShowPicture }, + { "StopPicture", CLuaInstance::StopPicture }, { "Blit", CLuaInstance::Blit }, { "GetLanguage", CLuaInstance::GetLanguage }, { "runScript", CLuaInstance::runScriptExt }, @@ -618,6 +622,29 @@ int CLuaInstance::DisplayImage(lua_State *L) return 0; } +extern cVideo * videoDecoder; + +int CLuaInstance::setBlank(lua_State *L) +{ + int enable = 1; + enable = luaL_checkint(L, 2); + videoDecoder->setBlank((enable==1)?true:false); + return 0; +} + +int CLuaInstance::ShowPicture(lua_State *L) +{ + const char *fname = luaL_checkstring(L, 2); + videoDecoder->ShowPicture(fname); + return 0; +} + +int CLuaInstance::StopPicture(lua_State */*L*/) +{ + videoDecoder->StopPicture(); + return 0; +} + int CLuaInstance::PlayFile(lua_State *L) { printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 1104f729e..83117aa85 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -193,6 +193,9 @@ private: static int runScriptExt(lua_State *L); static int GetSize(lua_State *L); static int DisplayImage(lua_State *L); + static int setBlank(lua_State *L); + static int ShowPicture(lua_State *L); + static int StopPicture(lua_State *L); static int PlayFile(lua_State *L); static int strFind(lua_State *L);