mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-11 11:18:40 +00:00
58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
/**
|
|
* Jingga
|
|
*
|
|
* @copyright Jingga
|
|
* @license License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
#ifndef TOS_ASSET_FILE_H
|
|
#define TOS_ASSET_FILE_H
|
|
|
|
#include "../stdlib/Types.h"
|
|
|
|
enum AssetType {
|
|
ASSET_TYPE_RAW_IMG,
|
|
ASSET_TYPE_PNG,
|
|
|
|
ASSET_TYPE_RAW_SOUND,
|
|
ASSET_TYPE_WAV,
|
|
|
|
ASSET_TYPE_OBJBIN,
|
|
ASSET_TYPE_MATBIN,
|
|
ASSET_TYPE_ANIBIN,
|
|
|
|
ASSET_TYPE_RAW_TEXTURE, // may include bump map, normal map, ...
|
|
};
|
|
|
|
struct AssetFileTableOfContent {
|
|
uint32 asset_id;
|
|
AssetType asset_type;
|
|
uint64 asset_offset;
|
|
};
|
|
|
|
struct AssetFileHeader {
|
|
uint32 version;
|
|
uint32 asset_count;
|
|
AssetFileTableOfContent* table_of_content;
|
|
};
|
|
|
|
struct AssetFile {
|
|
AssetFileHeader header;
|
|
byte* data;
|
|
};
|
|
|
|
void asset_file_load_header(void* fp, AssetFileHeader* header) {}
|
|
|
|
void asset_file_write_header() {}
|
|
|
|
// add asset at end (automatically) or in pos
|
|
void asset_file_add_asset(void* fp, AssetFile* asset_file, byte* asset, int64 pos = -1) {}
|
|
|
|
// remove asset by id or pos
|
|
void asset_file_remove_asset(void* fp, AssetFile* asset_file, int64 id, int64 pos = -1) {}
|
|
|
|
// load the toc info of an asset by id or pos
|
|
AssetFileTableOfContent* asset_file_load_asset_toc(AssetFileHeader* header, int64 id, int64 pos = -1) {}
|
|
|
|
#endif |