X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdraw%2Fao_copy.c;h=a506aed7737b203fefe17e919e0fe89bf0eddeb8;hb=5506b6c1f75d639e2d952213a53bc9ee34e5a79c;hp=47067bb829a2fc62240cff5e2f32ddc7647fda1b;hpb=1301d576d9bface4cc625e4a4187401f93f54444;p=fw%2Faltos diff --git a/src/draw/ao_copy.c b/src/draw/ao_copy.c index 47067bb8..a506aed7 100644 --- a/src/draw/ao_copy.c +++ b/src/draw/ao_copy.c @@ -12,17 +12,16 @@ * General Public License for more details. */ -#include "ao.h" -#include "ao_draw.h" -#include "ao_draw_int.h" +#include +#include #define bound(val,max,other) do { \ if (val < 0) { \ - other -= val; \ + other += (typeof(other)) (-val); \ val = 0; \ } \ if (val > max) { \ - other -= (val - max); \ + other -= (typeof(other)) (val - max); \ val = max; \ } \ } while (0) @@ -33,7 +32,7 @@ } while (0) void -ao_copy(const struct ao_bitmap *dst, +ao_copy(struct ao_bitmap *dst, int16_t dst_x, int16_t dst_y, int16_t width, @@ -58,6 +57,8 @@ ao_copy(const struct ao_bitmap *dst, upsidedown = (dst_y > src_y); } + ao_damage(dst, dst_x, dst_y, dst_x2, dst_y2); + if (dst_x < dst_x2 && dst_y < dst_y2) { ao_blt(src->base + src_y * src->stride, src->stride,