No need for requiring int position here.

This commit is contained in:
King_DuckZ 2017-02-08 16:37:59 +00:00
parent 24d67c7cd6
commit f91ff6625f
2 changed files with 3 additions and 3 deletions

View file

@ -133,10 +133,10 @@ namespace curry {
return parWorld.tile_size() * parWorld.world_size(); return parWorld.tile_size() * parWorld.world_size();
} }
vec2us pixel_to_world_tile (const WorldGrid& parWorld, const vec2i& parPos) { vec2us pixel_to_world_tile (const WorldGrid& parWorld, const vec2f& parPos) {
assert(position_is_on_map(parWorld, parPos)); assert(position_is_on_map(parWorld, parPos));
return vector_cast<vec2us>( return vector_cast<vec2us>(
parPos / vector_cast<vec2i>(parWorld.tile_size()) parPos / vector_cast<vec2f>(parWorld.tile_size())
); );
} }

View file

@ -61,6 +61,6 @@ namespace curry {
}; };
vec2i world_size_pixel (const WorldGrid& parWorld); vec2i world_size_pixel (const WorldGrid& parWorld);
vec2us pixel_to_world_tile (const WorldGrid& parWorld, const vec2i& parPos); vec2us pixel_to_world_tile (const WorldGrid& parWorld, const vec2f& parPos);
bool position_is_on_map (const WorldGrid& parWorld, const vec2i& parPos); bool position_is_on_map (const WorldGrid& parWorld, const vec2i& parPos);
} //namespace curry } //namespace curry