FA> The problem I have is that when I try to move the sprite,
FA> you can see the color of the background... The reason for
FA> this is that it seems that I'm showing the background and
FA> the foreground (the sprite) for the same amount of time)...
Read in a block bigger than the sprite, or keep a separate
version of the background in a buffer.
Imagine a 4x4 sprite. (too small, but this is example only)
oo This sprite will use a 6x6 block as a movement area.
oo You read the background info for the full block, then
place the sprite in its new position. This way, you update
the background and the sprite in one move, cutting your
writes to video memory in half. If the background buffer is
outside of video memory, that will also speed your display,
since reading from video is much slower than reading from
standard RAM.
You will still run into trouble when you have two sprites
in close proximity or crossing eachother. Then you will
need to take your background data and paste your sprites on
in order of precedence so that the foremost will be pasted
on last. Then you just blit the whole areas in which there
are sprites onto the screen. This works best where you can
utilize page flipping, such as in ModeX, where you can have
three or four pages of 320x200x256 or 320x240x256 video.
In these modes, you just write to one page while displaying
another, and then flip to the new page with ONE retrace
delay, for a very fast, very smooth display.
> ] ERROR: Demon not responding. Open pentagram to continue.....
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|