From b849cc1706f00f34147e565b3796ac858c611e58 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 18 Dec 2010 23:42:43 +0000 Subject: [PATCH] Lua: added finalizepicture() git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1664 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/factory.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/factory.c b/src/factory.c index cb695cd1..0e88bd8f 100644 --- a/src/factory.c +++ b/src/factory.c @@ -974,7 +974,7 @@ int L_Wait(lua_State* L) return 0; } -int L_Wait_break(lua_State* L) +int L_WaitBreak(lua_State* L) { float delay; Uint32 end; @@ -1007,7 +1007,7 @@ int L_Wait_break(lua_State* L) return 1; } -int L_Update_screen(lua_State* L) +int L_UpdateScreen(lua_State* L) { int nb_args=lua_gettop(L); @@ -1021,6 +1021,19 @@ int L_Update_screen(lua_State* L) return 0; } +int L_FinalizePicture(lua_State* L) +{ + int nb_args=lua_gettop(L); + + LUA_ARG_LIMIT (0, "finalizepicture"); + + Update_colors_during_script(); + End_of_modification(); + Backup(); + + return 0; +} + // Handlers for window internals T_Fileselector Scripts_list; @@ -1218,10 +1231,11 @@ void Run_script(char *scriptdir) lua_register(L,"getsparetranscolor",L_GetSpareTransColor); lua_register(L,"clearpicture",L_ClearPicture); lua_register(L,"wait",L_Wait); - lua_register(L,"waitbreak",L_Wait_break); - lua_register(L,"updatescreen",L_Update_screen); - - // For debug only + lua_register(L,"waitbreak",L_WaitBreak); + lua_register(L,"updatescreen",L_UpdateScreen); + lua_register(L,"finalizepicture",L_FinalizePicture); + + // Load all standard libraries luaL_openlibs(L); /*