From 5483805a16b604e74ecbeb681264638ab5579b1f Mon Sep 17 00:00:00 2001
From: Anonymus Raccoon
Date: Wed, 1 Apr 2020 17:31:55 +0200
Subject: [PATCH] Generizing tile's type
---
include/tile.h | 5 +----
src/isometry/isometry.c | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/tile.h b/include/tile.h
index a730043..f19b509 100644
--- a/include/tile.h
+++ b/include/tile.h
@@ -12,9 +12,6 @@
#include
#include "entity.h"
-enum tile_type {
- TILE_TYPE_NONE
-};
struct tile
{
@@ -23,7 +20,7 @@ struct tile
char data;
struct gc_entity *entity;
bool solid;
- enum tile_type type;
+ char *type;
};
#endif //MY_RPG_TILE_H
diff --git a/src/isometry/isometry.c b/src/isometry/isometry.c
index 70e29f4..4658b7d 100644
--- a/src/isometry/isometry.c
+++ b/src/isometry/isometry.c
@@ -75,7 +75,7 @@ bool init_data(struct tile *tile, gc_vector2i c, node *n, gc_scene *scene)
tmp = xml_gettmpstring(n, "texture", NULL);
tile->texture = scene->get_data(scene, "sprite", tmp);
tile->solid = xml_getbool(n, "solid", false);
- tile->type = TILE_TYPE_NONE;
+ tile->type = xml_getproperty(n, "type");
return (true);
}