Fixed mirage tower time blending.
This commit is contained in:
parent
7d8e63a44b
commit
c9845c66ee
1 changed files with 10 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "palette_util.h"
|
#include "palette_util.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "overworld.h"
|
||||||
|
|
||||||
// "RouletteFlash" is more accurately a general flashing/fading util
|
// "RouletteFlash" is more accurately a general flashing/fading util
|
||||||
// this file handles fading the palettes for the color/icon selections on the Roulette wheel
|
// this file handles fading the palettes for the color/icon selections on the Roulette wheel
|
||||||
|
@ -247,7 +248,7 @@ int InitPulseBlendPaletteSettings(struct PulseBlend *pulseBlend, const struct Pu
|
||||||
|
|
||||||
if (pulseBlendPalette == NULL)
|
if (pulseBlendPalette == NULL)
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
|
|
||||||
pulseBlendPalette->blendCoeff = 0;
|
pulseBlendPalette->blendCoeff = 0;
|
||||||
pulseBlendPalette->fadeDirection = 0;
|
pulseBlendPalette->fadeDirection = 0;
|
||||||
pulseBlendPalette->available = 1;
|
pulseBlendPalette->available = 1;
|
||||||
|
@ -322,7 +323,7 @@ void MarkUsedPulseBlendPalettes(struct PulseBlend *pulseBlend, u16 pulseBlendPal
|
||||||
pulseBlend->usedPulseBlendPalettes |= 1 << i;
|
pulseBlend->usedPulseBlendPalettes |= 1 << i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnmarkUsedPulseBlendPalettes(struct PulseBlend *pulseBlend, u16 pulseBlendPaletteSelector, u8 multiSelection)
|
void UnmarkUsedPulseBlendPalettes(struct PulseBlend *pulseBlend, u16 pulseBlendPaletteSelector, u8 multiSelection)
|
||||||
|
@ -385,7 +386,12 @@ void UpdatePulseBlend(struct PulseBlend *pulseBlend)
|
||||||
if (--pulseBlendPalette->delayCounter == 0xFF)
|
if (--pulseBlendPalette->delayCounter == 0xFF)
|
||||||
{
|
{
|
||||||
pulseBlendPalette->delayCounter = pulseBlendPalette->pulseBlendSettings.delay;
|
pulseBlendPalette->delayCounter = pulseBlendPalette->pulseBlendSettings.delay;
|
||||||
BlendPalette(pulseBlendPalette->pulseBlendSettings.paletteOffset, pulseBlendPalette->pulseBlendSettings.numColors, pulseBlendPalette->blendCoeff, pulseBlendPalette->pulseBlendSettings.blendColor);
|
// TODO: Optimize pulse blending
|
||||||
|
CpuFastCopy(gPlttBufferUnfaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, 32);
|
||||||
|
UpdatePalettesWithTime(1 << (pulseBlendPalette->pulseBlendSettings.paletteOffset >> 4));
|
||||||
|
// pulseBlendSettings has a numColors field, but it is only ever set to 16 (for mirage tower)
|
||||||
|
// So, it's ok to use the fine blending here which blends the entire palette
|
||||||
|
BlendPalettesFine(1, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, pulseBlendPalette->blendCoeff, pulseBlendPalette->pulseBlendSettings.blendColor);
|
||||||
switch (pulseBlendPalette->pulseBlendSettings.fadeType)
|
switch (pulseBlendPalette->pulseBlendSettings.fadeType)
|
||||||
{
|
{
|
||||||
case 0: // Fade all the way to the max blend amount, then wrap around
|
case 0: // Fade all the way to the max blend amount, then wrap around
|
||||||
|
@ -423,7 +429,7 @@ void UpdatePulseBlend(struct PulseBlend *pulseBlend)
|
||||||
pulseBlendPalette->blendCoeff = 0;
|
pulseBlendPalette->blendCoeff = 0;
|
||||||
else
|
else
|
||||||
pulseBlendPalette->blendCoeff = pulseBlendPalette->pulseBlendSettings.maxBlendCoeff & 0xF;
|
pulseBlendPalette->blendCoeff = pulseBlendPalette->pulseBlendSettings.maxBlendCoeff & 0xF;
|
||||||
|
|
||||||
pulseBlendPalette->fadeDirection ^= 1;
|
pulseBlendPalette->fadeDirection ^= 1;
|
||||||
pulseBlendPalette->fadeCycleCounter++;
|
pulseBlendPalette->fadeCycleCounter++;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue