2021-11-01 18:55:13 +00:00
|
|
|
#pragma once
|
2022-09-27 12:56:48 +00:00
|
|
|
#include "platform/system.h"
|
2021-11-01 18:55:13 +00:00
|
|
|
|
|
|
|
#define ASSET_INVALID 0xFF
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
// NOTE(zaklaus): Debug
|
2021-11-02 10:48:32 +00:00
|
|
|
ASSET_EMPTY,
|
2022-08-09 14:46:23 +00:00
|
|
|
ASSET_BLANK,
|
2022-09-28 18:40:59 +00:00
|
|
|
ASSET_BLOCK_FRAME,
|
2021-11-03 18:09:19 +00:00
|
|
|
ASSET_BUILDMODE_HIGHLIGHT,
|
2022-09-28 05:29:32 +00:00
|
|
|
|
2021-11-01 18:55:13 +00:00
|
|
|
// NOTE(zaklaus): entities
|
|
|
|
ASSET_PLAYER,
|
|
|
|
ASSET_THING,
|
2022-08-09 14:46:23 +00:00
|
|
|
ASSET_CHEST,
|
2022-09-28 05:29:32 +00:00
|
|
|
ASSET_FURNACE,
|
|
|
|
|
2021-11-01 18:55:13 +00:00
|
|
|
// NOTE(zaklaus): items
|
|
|
|
ASSET_DEMO_ICEMAKER,
|
2022-09-28 05:29:32 +00:00
|
|
|
|
2021-11-02 10:48:32 +00:00
|
|
|
// NOTE(zaklaus): blocks
|
|
|
|
ASSET_FENCE,
|
2021-11-02 11:49:03 +00:00
|
|
|
ASSET_DEV,
|
|
|
|
ASSET_GROUND,
|
|
|
|
ASSET_DIRT,
|
|
|
|
ASSET_WATER,
|
|
|
|
ASSET_LAVA,
|
|
|
|
ASSET_WALL,
|
|
|
|
ASSET_HILL,
|
|
|
|
ASSET_HILL_SNOW,
|
|
|
|
ASSET_HOLE,
|
2021-11-02 17:09:54 +00:00
|
|
|
ASSET_WOOD,
|
|
|
|
ASSET_TREE,
|
2022-09-28 05:29:32 +00:00
|
|
|
ASSET_COAL,
|
|
|
|
ASSET_IRON_ORE,
|
|
|
|
ASSET_IRON_INGOT,
|
|
|
|
|
2021-11-02 17:58:55 +00:00
|
|
|
ASSET_BELT,
|
2021-11-02 17:09:54 +00:00
|
|
|
ASSET_BELT_LEFT,
|
|
|
|
ASSET_BELT_RIGHT,
|
|
|
|
ASSET_BELT_UP,
|
|
|
|
ASSET_BELT_DOWN,
|
2022-09-28 05:29:32 +00:00
|
|
|
|
2022-09-27 12:56:48 +00:00
|
|
|
MAX_ASSETS = 1024,
|
2021-11-01 18:55:13 +00:00
|
|
|
} asset_id;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
AKIND_TEXTURE,
|
2021-11-04 12:34:15 +00:00
|
|
|
AKIND_ANIM,
|
2021-11-01 18:55:13 +00:00
|
|
|
AKIND_SOUND,
|
2022-09-28 05:29:32 +00:00
|
|
|
|
2021-11-01 18:55:13 +00:00
|
|
|
FORCE_AKIND_UINT8 = UINT8_MAX
|
|
|
|
} asset_kind;
|
|
|
|
|
2022-09-27 15:22:13 +00:00
|
|
|
int32_t assets_setup(void);
|
|
|
|
int32_t assets_frame(void);
|
|
|
|
void assets_destroy(void);
|
2021-11-01 18:55:13 +00:00
|
|
|
|
|
|
|
uint16_t assets_find(asset_id id);
|
|
|
|
|
|
|
|
asset_kind assets_get_kind(uint16_t id);
|
|
|
|
void *assets_get_snd(uint16_t id);
|
|
|
|
void *assets_get_tex(uint16_t id);
|
|
|
|
|
|
|
|
// NOTE(zaklaus): client only
|
|
|
|
#define ASSET_SRC_RECT() ((Rectangle){0, 0, 64, 64})
|
|
|
|
#define ASSET_DST_RECT(x,y) ((Rectangle){x, y, 64, 64})
|