Clearing the screen

SGDK only sub forum

Moderator: Stef

Post Reply
TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Clearing the screen

Post by TechnoZealot » Mon May 06, 2013 2:29 am

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!

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Mon May 06, 2013 6:44 am

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?

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Mon May 06, 2013 9:44 am

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?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon May 06, 2013 10:18 am

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.

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Tue May 07, 2013 1:48 am

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.

kubilus1
Very interested
Posts: 237
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Tue May 07, 2013 2:32 am

Yes, you can use BMP files as sprite lists.

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

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Tue May 07, 2013 3:18 am

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.

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Tue May 07, 2013 3:34 am

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.

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Tue May 07, 2013 4:00 am

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

Post Reply