38 lines
899 B
Text
38 lines
899 B
Text
|
namespace dk {
|
||
|
template <typename T, uint32_t D>
|
||
|
Tile<T, D>::Tile (T* parData, const TileCoords<D>& parPos, const coords& parBlockOffs, const PixelConv<D>* parPConv) :
|
||
|
m_position(parPos),
|
||
|
m_block_offs(parBlockOffs),
|
||
|
m_pixconv(parPConv),
|
||
|
m_data(parData)
|
||
|
{
|
||
|
DK_ASSERT(m_pixconv);
|
||
|
DK_ASSERT(m_data);
|
||
|
}
|
||
|
|
||
|
template <typename T, uint32_t D>
|
||
|
const T& Tile<T, D>::data() const {
|
||
|
return *m_data;
|
||
|
}
|
||
|
|
||
|
template <typename T, uint32_t D>
|
||
|
T& Tile<T, D>::data() {
|
||
|
return *m_data;
|
||
|
}
|
||
|
|
||
|
template <typename T, uint32_t D>
|
||
|
auto Tile<T, D>::block_position() const -> const coords& {
|
||
|
return m_position.position();
|
||
|
}
|
||
|
|
||
|
template <typename T, uint32_t D>
|
||
|
const TileCoords<D>& Tile<T, D>::raw_coords() const {
|
||
|
return m_position;
|
||
|
}
|
||
|
|
||
|
template <typename T, uint32_t D>
|
||
|
auto Tile<T, D>::screen_position() const -> coords {
|
||
|
return m_pixconv->to_pixel(m_position.position());
|
||
|
}
|
||
|
} //namespace dk
|