Mercurial > hg > dmlib
diff dmscaledblit.h @ 95:0430f484641b
Add unscaled blitting functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Oct 2012 18:51:16 +0300 |
parents | baf72a99d5ee |
children | 79dac918c81e |
line wrap: on
line diff
--- a/dmscaledblit.h Tue Oct 02 18:14:44 2012 +0300 +++ b/dmscaledblit.h Tue Oct 02 18:51:16 2012 +0300 @@ -23,10 +23,10 @@ #endif // Clip coordinates - if (dmClipCoord(&xr, x0, src->w, dwidth, + if (dmScaledClipCoord(&xr, x0, src->w, dwidth, dst->clip_rect.x, dst->clip_rect.x + dst->clip_rect.w) || - dmClipCoord(&yr, y0, src->h, dheight, + dmScaledClipCoord(&yr, y0, src->h, dheight, dst->clip_rect.y, dst->clip_rect.y + dst->clip_rect.h)) return -1; @@ -42,7 +42,7 @@ FP_MUL_R(dx, dx, xr.vdelta); // Take pitch into account - const int xadd = xr.vadd - dst->clip_rect.w + dst->clip_rect.x + (dst->pitch / DM_BLITFUNC_DST_BYTES); + const int dstadd = xr.vadd - dst->clip_rect.w + dst->clip_rect.x + (dst->pitch / DM_BLITFUNC_DST_BYTES); // Blit scaled DM_BLITFUNC_DST_TYPE * dp = ((DM_BLITFUNC_DST_TYPE *) dst->pixels) + (yr.v0 * dst->pitch) / DM_BLITFUNC_DST_BYTES + xr.v0; @@ -61,7 +61,7 @@ FP_ADD(xv, xr.vdelta); } FP_ADD(yv, yr.vdelta); - dp += xadd; + dp += dstadd; } #ifdef DM_BLITFUNC_FINISH