DEbug not working so moving pcs
This commit is contained in:
@@ -5,4 +5,39 @@
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "palette.h"
|
||||
#include "palette.h"
|
||||
#include "assert/assert.h"
|
||||
#include "util/memory.h"
|
||||
|
||||
palette_t PALETTES[PALETTE_COUNT_MAX] = { 0 };
|
||||
|
||||
void paletteInit(
|
||||
palette_t *palette,
|
||||
const uint8_t colorCount,
|
||||
const color_t *colors
|
||||
) {
|
||||
assertNotNull(palette, "Palette cannot be NULL");
|
||||
assertTrue(colorCount > 0, "Color count must be greater than 0");
|
||||
assertNotNull(colors, "Colors array cannot be NULL");
|
||||
assertTrue(colorCount <= PALETTE_COLOR_COUNT_MAX, "Color count too big");
|
||||
assertTrue(
|
||||
palette - PALETTES < PALETTE_COUNT_MAX,
|
||||
"Palette index out of range"
|
||||
);
|
||||
|
||||
memoryZero(palette, sizeof(palette_t));
|
||||
|
||||
palette->colorCount = colorCount;
|
||||
memoryCopy(colors, palette->colors, colorCount * sizeof(color_t));
|
||||
}
|
||||
|
||||
void paletteBind(palette_t *palette, const uint8_t slot) {
|
||||
assertNotNull(palette, "Palette cannot be NULL");
|
||||
assertTrue(slot < PALETTE_COUNT_MAX, "Palette slot out of range");
|
||||
|
||||
// Nothing yet.
|
||||
}
|
||||
|
||||
void paletteDispose(palette_t *palette) {
|
||||
assertNotNull(palette, "Palette cannot be NULL");
|
||||
}
|
||||
Reference in New Issue
Block a user