Mail Archives: djgpp/1997/01/17/19:58:39
James Jeffrey Benjamin writes:
>I'm slowly working on a tile based engine using Allegro (mainly for
>640x480) and it has become prone to bugs. Anyway, what I'm doing is double
>buffer with blitting (moving) the virtual screen around as I add new rows
>of sprites. Is this faster or slower with the conventional way of just
>rewriting every (compiled) sprite onto the screen buffer? I know my way
>will get quite complex when I introduce parallex srolling. Sprite by
>sprite is easier, but is it faster?
It really depends on the details of your program (sorry, I don't have
any easy answer for you :-)
If a lot of the screen stays the same from one frame to the next (true
for many tile-based systems), your approach will probably save a lot of
time. If it scrolls every frame, though, rather than just when you reach
the edge of the screen, and certainly if you are doing parallax effects,
a brute-force redraw would almost certainly be faster (I can't think of
any way to do as-required redraws on a parallaxed screen, unless you
restrict the display to each different horizontal line belonging to a
single parallax layer).
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
*/
- Raw text -