39 lines
943 B
C
39 lines
943 B
C
/**
|
|
* 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); |