My code:
Code: Select all
//SPR_reset();
//SPR_clear();
VDP_resetSprites();
VDP_updateSprites(0, FALSE);
//SPR_defragVRAM();
VDP_clearPlan(PLAN_A, TRUE);
VDP_clearPlan(PLAN_B, TRUE);
Thank you!
Moderator: Stef
Code: Select all
//SPR_reset();
//SPR_clear();
VDP_resetSprites();
VDP_updateSprites(0, FALSE);
//SPR_defragVRAM();
VDP_clearPlan(PLAN_A, TRUE);
VDP_clearPlan(PLAN_B, TRUE);
Code: Select all
SPR_releaseSprite(arrRope[lastIndex]);
arrRope[lastIndex] = SPR_addSpriteSafe(&rope_2_32, shootStartX_p1 + 1, shootStartY_p1 - 2 - (lastIndex * 32) - 32, TILE_ATTR(PAL1, FALSE, FALSE, FALSE));
Errrr that's exactly what the function is supposed to do then. It doesn't matter if the table is fully cleared as long as the player doesn't see any sprites on screen. In particular, any sprites not referenced in the linked list may as well not exist.cloudstrifer wrote: ↑Mon Sep 02, 2019 5:00 pmI don't see it at screen, I see on Gens VDP sprites list (Gens > CPU > Debug > Genesis > VDP Sprites).
Thank you.
My problem is when I need to replace a sprite by another one.Sik wrote: ↑Mon Sep 02, 2019 5:22 pmErrrr that's exactly what the function is supposed to do then. It doesn't matter if the table is fully cleared as long as the player doesn't see any sprites on screen. In particular, any sprites not referenced in the linked list may as well not exist.cloudstrifer wrote: ↑Mon Sep 02, 2019 5:00 pmI don't see it at screen, I see on Gens VDP sprites list (Gens > CPU > Debug > Genesis > VDP Sprites).
Thank you.
It sounds like your real problem is a different thing though, judging from the following post?
Yeah, when you don't need a sprite, just release it using SPR_releaseSprite(..) method.cloudstrifer wrote: ↑Mon Sep 02, 2019 5:08 pmI want do release a sprite and replace it with another sprite.
Please, tell me if the code bellow is a good pratice.
Sorry for ask too much questions.Code: Select all
SPR_releaseSprite(arrRope[lastIndex]); arrRope[lastIndex] = SPR_addSpriteSafe(&rope_2_32, shootStartX_p1 + 1, shootStartY_p1 - 2 - (lastIndex * 32) - 32, TILE_ATTR(PAL1, FALSE, FALSE, FALSE));
OFF
@stef, if you have some time, please look my post about NM2WCH.
Thank you!