Fix test names, fix build in tilecoordinates.
I'm not sure the functions will still return the correct screen coordinates. For now it builds, I will add tests in the next commits.
This commit is contained in:
parent
981ec02afd
commit
4d8cbc4085
7 changed files with 70 additions and 26 deletions
|
@ -4,11 +4,10 @@ namespace dkh {
|
|||
dk::Vector<2> get_diamond_coordinates (const dk::TileIterator<T, 2, T1>& parIterator, const dk::Vector<2>& parSize) {
|
||||
typedef dk::Vector<2> vec;
|
||||
|
||||
const auto abspos(parIterator.abs_position());
|
||||
const auto from(dk::implem::get_from_from_iterator(parIterator));
|
||||
const dk::CoordinateScalarType xoffs = abspos.y() % 2;
|
||||
const auto from(parIterator.position());
|
||||
const dk::CoordinateScalarType xoffs = from.y() % 2;
|
||||
|
||||
return (abspos - from) * parSize + vec(xoffs * parSize.x() / 2, 0);
|
||||
return from * parSize + vec(xoffs * parSize.x() / 2, 0);
|
||||
}
|
||||
|
||||
template <typename T, typename T1>
|
||||
|
@ -18,10 +17,10 @@ namespace dkh {
|
|||
return get_diamond_coordinates(parIterator, parSize / vec(1, 2));
|
||||
}
|
||||
|
||||
template <typename T, uint32_t D, typename T1>
|
||||
template <uint32_t D, typename T, typename T1>
|
||||
inline
|
||||
dk::Vector<D> get_square_coordinates (const dk::TileIterator<T, D, T1>& parIterator, const dk::Vector<D>& parSize) {
|
||||
return (parIterator.abs_position() - dk::implem::get_from_from_iterator(parIterator)) * parSize;
|
||||
return parIterator.position() * parSize;
|
||||
}
|
||||
|
||||
//template <typename T, typename T1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue