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:
parent
bfbefeff82
commit
fa15037a42
38
factory.c
38
factory.c
@ -375,27 +375,31 @@ void Button_Brush_Factory(void)
|
||||
Brush_backup_width = Brush_width;
|
||||
Brush_backup_height = Brush_height;
|
||||
|
||||
if (Brush == NULL)
|
||||
if (Brush_backup == NULL)
|
||||
{
|
||||
Verbose_error_message("Out of memory!");
|
||||
}
|
||||
else 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!");
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(Brush_backup, Brush, ((long)Brush_height)*Brush_width);
|
||||
|
||||
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
|
||||
free(Brush_backup);
|
||||
Brush_backup=NULL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user