Page 1 of 1

Clearing the screen

Posted: Mon May 06, 2013 2:29 am
by TechnoZealot
Sorry to ask such a noobish question :) , this is my first post ever, but what is the best and most efficient way to clear the screen when using SGDK?

When I use VDP_fillTileMapRect with a blank tile I created, it is horribly slow.

What should I do?

I'd appreciate any help at all.

Thanks, SpritesMind!

Posted: Mon May 06, 2013 6:44 am
by TechnoZealot
I feel I sort of didn't really explain my situation in the most descriptive terms. Basically, what I am trying to do is preventing my moving sprites from leaving "trails" behind on the screen. Do I need to have something in Plane B to combat this?

Posted: Mon May 06, 2013 9:44 am
by oofwill
When using a command such VDP_setSpritePosition(), then VDP_updateSprites(), no need to remove the sprite from is old position. This is done automatically when sprite's move.

I don't know if i've really understood your problem?

Posted: Mon May 06, 2013 10:18 am
by Stef
If your sprites leave "trails" is does mean you are doing your own sprites in software by writing to "frame buffer" ?? You should use the hardware sprites instead as Oofwill said.

Posted: Tue May 07, 2013 1:48 am
by TechnoZealot
I used the method described in:

viewtopic.php?t=1429


How do I set up sprites and load them into memory from a bmp file?

Also, can I use sprite-strips for animations?

Thank you so much for helping me out, by the way.

Posted: Tue May 07, 2013 2:32 am
by kubilus1
Yes, you can use BMP files as sprite lists.

I did something like you are asking here: viewtopic.php?t=1312

Posted: Tue May 07, 2013 3:18 am
by TechnoZealot
Thanks! I think I've finally got this sort of working.

However the BMP sprite I'm using is 32x40.

Currently, it's only displaying the very top of the sprite.

I saw something about a 4x4 tile limit for sprites. Is that true? If so, how can I display something larger as a sprite?

Thanks.

Posted: Tue May 07, 2013 3:34 am
by Mask of Destiny
TechnoZealot wrote: However the BMP sprite I'm using is 32x40.

Currently, it's only displaying the very top of the sprite.

I saw something about a 4x4 tile limit for sprites. Is that true? If so, how can I display something larger as a sprite?
You are correct about the size limit. If you want to display a larger sprite, you need to split it into smaller sprites.

Posted: Tue May 07, 2013 4:00 am
by TechnoZealot
I'm guessing it would probably be a good idea to create a struct of some sort of hold multiple sprites together by their positions.

How would I load a BMP that is larger than 4x4 titles and split it among sprites?

Will I need to use pointer magic? =P