Mostly nuking old system
This commit is contained in:
@@ -6,4 +6,5 @@
|
||||
# Sources
|
||||
target_sources(${DUSK_LIBRARY_TARGET_NAME}
|
||||
PUBLIC
|
||||
palette.c
|
||||
)
|
||||
8
src/display/palette/palette.c
Normal file
8
src/display/palette/palette.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "palette.h"
|
||||
@@ -8,7 +8,11 @@
|
||||
#pragma once
|
||||
#include "display/color.h"
|
||||
|
||||
#define PALETTE_COUNT 4
|
||||
|
||||
typedef struct {
|
||||
const uint8_t colorCount;
|
||||
const color_t *colors;
|
||||
} palette_t;
|
||||
} palette_t;
|
||||
|
||||
extern palette_t PALETTES[PALETTE_COUNT];
|
||||
@@ -12,14 +12,15 @@
|
||||
#include "asset/asset.h"
|
||||
|
||||
texture_t DEFAULT_FONT_TEXTURE;
|
||||
tileset_t DEFAULT_FONT_TILESET;
|
||||
|
||||
errorret_t textInit(void) {
|
||||
errorChain(assetLoad(DEFAULT_FONT_TILESET.image, &DEFAULT_FONT_TEXTURE));
|
||||
// errorChain(assetLoad(DEFAULT_FONT_TILESET.image, &DEFAULT_FONT_TEXTURE));
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void textDispose(void) {
|
||||
textureDispose(&DEFAULT_FONT_TEXTURE);
|
||||
// textureDispose(&DEFAULT_FONT_TEXTURE);
|
||||
}
|
||||
|
||||
void textDrawChar(
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
#include "asset/asset.h"
|
||||
#include "display/texture.h"
|
||||
#include "display/tileset/tileset.h"
|
||||
#include "display/tileset/tileset_minogram.h"
|
||||
|
||||
#define TEXT_CHAR_START '!'
|
||||
|
||||
extern texture_t DEFAULT_FONT_TEXTURE;
|
||||
#define DEFAULT_FONT_TILESET TILESET_MINOGRAM
|
||||
// extern texture_t DEFAULT_FONT_TEXTURE;
|
||||
// #define DEFAULT_FONT_TILESET TILESET_MINOGRAM
|
||||
|
||||
/**
|
||||
* Initializes the text system.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "util/memory.h"
|
||||
#include "util/math.h"
|
||||
#include "util/string.h"
|
||||
#include "display/palette/palettelist.h"
|
||||
#include "debug/debug.h"
|
||||
|
||||
const texture_t *TEXTURE_BOUND = NULL;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "tileset.h"
|
||||
#include "display/tileset/tilesetlist.h"
|
||||
#include "assert/assert.h"
|
||||
#include "util/string.h"
|
||||
|
||||
@@ -34,13 +33,4 @@ void tilesetPositionGetUV(
|
||||
outUV[1] = ((float_t)row) * tileset->uv[1];
|
||||
outUV[2] = outUV[0] + tileset->uv[0];
|
||||
outUV[3] = outUV[1] + tileset->uv[1];
|
||||
}
|
||||
|
||||
const tileset_t * tilesetGetByName(const char_t *name) {
|
||||
assertStrLenMin(name, 1, "Tileset name cannot be empty");
|
||||
for(uint32_t i = 0; i < TILESET_LIST_COUNT; i++) {
|
||||
if(stringCompare(TILESET_LIST[i]->name, name) != 0) continue;
|
||||
return TILESET_LIST[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -45,12 +45,4 @@ void tilesetPositionGetUV(
|
||||
const uint16_t column,
|
||||
const uint16_t row,
|
||||
vec4 outUV
|
||||
);
|
||||
|
||||
/**
|
||||
* Gets a tileset by its name.
|
||||
*
|
||||
* @param name The name of the tileset to get.
|
||||
* @return The tileset with the given name, or NULL if not found.
|
||||
*/
|
||||
const tileset_t* tilesetGetByName(const char_t *name);
|
||||
);
|
||||
Reference in New Issue
Block a user