Mail Archives: djgpp/1997/11/23/17:31:13
In comp.os.msdos.djgpp A. Jans-Beken <jabe AT oce DOT nl> 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
- Raw text -