Asset custom ready.

This commit is contained in:
2025-11-08 08:41:32 -06:00
parent cf2aacd75b
commit ab534bb998
6 changed files with 40 additions and 14 deletions

View File

@@ -8,6 +8,8 @@
#pragma once
#include "type/assetpaletteimage.h"
#include "type/assetalphaimage.h"
#include "type/assetlanguage.h"
#include <zip.h>
typedef enum {
ASSET_TYPE_NULL,
@@ -19,18 +21,21 @@ typedef enum {
typedef enum {
ASSET_LOAD_STRAT_ENTIRE,
ASSET_LOAD_STRAT_TEST
ASSET_LOAD_STRAT_CUSTOM
} assetloadstrat_t;
typedef struct assetcustom_s {
zip_file_t *zipFile;
void *output;
} assetcustom_t;
typedef struct {
const char_t *header;
const size_t dataSize;
const assetloadstrat_t loadStrategy;
union {
errorret_t (*entire)(void *data, void *output);
struct {
void *test;
} test;
errorret_t (*custom)(assetcustom_t *custom);
};
} assettypedef_t;
@@ -55,10 +60,7 @@ static const assettypedef_t ASSET_TYPE_DEFINITIONS[ASSET_TYPE_COUNT] = {
[ASSET_TYPE_LANGUAGE] = {
.header = "DLF",
.loadStrategy = ASSET_LOAD_STRAT_TEST,
.dataSize = 0, // Variable size
.test = {
.test = NULL
}
.loadStrategy = ASSET_LOAD_STRAT_CUSTOM,
.custom = assetLanguageInit
}
};