realbasic-games
[Top] [All Lists]

Re: Fixed display - SpriteSurface, Map & going insane

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Fixed display - SpriteSurface, Map & going insane
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Wed, 30 Jul 2003 10:15:03 -0700
At 12:02 PM -0500 7/30/03, Eric wrote:

The +1 is because SpriteSurface uses -1,-1 at first and will cause
an outofbounds error when trying to access that in the array.
So I just need to changed the -1,-1 to 0,0 if xpos and ypos = -1.
That fixed that problem. YEA!!!!!!!

....as long as you don't scroll, or we don't change the implementation to buffer more of the surrounding area. A much better solution would be to compare the xpos and ypos the PaintTile event gives you against the bounds of your array, and if it's out of bounds, just return.

- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
.


<Prev in Thread] Current Thread [Next in Thread>