From febe0827adb3ba9617f00c0d0da9ddc80958d7ce Mon Sep 17 00:00:00 2001 From: Teo-CD Date: Sun, 9 Jun 2019 15:56:54 +0200 Subject: [PATCH] Fixed x,y in Entity constructor not being pro_maat::GridUnit --- src/Entity.cpp | 2 +- src/Entity.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Entity.cpp b/src/Entity.cpp index 85e7bf5..ee3d9f2 100644 --- a/src/Entity.cpp +++ b/src/Entity.cpp @@ -10,7 +10,7 @@ const std::map Entity::entityTypeLookup = { {"House",EntityType::House}, {"Car",EntityType::Car}}; -Entity::Entity(int x, int y, EntityType type, sf::Texture* texture, int width, int height) : type(type) +Entity::Entity(pro_maat::GridUnit x, pro_maat::GridUnit y, EntityType type, sf::Texture* texture, int width, int height) : type(type) { shape = sf::RectangleShape(sf::Vector2f(width*pro_maat::pixelsPerUnit,height*pro_maat::pixelsPerUnit)); // Sets the origin at the center of the entity diff --git a/src/Entity.h b/src/Entity.h index 1e49601..275ad11 100644 --- a/src/Entity.h +++ b/src/Entity.h @@ -42,7 +42,8 @@ class Entity { public: /// x,y, width and height are in grid coordinates - Entity(int x, int y, EntityType type, sf::Texture* texture, int width = 1, int height = 1); + Entity(pro_maat::GridUnit x, pro_maat::GridUnit y, EntityType type, sf::Texture* texture, int width = 1, + int height = 1); explicit Entity(const pugi::xml_node& entityNode, sf::Texture* texture); void move(Orientation orientation);