No need for requiring int position here.
This commit is contained in:
parent
24d67c7cd6
commit
f91ff6625f
2 changed files with 3 additions and 3 deletions
|
@ -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())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue