2015-08-17 13:39:28 +00:00
|
|
|
namespace dk {
|
2015-05-24 15:17:53 +00:00
|
|
|
template <typename T, typename T1>
|
|
|
|
inline
|
2015-08-17 15:36:45 +00:00
|
|
|
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);
|
2015-05-24 15:17:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T, typename T1>
|
|
|
|
inline
|
2015-08-17 15:36:45 +00:00
|
|
|
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);
|
2015-05-24 15:17:53 +00:00
|
|
|
}
|
|
|
|
|
2015-08-17 11:36:47 +00:00
|
|
|
template <uint32_t D, typename T, typename T1>
|
2015-05-24 15:17:53 +00:00
|
|
|
inline
|
2015-08-17 15:36:45 +00:00
|
|
|
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);
|
2015-05-24 15:17:53 +00:00
|
|
|
}
|
|
|
|
|
2015-08-17 15:36:45 +00:00
|
|
|
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;
|
|
|
|
}
|
2015-08-17 13:39:28 +00:00
|
|
|
} //namespace dk
|