[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Michael Bukin wrote:
>
> "L. Ross Raszewski" <lraszewski@xxxxxxxxxx> writes:
>
> Try this one:
>
> void
> blit_interlaced (int yoffset, int ygap, BITMAP *src, BITMAP *dst,
> int sx, int sy, int dx, int dy, int w, int h)
> {
> int i;
> acquire_bitmap (dst);
> for (i = yoffset; i < h; i += ygap)
> blit (src, dst, sx, sy + i, dx, dy + i, w, 1);
> release_bitmap (dst);
> }
>
> BTW, you can not use memcpy with video bitmaps. For DJGPP you should
> use bmp_write## or movedata.
>
My first try was right along those lines, but the timings I was
recieving suggested to me that the overhead of doing n/2 blits instead
of 1 was cancellign out the benefit of only blitting half as much data.
A thought occured to me which I tried out; I lied to bmp_write, and used
the 32 bpp version on a 16bpp image(adjusting the pointers accordignly),
so that 32 bits of the soruce were copied at a time (effectively,
copying adjacent pixels simultaneously, and got a _marked_ improvement
in the timings (1-pass interlaced blit now takes abotu 1.25 x as long as
uninterlaced blit, so any higher number of passes now saves time.) Not
quite as good as I'd hoped, nor as general. I'm going to see if I can
hammer movedata into working, but of course, that about does it for
portability.