Right now i'm using VDP_setPaletteColors.
The problem i'm having is that when i call my function which contains a sequence of palette changes within a loop, Only the last change will be applied.
IE:
Code: Select all
void ScrollPalettes
{
for(blabla = 0; blabla < NumOfDefinedPalettes; blabla ++)
{
VDP_setPaletteColors(0,arrayOfPalettes[blabla],16);
}
}
I also tried doing it without a loop
Code: Select all
void ScrollPalettes
{
VDP_setPaletteColors(0, predefinedpalette0, 16);
VDP_setPaletteColors(0, predefinedpalette1, 16);
VDP_setPaletteColors(0, predefinedpalette2, 16);
VDP_setPaletteColors(0, predefinedpalette3, 16);
}
But only the last palette change gets executed and shows on screen, All the other palette changes happen in between frames and don't get a chance to be applied and displayed.
EDIT:
I got it working with VDP_waitVsync.
However, i still have a problem.
I'm trying to change the PLAN_B image in the background while the palette change happends.
Knowing that there's a small delay when changing background images i tried to load the new image while the palette change is happening(Which takes a couple frames).
However, Calling the VDP draw image after calling the palette change function, causes the loading to start after the whole palette scroll sequence is over.
Is there any way to initiate the VDP_drawImage loading while the palette scrolling function is working and then immediately changing the BG layer to that image once the palette change is done?