#include <Palette.hpp>
Static Public Member Functions | |
static void | copyPalette (const bool palettes16c, const bool paletteAmainOAM, const uint paletteAIndex, const bool paletteBmainOAM, const uint paletteBIndex) |
copies palette A to palette B. | |
static void | copyPalette16c (const bool paletteAmainOAM, const uint paletteAIndex, const bool paletteBmainOAM, const uint paletteBIndex) |
copies 16 color palette A to palette B. | |
static void | copyPalette256c (const bool paletteAmainOAM, const uint paletteAIndex, const bool paletteBmainOAM, const uint paletteBIndex) |
copies 16 color palette A to palette B. | |
static void | freePalette (const bool mainOAM, const bool palette16c, const uint paletteIndex) |
frees a palette so other sprites can use it. | |
static uint | reserveEmptyPalette (const bool mainOAM, const bool palette16c) |
reserves an empty palette to use. | |
static void | writeToPalette (const bool mainOAM, const bool palette16c, const uint paletteIndex, const u16 *palettePointer, const uint paletteLength) |
copies the palette data for sprites into the right palette. | |
static void | writeToPalette16c (const bool mainOAM, const uint paletteIndex, const u16 *palettePointer, const uint paletteLength) |
writes the palette data for 16 colored sprites into the right palette. | |
static void | writeToPalette256c (const bool mainOAM, const uint paletteIndex, const u16 *palettePointer, const uint paletteLength) |
writes the palette data for 256 colored sprites into the right palette. | |
Static Public Attributes | |
static const uint | NUMBER_OF_PALETTES = 16 |
a constant for the number of palettes there are for each mode. |
static void DSOL::Sprites::Palette::copyPalette | ( | const bool | palettes16c, | |
const bool | paletteAmainOAM, | |||
const uint | paletteAIndex, | |||
const bool | paletteBmainOAM, | |||
const uint | paletteBIndex | |||
) | [inline, static] |
copies palette A to palette B.
both palettes must have the same color length(16 or 256).
palettes16c | true if both palettes are for 16 color sprites, false for 256 color. | |
paletteAmainOAM | true if palette A is for main OAM, false for sub OAM. | |
paletteAIndex | the index of palette A. | |
paletteBmainOAM | true if palette B is for main OAM, false for sub OAM. | |
paletteBIndex | the index of palette B. |
static void DSOL::Sprites::Palette::copyPalette16c | ( | const bool | paletteAmainOAM, | |
const uint | paletteAIndex, | |||
const bool | paletteBmainOAM, | |||
const uint | paletteBIndex | |||
) | [static] |
copies 16 color palette A to palette B.
paletteAmainOAM | true if palette A is for main OAM, false for sub OAM. | |
paletteAIndex | the index of palette A. | |
paletteBmainOAM | true if palette B is for main OAM, false for sub OAM. | |
paletteBIndex | the index of palette B. |
static void DSOL::Sprites::Palette::copyPalette256c | ( | const bool | paletteAmainOAM, | |
const uint | paletteAIndex, | |||
const bool | paletteBmainOAM, | |||
const uint | paletteBIndex | |||
) | [static] |
copies 16 color palette A to palette B.
paletteAmainOAM | true if palette A is for main OAM, false for sub OAM. | |
paletteAIndex | the index of palette A. | |
paletteBmainOAM | true if palette B is for main OAM, false for sub OAM. | |
paletteBIndex | the index of palette B. |
static void DSOL::Sprites::Palette::freePalette | ( | const bool | mainOAM, | |
const bool | palette16c, | |||
const uint | paletteIndex | |||
) | [static] |
frees a palette so other sprites can use it.
this will free a palette that has been reserved with reserveEmptyPalette() so that other sprites can use it.
mainOAM | true if the palette is for the main oam, false otherwise. | |
palette16c | true if the palette needs to be for 16 color sprites, false for 256 color sprites. | |
paletteIndex | the index to be freed, should be an index gotten with reserveEmptyPalette(). |
static uint DSOL::Sprites::Palette::reserveEmptyPalette | ( | const bool | mainOAM, | |
const bool | palette16c | |||
) | [static] |
reserves an empty palette to use.
this will check if there are palettes that hasn't been reserved yet, and reserves and returns it if there are onreserved palettes. there are 16 palettes for 16 color sprites and 16 palettes for 256 color sprites
mainOAM | true if the palette is for the main oam, false otherwise | |
palette16c | true if the palette needs to be for 16 color sprites, false for 256 color sprites |
static void DSOL::Sprites::Palette::writeToPalette | ( | const bool | mainOAM, | |
const bool | palette16c, | |||
const uint | paletteIndex, | |||
const u16 * | palettePointer, | |||
const uint | paletteLength | |||
) | [inline, static] |
copies the palette data for sprites into the right palette.
mainOAM | true if the palette data will be used for main OAM, false for sub OAM. | |
palette16c | true if the palette is for 16 color sprites, false for 256 color sprites. | |
paletteIndex | the index to the palette, preferably obtained with using reserveEmptyPalette(). | |
palettePointer | a pointer to the palette data. | |
paletteLength | the length of the data in bytes. |
static void DSOL::Sprites::Palette::writeToPalette16c | ( | const bool | mainOAM, | |
const uint | paletteIndex, | |||
const u16 * | palettePointer, | |||
const uint | paletteLength | |||
) | [static] |
writes the palette data for 16 colored sprites into the right palette.
mainOAM | true if the palette data will be used for main OAM, false for sub OAM. | |
paletteIndex | the index to the palette, preferably obtained with using reserveEmptyPalette(). | |
palettePointer | a pointer to the palette data. | |
paletteLength | the length of the data in bytes, must be 0 - 16*sizeof(u16). |
static void DSOL::Sprites::Palette::writeToPalette256c | ( | const bool | mainOAM, | |
const uint | paletteIndex, | |||
const u16 * | palettePointer, | |||
const uint | paletteLength | |||
) | [static] |
writes the palette data for 256 colored sprites into the right palette.
mainOAM | true if the palette data will be used for main OAM, false for sub OAM. | |
paletteIndex | the index to the palette, preferably obtained with using reserveEmptyPalette(). | |
palettePointer | a pointer to the palette data. | |
paletteLength | the length of the data in bytes, must be 0 - 256*sizeof(u16). |
const uint DSOL::Sprites::Palette::NUMBER_OF_PALETTES = 16 [static] |
a constant for the number of palettes there are for each mode.