From 06892015eaaef0a7ff73b7d8b4eb42d69b13c503 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 29 Oct 2009 15:52:21 +0000 Subject: [PATCH] added lua binding to set a color in the palette git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1097 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- factory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/factory.c b/factory.c index 5eb20489..79b53850 100644 --- a/factory.c +++ b/factory.c @@ -50,6 +50,13 @@ int L_GetPixel(lua_State* L) return 1; } +int L_SetColor(lua_State* L) +{ + Set_color(lua_tonumber(L, 1), lua_tonumber(L, 2), lua_tonumber(L, 3), + lua_tonumber(L, 4)); + return 0; +} + void Button_Brush_Factory(void) { short clicked_button; @@ -127,6 +134,7 @@ void Button_Brush_Factory(void) lua_register(L,"putpixel",L_PutPixel); lua_register(L,"getpixel",L_GetPixel); + lua_register(L,"setcolor",L_SetColor); if (luaL_loadfile(L,"./test.lua") != 0) Verbose_error_message(lua_tostring(L, 1));