This thread is related to a problem I am facing animating statically loaded sprites;
Sprites that are loaded using "SPR_loadAllFrames()" function;
for the rest of sprites, we can call them dinamically loaded ones (due to only a single frame is loaded in VRAM at a time),
the "SPR_SetFrame()" function works ok.
Dinamically sprites are declared in this way using "sprite.res" (all sprites are presented in a single row):
SPRITE ebody_asset "sprite/16c/ebodyf_4x3.bmp" 4 3 NONE 0
A zero is set, due to automatic animation is not desire; sprite tick functions are shared (not 100% possible) with their Atari STE version counterparts, where animation is based in change the frame to show explicitly, such "SPR_SetFrame()" function does.
But statically loaded sprites, such grenade sprite (that takes only 12 tiles) are declared in the same way (all sprites are presented in a single row):
SPRITE grenade_asset "sprite/16c/grenade_2x2.bmp" 2 2 BEST 0
FYI: Due to these are full loaded into VRAM, BEST compression is suitable for them,
But despite I tried code like this:
Code: Select all
sprTileIndexes[0] = SPR_loadAllFrames(&grenade_asset, 1600, NULL);
...
//Further in the game code
id = EntitySpawn(EntityType_EGRENADE,x_location,y_location);
...
//At enemies grenade tick function
TileIndex = sprTileIndexes[0][entidad[id].spr->animInd][entidad[id].frame];
//Obviously id is the number retrieved with EntitySpawn function
SPR_setVRAMTileIndex(entidad[id].spr,TileIndex);
only if I declare these static loaded sprites such:
SPRITE grenade_asset "sprite/16c/grenade_2x2.bmp" 2 2 BEST 1 //or 2... 3
the sprite is being automatically animated, but its not the desired behaviour;
due to a lost of control and similarity with already written tick function code.
Thanks in advance,