1
0
Fork 0
2022-untitled-game/code/game/engine/asset_mgr.h

121 lines
1.8 KiB
C
Raw Normal View History

2022-08-02 16:35:50 +00:00
#pragma once
typedef struct asset_mgr {
struct {
hash_t hash;
size_t count;
mesh_t data[MAX_MESH_COUNT];
} meshes;
struct {
hash_t hash;
size_t count;
material_t data[MAX_MATERIAL_COUNT];
} materials;
struct {
size_t count;
transform_t data[MAX_TRANSFORM_COUNT];
} transforms;
struct {
hash_t hash;
size_t count;
camera_t data[MAX_CAMERA_COUNT];
} cameras;
struct {
size_t count;
renderable_t data[MAX_RENDERABLE_COUNT];
} renderables;
struct {
size_t count;
box_collider_t data[MAX_COLLIDER_COUNT];
} colliders;
struct {
size_t count;
point_light_t data[MAX_LIGHT_COUNT];
} lights;
struct {
hash_t hash;
size_t count;
sound_t data[MAX_SOUND_COUNT];
} sounds;
struct {
hash_t hash;
size_t count;
audio_source_t data[MAX_SOUND_COUNT];
} audio_sources;
} asset_mgr_t;
void
asset_mgr_startup(void);
void
insert_mesh(mesh_t mesh);
void
insert_material(material_t material);
void
insert_sound(sound_t sound);
void
insert_audio_source(audio_source_t source);
void
insert_transform(transform_t transform);
void
insert_camera(camera_t camera);
void
insert_renderable(renderable_t renderable);
void
insert_collider(box_collider_t collider);
void
insert_light(point_light_t light);
handle_t
get_mesh_handle(const char* name);
mesh_t*
get_mesh(handle_t handle);
handle_t
get_material_handle(const char* name);
material_t*
get_material(handle_t handle);
handle_t
get_sound_handle(const char* name);
sound_t*
get_sound(handle_t handle);
handle_t
get_audio_source_handle(const char* name);
audio_source_t*
get_audio_source(handle_t handle);
renderable_t*
get_renderable(handle_t handle);
transform_t*
get_transform(handle_t handle);
handle_t
get_camera_handle(const char* name);
camera_t*
get_camera(handle_t handle);