From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro speed question Date: Fri, 3 Jan 1997 23:38:34 +0000 Organization: None Lines: 23 Distribution: world Message-ID: <8nQ8uHA6hZzyEwdF@talula.demon.co.uk> References: <32CD4EA6 DOT 5113 AT mbnet DOT mb DOT ca> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Alex Demko writes: >What would be faster: > > * To use blit() 1-3 times (enough to fill the screen) > or > * to use draw_rle_sprite() to fill the screen with 20x20 > sprites I'd guess the blit would be quite a bit faster. The big difference between the two is that draw_rle_sprite() supports transparent pixels, and blit() doesn't. This means the blit can use a very simple (and therefore fast) inner loop, copying four pixels at a time with 32 bit instructions. The RLE sprite drawer can do some of this sort of optimisation, because the pixels are grouped in runs (that's why it is faster than drawing regular, non-RLE sprites), but it has to handle varying run lengths and so there is a lot more overhead. Also, clipping RLE sprites is very complicated and not very fast, wheras clipping a simple rectangle blit is trivial. /* * 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'. */