Page 1 of 1

How to reuse full loaded frames for many sprites?

Posted: Mon Nov 01, 2021 1:52 pm
by masteries
Greetings mates,

I am trying to reuse full loaded frames for many different sprites, with no success.

I loaded full frames for a single sprite, released the sprite; and the frame data still remains in VRAM;
after this I wan trying to create sprite with Auto tile upload disable... but with no clue regarding how to point the exact tile number for each frame...

Obviously, this bizarre trial doesn´t work well.


Next image illustrates the need:

Image

Each enemy shoot needs to share the same full loaded frames, as well it is neccesary to disable dinamically tile uploading for these "bullet" sprites, due to all frames (4 tiles) are always loaded in VRAM

Usually, I manage the VRAM tile index used by each sprite type via SPR_setVRAMTileIndex after a call to SPR_addSprite .

As well, enemy soldier leg sprites will need to share their full loaded frames.
Some sprites are currently a composition of 2 sprites, in order to save memory and create an easier animation code.


Thanks in advance,

Re: How to reuse full loaded frames for many sprites?

Posted: Tue Nov 02, 2021 8:55 am
by masteries
Learned a way to do it, from the Sonic sample.

SOLVED

Re: How to reuse full loaded frames for many sprites?

Posted: Thu Jan 20, 2022 10:56 pm
by danibus
masteries wrote:
Tue Nov 02, 2021 8:55 am
Learned a way to do it, from the Sonic sample.

SOLVED
Can you post how u solved it? It will help a lot other folks!

Re: How to reuse full loaded frames for many sprites?

Posted: Wed Feb 02, 2022 1:17 pm
by masteries
danibus wrote:
Thu Jan 20, 2022 10:56 pm
masteries wrote:
Tue Nov 02, 2021 8:55 am
Learned a way to do it, from the Sonic sample.

SOLVED
Can you post how u solved it? It will help a lot other folks!
I encoutered problems with player and enemy bullets,
the workaround is based in create these sprites, do not destroy them,
and relocate them out of screen when not used