src/scene/shared/kolima_palette.c
Kolima Forest, while Tret's curse lasts (FLAG_KOLIMA_CURSE_LIFTED clear): the forest's colours turned redder and darker, and both sets of colours kept for the script where the curse lifts.
Included by kolima_forest_cliff.c, kolima_forest_floodgate.c, kolima_forest_glade.c and kolima_forest_tree.c.
Macros
| Name | Description | |
|---|---|---|
#define | BG_COLOR_INDEX (palette, color) ((palette) * PALETTE_COLORS + (color)) | Background colour color of palette palette, counted from colour 0. |
#define | KOLIMA_WATER_PALETTE 1 | The background palettes whose first colours are the water's blues, colours 1 to 7 of the one and 1 to 8 of the other, which the curse leaves as they are. |
#define | KOLIMA_SECOND_WATER_PALETTE 12 | |
#define | KOLIMA_PALETTE_WORDS (2 * PALETTE_FADE_BG_COLORS * sizeof(Uint16) / 4) | The size of a kept set of colours: the palette fade's background and sprite colours. |
Functions
| Name | Description | |
|---|---|---|
static Uint16 | scKolimaPaletteCurseColor (Uint16 color, Sint32 divisor) | One cursed colour: red gains 1 / (4 * divisor) of itself, up to RGB_LEVEL_MAX, and green and blue lose 1 / divisor. |
static void | scKolimaPaletteSaveHealthy (void) | Keeps the healthy colours: the palette fade's colours into KolimaPaletteHealthy. |
static void | scKolimaPaletteSaveCursed (void) | Keeps the cursed colours: the palette fade's colours into KolimaPaletteCursed. |
static void | scKolimaPaletteCapture (void) | Copies the palettes on the screen, background and sprites, into the palette fade's buffer as the colours to fade from. |
void | scKolimaPaletteCurse (Sint32 divisor) | Keeps the healthy colours, curses the background colours but the water's by divisor, keeps the cursed colours too, and shows them. |
void | scKolimaPaletteRestore (Sint32 second) | Makes the healthy colours (second 0) or the cursed ones (second 1) the colours to fade to; the script then fades with fdPaletteFadeStartInterpolation. |
Variables
| Name | Description | |
|---|---|---|
extern Uint8 | KolimaPaletteHealthy [] | The healthy colours, kept by scKolimaPaletteSaveHealthy; each scene defines the 1792 bytes. |
extern Uint8 | KolimaPaletteCursed [] | The cursed colours, kept by scKolimaPaletteSaveCursed. |
Description
Kolima Forest, while Tret's curse lasts (FLAG_KOLIMA_CURSE_LIFTED clear): the
forest's colours turned redder and darker, and both sets of colours kept for
the script where the curse lifts.
Macros in detail
BG_COLOR_INDEX
#define BG_COLOR_INDEX(palette, color) ((palette) * PALETTE_COLORS + (color))
Background colour color of palette palette, counted from colour 0.
Referenced by scKolimaPaletteCurse().
Definition at line 8 of file kolima_palette.c.
KOLIMA_WATER_PALETTE
#define KOLIMA_WATER_PALETTE 1
The background palettes whose first colours are the water's blues, colours 1 to 7 of the one and 1 to 8 of the other, which the curse leaves as they are. At Tret's tree the second palette's are tans.
Referenced by scKolimaPaletteCurse().
Definition at line 13 of file kolima_palette.c.
KOLIMA_SECOND_WATER_PALETTE
#define KOLIMA_SECOND_WATER_PALETTE 12
Referenced by scKolimaPaletteCurse().
Definition at line 14 of file kolima_palette.c.
KOLIMA_PALETTE_WORDS
#define KOLIMA_PALETTE_WORDS (2 * PALETTE_FADE_BG_COLORS * sizeof(Uint16) / 4)
The size of a kept set of colours: the palette fade's background and sprite colours.
Referenced by scKolimaPaletteRestore(), scKolimaPaletteSaveCursed() and scKolimaPaletteSaveHealthy().
Definition at line 18 of file kolima_palette.c.
Functions in detail
scKolimaPaletteCurseColor
static Uint16 scKolimaPaletteCurseColor(Uint16 color, Sint32 divisor)
One cursed colour: red gains 1 / (4 * divisor) of itself, up to
RGB_LEVEL_MAX, and green and blue lose 1 / divisor.
References Sint32 and syMathDivide().
Referenced by scKolimaPaletteCurse().
Definition at lines 26 and 56 of file kolima_palette.c.
scKolimaPaletteSaveHealthy
static void scKolimaPaletteSaveHealthy(void)
Keeps the healthy colours: the palette fade's colours into
KolimaPaletteHealthy.
References KolimaPaletteHealthy and syDMAXCopy().
Referenced by scKolimaPaletteCurse().
Definition at lines 27 and 76 of file kolima_palette.c.
scKolimaPaletteSaveCursed
static void scKolimaPaletteSaveCursed(void)
Keeps the cursed colours: the palette fade's colours into
KolimaPaletteCursed.
References KolimaPaletteCursed and syDMAXCopy().
Referenced by scKolimaPaletteCurse().
Definition at lines 28 and 86 of file kolima_palette.c.
scKolimaPaletteCapture
static void scKolimaPaletteCapture(void)
Copies the palettes on the screen, background and sprites, into the palette fade's buffer as the colours to fade from.
References fdPaletteFadeSetSource() and syDMAXCopy().
Referenced by scKolimaPaletteCurse() and scKolimaPaletteRestore().
Definition at lines 29 and 96 of file kolima_palette.c.
scKolimaPaletteCurse
void scKolimaPaletteCurse(Sint32 divisor)
Keeps the healthy colours, curses the background colours but the water's by divisor, keeps the cursed colours too, and shows them.
References fdPaletteFadeSetTarget(), scKolimaPaletteCapture(), scKolimaPaletteCurseColor(), scKolimaPaletteSaveCursed(), scKolimaPaletteSaveHealthy() and Sint32.
Referenced by scInit().
Definition at line 33 of file kolima_palette.c.
scKolimaPaletteRestore
void scKolimaPaletteRestore(Sint32 second)
Makes the healthy colours (second 0) or the cursed ones (second 1) the
colours to fade to; the script then fades with
fdPaletteFadeStartInterpolation.
References fdPaletteFadeSetTarget(), KolimaPaletteCursed, KolimaPaletteHealthy, scKolimaPaletteCapture(), Sint32 and syDMAXCopy().
Referenced by scKolimaForestTreeRestoreTret() and scKolimaForestTreeUpdateHealingPalette().
Definition at line 114 of file kolima_palette.c.