Lua: GetBrushBackupPixel now works (Had forgotten to make initial copy :-/ )

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1289 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-01-29 02:20:45 +00:00
parent bfbefeff82
commit fa15037a42

View File

@ -375,27 +375,31 @@ void Button_Brush_Factory(void)
Brush_backup_width = Brush_width; Brush_backup_width = Brush_width;
Brush_backup_height = Brush_height; Brush_backup_height = Brush_height;
if (Brush == NULL) if (Brush_backup == NULL)
{ {
Verbose_error_message("Out of memory!"); Verbose_error_message("Out of memory!");
} }
else if (luaL_loadfile(L,scriptdir) != 0) else
{ {
message = lua_tostring(L, 1); memcpy(Brush_backup, Brush, ((long)Brush_height)*Brush_width);
if(message)
Verbose_error_message(message);
else
Warning_message("Unknown error loading script!");
}
else if (lua_pcall(L, 0, 0, 0) != 0)
{
message = lua_tostring(L, 1);
if(message)
Verbose_error_message(message);
else
Warning_message("Unknown error running script!");
}
if (luaL_loadfile(L,scriptdir) != 0)
{
message = lua_tostring(L, 1);
if(message)
Verbose_error_message(message);
else
Warning_message("Unknown error loading script!");
}
else if (lua_pcall(L, 0, 0, 0) != 0)
{
message = lua_tostring(L, 1);
if(message)
Verbose_error_message(message);
else
Warning_message("Unknown error running script!");
}
}
// Cleanup // Cleanup
free(Brush_backup); free(Brush_backup);
Brush_backup=NULL; Brush_backup=NULL;