Skip to main content
gamedev.net
🔒 Locked

Dirty Rectangles (?!)

Started by Sparcbot Mar 27, 2000 at 11:55 PM 0 replies 2.2k views
Original Post
Sparcbot
Sparcbot
First off, Project Platform: DOS / DJGPP / Allegro Alright, a while ago I programmed a library that included a less-than-half-implemented set of dirty rectangle routines (in C) for a simple engine class. I've used this engine with Allegro projects for about a year now, and I've decided to actually try to fully implement an accurately-working dirty rectangle drawing routine, as most of my projects are either Fallout-like (screen stays still until the user scrolls), or contain bitmapped menu screens, or somewhere have situations where dirty rectangles would be optimal. Currently, this is the process I use: 1 store background image in bitmap "backpage" 2 reset dirty rectangle list 3 draw all sprites (words, mouse cursor) on "page" 4 blit all of "page" to "screen" 5 blit "backpage" to "page" using dirty rectangle list 6 goto 2 So basically the only performance gain I'm achieving using this hack job is that I don't have to clear the entire page next cycle. If I do this: 1 store background image in bitmap "backpage" 2 reset dirty rectangle list 3 draw all sprites (words, mouse cursor) on "page" 4 blit all of "page" to "screen" using dirty rectangles 5 blit "backpage" to "page" using dirty rectangle list 6 goto 2 ..then all the elements that got blitted to "screen" leave mouse-dropping-like artifacts behind, which is a Very Bad Thing. If anyone could tell me how to actually do the correct dirty rectangles process (with optimizing/sorting of the dirty rectangles, etc.), then I would be as happy as a cheerleader on drugs. And, on the side, ICQ me if you want to chat about design theories, RPG battle systems, or if want me to send a demonstration of the problem. ____ Kevin Dickerson Edited by - Sparcbot on 3/28/00 6:55:49 PM
____Kevin Dickerson

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.