diff --git a/ChangeLog b/ChangeLog index b0c4604247..759021b7b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 16 17:16:59 BST 1999 Adam D. Moss + + * app/paint_funcs.c: Fixed a possible bad composite when + mode is REPLACE_MODE. + 1999-05-15 Scott Goehring * app/about_dialog.c: Removed unnecessarly #include of diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index a3b2dee20d..05bd1970e1 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -5130,6 +5130,7 @@ combine_sub_region(struct combine_regions_struct *st, unsigned char * d, * m; unsigned char buf[512]; gboolean opacity_quickskip_possible; + gboolean transparency_quickskip_possible; TileRowHint hint; opacity = st->opacity; @@ -5145,13 +5146,11 @@ combine_sub_region(struct combine_regions_struct *st, d = dest->data; m = (mask) ? mask->data : NULL; - /* cheap and easy when the row of src2 is completely opaque */ - opacity_quickskip_possible = ((!m) && (opacity==255)); - /* if (src2->tiles) - s2 = tile_data_pointer(src2->curtile, - src2->offx, - src2->offy);*/ + /* cheap and easy when the row of src2 is completely opaque/transparent */ + opacity_quickskip_possible = ((!m) && (opacity==255)); + transparency_quickskip_possible = ((src2->tiles) && (mode != REPLACE_MODE)); + if (src1->w > 128) g_error("combine_sub_region::src1->w = %d\n", src1->w); @@ -5173,7 +5172,7 @@ combine_sub_region(struct combine_regions_struct *st, { hint = TILEROWHINT_UNDEFINED; - if (src2->tiles && + if (transparency_quickskip_possible && ((hint = tile_get_rowhint (src2->curtile, (src2->offy + h))) == TILEROWHINT_TRANSPARENT)) { diff --git a/app/paint_funcs.c b/app/paint_funcs.c index a3b2dee20d..05bd1970e1 100644 --- a/app/paint_funcs.c +++ b/app/paint_funcs.c @@ -5130,6 +5130,7 @@ combine_sub_region(struct combine_regions_struct *st, unsigned char * d, * m; unsigned char buf[512]; gboolean opacity_quickskip_possible; + gboolean transparency_quickskip_possible; TileRowHint hint; opacity = st->opacity; @@ -5145,13 +5146,11 @@ combine_sub_region(struct combine_regions_struct *st, d = dest->data; m = (mask) ? mask->data : NULL; - /* cheap and easy when the row of src2 is completely opaque */ - opacity_quickskip_possible = ((!m) && (opacity==255)); - /* if (src2->tiles) - s2 = tile_data_pointer(src2->curtile, - src2->offx, - src2->offy);*/ + /* cheap and easy when the row of src2 is completely opaque/transparent */ + opacity_quickskip_possible = ((!m) && (opacity==255)); + transparency_quickskip_possible = ((src2->tiles) && (mode != REPLACE_MODE)); + if (src1->w > 128) g_error("combine_sub_region::src1->w = %d\n", src1->w); @@ -5173,7 +5172,7 @@ combine_sub_region(struct combine_regions_struct *st, { hint = TILEROWHINT_UNDEFINED; - if (src2->tiles && + if (transparency_quickskip_possible && ((hint = tile_get_rowhint (src2->curtile, (src2->offy + h))) == TILEROWHINT_TRANSPARENT)) {