SPR_releaseSprite breaks on large sprites
Posted: Sun May 29, 2016 11:08 am
Best way to describe this is with code.
I haven't looked at the SPR_releaseSprite code but it seems to be freeing the wrong entries in the sprite list whenever a large sprite exists. This has caused very amusing behaviour, like half the HUD taking place of an enemy, and jumping spikes (scarier than the boss ).
Happy to say though that the laggy areas are running at 60 now.
Code: Select all
// Load 2 large sprites (bigger than 4x4)
Sprite *spr[2] = {
SPR_addSprite(&SPR_Igor, 80, 80, TILE_ATTR(PAL2, 1, 0, 0)),
SPR_addSprite(&SPR_Balfrog, 160, 80, TILE_ATTR(PAL3, 1, 0, 0))
};
// Release and re-add first one
SPR_releaseSprite(spr[0]);
spr[0] = SPR_addSprite(&SPR_Igor, 80, 120, TILE_ATTR(PAL2, 1, 0, 0));
// Second sprite has been chopped
Happy to say though that the laggy areas are running at 60 now.