Completing the fdctr of the fixed to cam component

This commit is contained in:
Anonymus Raccoon
2020-04-15 13:44:22 +02:00
parent 1c6bd7b4b7
commit 67386416c6
+4 -1
View File
@@ -44,7 +44,6 @@ static void fdctr(gc_entity *entity, gc_scene *scene, void *component, node *n)
struct renderer *rend = GETCMP(entity, renderer);
char *tmp;
n = xml_getnode(n, "Position");
cmp->pos.x = xml_getintprop(n, "x");
cmp->pos.y = xml_getintprop(n, "y");
tmp = xml_gettempprop(n, "x");
@@ -52,7 +51,11 @@ static void fdctr(gc_entity *entity, gc_scene *scene, void *component, node *n)
tmp = xml_gettempprop(n, "y");
cmp->per_y = tmp && my_strchr(tmp, '%');
cmp->size_x = xml_getintprop(n, "width");
tmp = xml_gettempprop(n, "width");
cmp->per_w = tmp && my_strchr(tmp, '%');
cmp->size_y = xml_getintprop(n, "height");
tmp = xml_gettempprop(n, "height");
cmp->per_h = tmp && my_strchr(tmp, '%');
if (!rend)
my_printf("Missing a renderer on an entity fixed to the cam.\n");
else {