www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/16/11:44:40

Message-Id: <199811161644.QAA00485@remus.clara.net>
From: "Arthur" <arfa AT clara DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: Coding problems from an extreme C newbie...
Date: Mon, 16 Nov 1998 16:43:04 -0000
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
In-Reply-To: <364f6be4.144836@news.flash.net>
Reply-To: djgpp AT delorie DOT com

> Yep..looks right. :)  Ok, next question: I have a bunch of sprites on
> the screen.  Is there a way to remove just one of them (or a handful)
> without having to redraw the screen and plop all the rest of the
> sprites back down?  Hmm..this sounds like a dirty-rectangles solution
> to me, but I don't think I'm ready for that yet. :)

You know the top-left co-ordinates of the sprite, and the width and height.
All you need to do is copy an area of the background exactly over the
sprite. You'll need to check that no other sprites overlap this area, or
you'll have to redraw them. Or you can just redraw all the sprites after you
copy the area of the background. If you use this method for several sprites
then you are using the dirty rectangles method.

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019