From: George Foot Newsgroups: comp.os.msdos.djgpp,comp.ai.games Subject: Re: Allegro: Faster blitting possible? Date: 19 Nov 1997 19:59:33 GMT Organization: Oxford University, England Lines: 24 Message-ID: <64vgf5$5im$2@news.ox.ac.uk> References: <347312B7 DOT 40FA AT oce DOT nl> NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In comp.os.msdos.djgpp A. Jans-Beken wrote: : I think that it may be faster (in line L04) to first compare the : new_tile contents to the old_tile contents. This would look like this: I don't think this would help that much; it would involve a lot of comparisons. I assert that using a dirty rectangle system would be faster. This scheme is just like double buffering, but as you draw to the buffer you note what areas you're drawing in. Then when you've finished drawing the frame you just copy those areas to the screen. It's wise to optimise the list of dirty areas before copying them, to remove redundancy. Sorting in order of Y coordinate can reduce screen bank switches in some modes. In tile-based games it can be best to split the screen into a grid system, and flag each grid square as dirty, rather than maintain an accurate list of dirty rectangles. Doing this eliminates redundant copying. If you'd like some example code, just let me know (privately). -- george DOT foot AT merton DOT oxford DOT ac DOT uk