This commit is contained in:
2025-09-01 11:10:28 -05:00
parent 368729f0f3
commit 3ce1566a2e
14 changed files with 105 additions and 17 deletions

View File

@@ -8,6 +8,7 @@ target_sources(${DUSK_TARGET_NAME}
PRIVATE
display.c
camera.c
palette.c
)
# Subdirectories

19
src/display/palette.c Normal file
View File

@@ -0,0 +1,19 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "palette.h"
#include "assert/assert.h"
palette_t PALETTE[PALETTE_COUNT_MAX];
uint8_t PALETTE_COUNT = 0;
void paletteAssetLoadCallback(void *data) {
assertNotNull(data, "Data cannot be NULL.");
uint8_t index = *((uint8_t*)data);
assertTrue(index < PALETTE_COUNT_MAX, "Palette index out of bounds.");
}

26
src/display/palette.h Normal file
View File

@@ -0,0 +1,26 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dusk.h"
typedef struct {
} palette_t;
#define PALETTE_COUNT_MAX 8
extern palette_t PALETTE[PALETTE_COUNT_MAX];
extern uint8_t PALETTE_COUNT;
/**
* Palette asset load callback.
*
* @param data The data passed to the callback, should be a uint8_t* index
* into the PALETTE array.
*/
void paletteAssetLoadCallback(void *data);