Roughly planning asset locking

This commit is contained in:
2025-09-01 22:07:36 -05:00
parent 14c41d33a7
commit f915a4208b
3 changed files with 74 additions and 0 deletions

34
src/asset/asset.h Normal file
View File

@@ -0,0 +1,34 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "assetpaletteimage.h"
#include "util/reflist.h"
#define ASSET_HEADER_SIZE 3
#define ASSET_REFERENCE_COUNT_MAX 8
typedef enum {
ASSET_STATE_NOT_LOADED,
ASSET_STATE_LOADING,
ASSET_STATE_LOADED,
ASSET_STATE_ERROR,
} assetstate_t;
typedef enum {
ASSET_TYPE_UNKNOWN,
ASSET_TYPE_PALETTE_IMAGE,
} assettype_t;
typedef struct {
const char_t filename[FILENAME_MAX];
ref_t refListArray[ASSET_REFERENCE_COUNT_MAX];
reflist_t refList;
assetstate_t state;
assettype_t type;
void *data;
} asset_t;