The old question:
Just so I don't start like fifty different topics, I'll ask my new question here, it's related:
Does AGS only load a sprite once it's currently being used? I have an idea for tinting the colours of characters in 8-bit and I need to access their sprites as they're being used, and I need to know whether or not AGS keeps the sprites past the point they're being used.
Basically, I need to know if I can catch a character's current ViewFrame sprite as it's being loaded with AGSE_SPRITELOAD, run my image process on it, and then repeat for every frame of their animation. I don't want strange things like tinted sprites showing up when I've turned tinting off, or normal sprites showing up. Does the sprite get unloaded as soon as the view moves on to the next frame?
Spoiler
Hey, I'm just finishing off some functions in my translucency plugin, and I've come up with a problem that I can't solve easily. I'm trying to make sure that I can keep the translucency consistent with the real colours of a sprite while I cycle the palette (so I can have, for instance, a translucent waterfall that cycles while still being translucent or a magical rainbow that cycles). For this, I assume I need to create some way of creating an array of values that points the renderer to the right part of the LUT (if 22 cycles to 23, then entry 23 on the LUT needs to be rerouted to 22's entry, or any translucent sprite containing index 23 will still treat it as if it was the original colour)
I'm running into problems because I don't think I'm approaching this right. I have a function to remap an array in parallel to palette cycling, not sure if I'm doing it right:
Code: C++
It's meant to match what happens to the palette slots when called with CyclePalette, but it just seems to turn everything one colour. Is this code even right?
I'm running into problems because I don't think I'm approaching this right. I have a function to remap an array in parallel to palette cycling, not sure if I'm doing it right:
unsigned char cycle_remap [256];
void ResetRemapping () //Called when a room is loaded, so that the array corresponds 1:1 with the palette.
{
for (int j = 0; j < 256; ++j)
{
cycle_remap [j] = j;
}
}
void CycleRemap (int start, int end)
{
if (end > start)
{
int diff = end - start;
int i = 0;
int wraparound = cycle_remap [end];
while (i < diff)
{
cycle_remap [end-i-1] = cycle_remap [end-i];
i++;
}
cycle_remap [start] = wraparound;
}
else
{
int diff = start - end;
int i = 0;
int wraparound = cycle_remap [start];
while (i < diff)
{
cycle_remap [end+i+1] = cycle_remap [end+i];
i++;
}
}
}
It's meant to match what happens to the palette slots when called with CyclePalette, but it just seems to turn everything one colour. Is this code even right?
[close]
Just so I don't start like fifty different topics, I'll ask my new question here, it's related:
Does AGS only load a sprite once it's currently being used? I have an idea for tinting the colours of characters in 8-bit and I need to access their sprites as they're being used, and I need to know whether or not AGS keeps the sprites past the point they're being used.
Basically, I need to know if I can catch a character's current ViewFrame sprite as it's being loaded with AGSE_SPRITELOAD, run my image process on it, and then repeat for every frame of their animation. I don't want strange things like tinted sprites showing up when I've turned tinting off, or normal sprites showing up. Does the sprite get unloaded as soon as the view moves on to the next frame?