Fixing the position of the entity drawn by the map

This commit is contained in:
Anonymus Raccoon
2020-03-31 23:16:19 +02:00
parent ce4a554fd7
commit 5dfbd44533
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ struct vertex_component *info, float dt)
return;
tl = get_tile_from_pos(info, gc_vector2_add(pos, *(gc_vector2 *)&w));
for (i = 0; info->map[i].corners[0]; i++) {
sfmlrenderer_manage_hovered_tile(this, &info->map[i] == tl);
sfmlrenderer_manage_hovered_tile(this, &info->map[i] == tl || info->map[i].entity);
sfmlrenderer_draw_tile(engine, pos, &info->map[i], dt);
}
// printf("-----------------------------------------------------------\n");
+1 -1
View File
@@ -21,7 +21,7 @@ struct tile *tile, gc_vector2 map_offset) {
link->tile = tile;
if (!tra)
return;
tra->position = gc_vector2_from_coords(c->x, c->y, c->z);
tra->position = gc_vector2_from_coords(c->x + .5, c->y + .5, c->z);
tra->position.x += map_offset.x;
tra->position.y += map_offset.y;
tra->position.y *= -1;