Mail Archives: djgpp/1997/01/20/22:35:55
On Mon, 20 Jan 1997 13:08:14 -0800 William Lachance <billl AT synapse DOT net>
writes:
>frenchc wrote:
>On a pentium, it doesn't make much difference (it'll probably run at
>refresh either way) but if you want to include slower machines (and
>your in-game objects aren't very big, or too numerous) dirty
>rectangles
>are probably the way to go.
The speed improvements come from only updating part of the screen.
If you are completely redrawing the whole screen every time, don't use
dirty rectangles. On the other hand, you could do this:
(Note: For my purposes, a sprite is a movable on-screen object {Far as I
know, that's what it is for any purpose, but I thought I should make it
clear}):
Draw all tiles to Backup
Copy Backup to Work
LoopTop
Mark Current rectangles of sprites.
Copy marked areas from Backup to Work.
Update logic (move objects, get input, et cetera).
Move objects
Draw new positions on Work.
Blit Work to screen.
Jump to LoopTop
This has the advantage of both Dirty Rectangles for speed, and double
buffering to avoid flicker.
...Chambers
- Raw text -