Asset refactor

This commit is contained in:
2026-04-03 12:56:04 -05:00
parent 0885da8d44
commit da1a5a3f1b
59 changed files with 1032 additions and 726 deletions

View File

@@ -0,0 +1,39 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
#include "display/color.h"
#define ASSET_TEXTURE_WIDTH_MAX 2048
#define ASSET_TEXTURE_HEIGHT_MAX 2048
#define ASSET_TEXTURE_SIZE_MAX ( \
ASSET_TEXTURE_WIDTH_MAX * ASSET_TEXTURE_HEIGHT_MAX \
)
typedef struct assetentire_s assetentire_t;
#pragma pack(push, 1)
typedef struct {
char_t header[3];
uint8_t version;
uint8_t type;
uint32_t width;
uint32_t height;
uint8_t data[ASSET_TEXTURE_SIZE_MAX * sizeof(color4b_t)];
} assettexture_t;
#pragma pack(pop)
/**
* Loads a palettized texture from the given data pointer into the output
* texture.
*
* @param data Pointer to the raw assettexture_t data.
* @param output Pointer to the texture_t to load the image into.
* @return An error code.
*/
errorret_t assetTextureLoad(assetentire_t entire);