Fix a remap problem on brush, when modified by Lua script then transformed. Fix Brush remap to maintain transparent pixels. Fix Text tool , respects transparent pixels and preview is always visible (The black PF_ fonts are no longer shown on a black background)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1726 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2011-02-16 17:03:45 +00:00
parent 2378d8cedc
commit 80c37034f9
8 changed files with 95 additions and 15 deletions

View File

@@ -153,6 +153,7 @@ void Update_colors_during_script(void)
int L_SetBrushSize(lua_State* L)
{
int i;
int w;
int h;
int nb_args=lua_gettop(L);
@@ -168,10 +169,12 @@ int L_SetBrushSize(lua_State* L)
Brush_was_altered=1;
// Fill with Back_color
memset(Brush_original_pixels,Back_color,(long)Brush_width*Brush_height);
// Grab palette
memset(Brush,Back_color,(long)Brush_width*Brush_height);
// Adopt the current palette.
memcpy(Brush_original_palette, Main_palette,sizeof(T_Palette));
// Remap (no change)
Remap_brush();
for (i=0; i<256; i++)
Brush_colormap[i]=i;
//--
// Center the handle
Brush_offset_X=(Brush_width>>1);