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,11 +375,15 @@ 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
{
memcpy(Brush_backup, Brush, ((long)Brush_height)*Brush_width);
if (luaL_loadfile(L,scriptdir) != 0)
{ {
message = lua_tostring(L, 1); message = lua_tostring(L, 1);
if(message) if(message)
@ -395,7 +399,7 @@ void Button_Brush_Factory(void)
else else
Warning_message("Unknown error running script!"); Warning_message("Unknown error running script!");
} }
}
// Cleanup // Cleanup
free(Brush_backup); free(Brush_backup);
Brush_backup=NULL; Brush_backup=NULL;