DoorKeeper/include/doorkeeper/implem/pixelconv.inl

51 lines
1.4 KiB
C++

namespace dk {
template <typename T, typename T1>
inline
Vector<2> get_diamond_coordinates (const TileIterator<T, 2, T1>& parIterator, const Vector<2>& parSize) {
PixelConvDiamond pconv(true, true);
return pconv.to_pixel(parIterator.position(), parSize);
}
template <typename T, typename T1>
inline
Vector<2> get_half_diamond_coordinates (const TileIterator<T, 2, T1>& parIterator, const Vector<2>& parSize) {
PixelConvHalfDiamond pconv(true);
return pconv.to_pixel(parIterator.position(), parSize);
}
template <uint32_t D, typename T, typename T1>
inline
Vector<D> get_square_coordinates (const TileIterator<T, D, T1>& parIterator, const Vector<D>& parSize) {
PixelConvSquare<D> pconv;
return pconv.to_pixel(parIterator.position(), parSize);
}
template <typename T, typename T1>
inline
Vector<2> get_hex_coordinates (const TileIterator<T, 2, T1>& parIterator, const Vector<2>& parSize) {
PixelConvHex pconv(true);
return pconv.to_pixel(parIterator.position(), parSize);
}
template <uint32_t D>
PixelConv<D>::PixelConv (MapTypes parType) :
m_map_type(parType)
{
}
template <uint32_t D>
MapTypes PixelConv<D>::map_type() const {
return m_map_type;
}
template <uint32_t D>
PixelConvSquare<D>::PixelConvSquare() :
base_class(MapType_Orthogonal)
{
}
template <uint32_t D>
auto PixelConvSquare<D>::to_pixel (const coords& parFrom, const coords& parSize) const -> coords {
return parFrom * parSize;
}
} //namespace dk