This site is no longer active and is available for archival purposes only. Registration and login is disabled.

frame animation??


frame animation??

Postby impe20 » Feb 18, 2005 @ 7:50am

impe20
pm Member
 
Posts: 18
Joined: Jan 18, 2005 @ 3:25pm


Postby Structure » Feb 18, 2005 @ 11:00am

A float, A float, My kingdom for a float
User avatar
Structure
pm Member
 
Posts: 147
Joined: Sep 17, 2004 @ 8:28pm
Location: UK


Postby Kiyote » Feb 18, 2005 @ 6:18pm

The .Net wrapper I wrote has some rudimentary support for this. Load a GapiSurface and set the .Frames property. Then when you blit, one of the overloaded Blit methods takes a FrameIndex parameter.

The only catch is that your sprite frames have to be laid out horizontally.
Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby InexorableTash » Feb 19, 2005 @ 5:30am

Note that storing frames in one large surface can negatively impact performance. Modern processors (like ARM) cache data in blocks - if you read byte 5, bytes 0 ... 255 are probably cached as well.

If you think about this, it means that when you're drawing one frame from a horizontal strip you're probably using only a fraction of each cached block per row of the surface. I.e. if you were using the frame made up of 'x' pixels in this strip:

ooooooooxxxxxxxxoooooooooooooooooooooooooooooooo
ooooooooxxxxxxxxoooooooooooooooooooooooooooooooo
ooooooooxxxxxxxxoooooooooooooooooooooooooooooooo
ooooooooxxxxxxxxoooooooooooooooooooooooooooooooo

... then odds are all of the 'o' pixels will get cached as well. So you might have to hit memory 4 times (once per row) rather than just once if you had a single frame with 'x' in it.

If you stack the frames vertically, on the other hand, you'll will have cache coherency of the data. (I'm kinda sleepy, but I think this holds true even when GapiDraw loads and rotates the images, but someone should confirm.)

You might want to write a routine that slices up your frames into different surfaces on load.
User avatar
InexorableTash
pm Member
 
Posts: 99
Joined: Sep 13, 2002 @ 6:14am


Postby Guest » Feb 19, 2005 @ 8:59am

Guest
 


Postby InexorableTash » Feb 19, 2005 @ 11:41pm

User avatar
InexorableTash
pm Member
 
Posts: 99
Joined: Sep 13, 2002 @ 6:14am


Postby impe20 » Mar 17, 2005 @ 9:26am

impe20
pm Member
 
Posts: 18
Joined: Jan 18, 2005 @ 3:25pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron