diff options
author | Oxore <oxore@protonmail.com> | 2017-12-02 09:57:42 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2017-12-02 09:57:42 +0300 |
commit | e150d54ca90a8d1cc99ce4d1b8285f5ea971e279 (patch) | |
tree | 5408bf8981b4b7ebf27ccc18a4896be3ea2b1903 /include | |
parent | f3703c8096d985c57fee9a716cd0af4d2c6bc89f (diff) |
Yaml loader for text resources added, need to be involved
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 27 | ||||
-rw-r--r-- | include/text.h | 20 |
2 files changed, 44 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h index 5f64a2b..136edaa 100644 --- a/include/common.h +++ b/include/common.h @@ -61,10 +61,31 @@ typedef struct Game { int level; } Game; +/* ======== text.[c|h] types =========== */ + +typedef struct List { + void *obj; + void *next; + void *prev; +} List; + +typedef struct Pair { + void *k; + void *v; +} Pair; + +typedef struct KeyMap { + Pair *pair; + void *next; + void *prev; +} KeyMap; + typedef struct Text { - sfFont *font; - sfText *text; - sfVector2f pos; + char *font; + char *type; + char *scene; + char *text; + void *sfText; } Text; #endif diff --git a/include/text.h b/include/text.h new file mode 100644 index 0000000..7948c51 --- /dev/null +++ b/include/text.h @@ -0,0 +1,20 @@ +#include <SFML/Graphics.h> +#include "common.h" + +FILE *openFile(char *filename); +void checkArgs(int argc, char **argv); +KeyMap *KeyMap_getLast(KeyMap **keyMap); +KeyMap *KeyMap_new(KeyMap **keyMap); +KeyMap *KeyMap_get(KeyMap **keyMap, const void *key); +KeyMap *KeyMap_put(KeyMap **keyMap, const void *key, const void *value); +List *List_getLast(List **list); +List *List_new(List **list); +List *ListOfKeyMapOfString_getFromYaml(char *filename); +void KeyMapOfString_free(KeyMap *keyMap); +void ListOfKeyMapOfString_free(List **list); +int _loadText_getInt(void *obj, char *key); +char *_loadText_getString(void *obj, char *key); +void _loadText_initSfText(Text *objo, void *obji); +List *ListOfText_getFromListOfKeyMapOfString(List *list); +void Text_free(Text *obj); +void ListOfText_free(List **list); |