This commit is contained in:
King_DuckZ 2014-12-13 00:22:50 +01:00
parent 0da607ab3d
commit bd241bbbd2
2 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ namespace dk {
#if defined(NDEBUG) #if defined(NDEBUG)
template <> template <>
inline size_t get_index_from_pos ( const Vector<CoordinateScalarType, 2>& parPos, const Vector<CoordinateScalarType, 2>& parSize ) a_pure; inline size_t get_index_from_pos<2> ( const Vector<CoordinateScalarType, 2>& parPos, const Vector<CoordinateScalarType, 2>& parSize ) a_pure;
#endif #endif
} //namespace implem } //namespace implem
@ -38,7 +38,7 @@ namespace dk {
ptrdiff_t distance_to ( const TileIterator& parOther ); ptrdiff_t distance_to ( const TileIterator& parOther );
bool equal ( const TileIterator& parOther ) const; bool equal ( const TileIterator& parOther ) const;
T& dereference ( void ) const { return (*m_data)[get_current_index()]; } T& dereference ( void ) const { return (*m_data)[get_current_index()]; }
size_t get_current_index ( void ) const { return implem::get_index_from_pos(m_pos, m_total); } size_t get_current_index ( void ) const { return implem::get_index_from_pos<D>(m_pos, m_total); }
coords m_pos; coords m_pos;
coords m_from; coords m_from;

View file

@ -16,7 +16,7 @@ namespace dk {
#if defined(NDEBUG) #if defined(NDEBUG)
template <> template <>
inline size_t get_index_from_pos (const Vector<CoordinateScalarType, 2>& parPos, const Vector<CoordinateScalarType, 2>& parSize) { inline size_t get_index_from_pos<2> (const Vector<CoordinateScalarType, 2>& parPos, const Vector<CoordinateScalarType, 2>& parSize) {
return parPos.y() * parSize.x() + parPos.x(); return parPos.y() * parSize.x() + parPos.x();
} }
#endif #endif