CLuaInstance: Add cVideo functions

- cVideo::SetBlank()
- cVideo::ShowPicture()
- cVideo::StopPicture()


Origin commit data
------------------
Commit: c511a44a2b
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-09-10 (Wed, 10 Sep 2014)
This commit is contained in:
Michael Liebmann
2014-09-10 21:14:00 +02:00
parent 042aea94b3
commit 83ee24f234
2 changed files with 30 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
#include <neutrino.h>
#include <system/debug.h>
#include "luainstance.h"
#include <video.h>
/* 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));

View File

@@ -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);