Enabled SDL_image's support for PNG and TIFF files and improved the

AssetManager with a hashing function, a linked list structure to store
the hashes as well as a reference counter to support multiple users
sharing the same asset.
This commit is contained in:
abdelrahman committed 2022-09-24 04:17:16 +01:00
1 parent 3f71cf0f3f
commit dfee36ffe9
12 files changed
+292 -60

No files matched your search

+9 -1
View File
@@ -6,6 +6,10 @@
#include "engine_build_config.h"
#include "reusable_ids.h"
#ifdef __cplusplus
extern "C" {
#endif // !__cplusplus
typedef void (*EventHandlerPtr)(const SDL_Event *event, void *object);
typedef void (*UpdateFuncPtr)(float delta, void *object);
typedef void (*RenderFuncPtr)(void *object);
@@ -15,7 +19,7 @@ typedef struct object_store ObjectStore;
ObjectStore *create_object_store();
ObjectID add_object_to_store(ObjectStore *os, void *object, EventHandlerPtr eh,
UpdateFuncPtr uf, RenderFuncPtr rf);
void remove_object_from_store(ObjectStore *os, ObjectID id);
void remove_object_from_store(ObjectStore *os, ObjectID *id_ptr);
void handle_all_objects_events(ObjectStore *os, const SDL_Event *event);
void update_all_objects(ObjectStore *os, float delta);
void render_all_objects(ObjectStore *os);
@@ -25,4 +29,8 @@ void destroy_object_store(ObjectStore *os);
void print_objects(ObjectStore *os);
#endif // !DEBUG_ENGINE
#ifdef __cplusplus
}
#endif // !__cplusplus
#endif // !OBJECT_STORE_H