aboutsummaryrefslogtreecommitdiff
path: root/headers/TZR_types.h
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-02-14 02:25:48 +0100
committerkdx <kikoodx@paranoici.org>2023-02-14 02:26:32 +0100
commita1377ecb55ba9fb180553a020381431085931cee (patch)
treeb96ff4e817bff9522374151c35790c0b04d8f89c /headers/TZR_types.h
parenteff3bfdd813490f028e9e2f9ab1e37fa50671893 (diff)
downloadtzr-a1377ecb55ba9fb180553a020381431085931cee.tar.gz
load typed resources
Diffstat (limited to 'headers/TZR_types.h')
-rw-r--r--headers/TZR_types.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/headers/TZR_types.h b/headers/TZR_types.h
index f83d764..1d8da5c 100644
--- a/headers/TZR_types.h
+++ b/headers/TZR_types.h
@@ -15,6 +15,7 @@ typedef unsigned int TZR_Uint;
typedef struct TZR_Point TZR_Point;
typedef struct TZR_Rect TZR_Rect;
typedef enum TZR_ResourceType TZR_ResourceType;
+typedef struct TZR_Raw TZR_Raw;
typedef struct TZR_Image TZR_Image;
typedef struct TZR_Resource TZR_Resource;
typedef struct TZR_Element TZR_Element;
@@ -31,6 +32,11 @@ struct TZR_Rect {
TZR_Point to;
};
+struct TZR_Raw {
+ void *data;
+ size_t size;
+};
+
struct TZR_Image {
int width, height;
SDL_Texture *ptr;
@@ -40,8 +46,8 @@ struct TZR_Resource {
TZR_ResourceType type;
char *path; /* allocated and freed by TZR; can be NULL */
union {
- void *raw; /* raw file data */
- struct TZR_Image image;
+ TZR_Raw raw; /* raw file data */
+ TZR_Image image;
};
};