namespace dk { template Viewport::Viewport (Tyler& parTyler) : m_tyler(parTyler) { } template Viewport::Viewport (Tyler& parTyler, const coords& parSize, const coords& parPos) : m_size(parSize), m_position(parPos), m_tyler(parTyler) { m_tyler.preload(m_position, m_position + m_size); } template template typename Layer::iterator Viewport::begin (Layer& parLayer) const { typedef typename Layer::iterator IterType; return IterType(&parLayer.m_tiles, m_position, m_position + m_size); } template template typename Layer::iterator Viewport::end (Layer& parLayer) const { typedef typename Layer::iterator IterType; const auto to(m_position + m_size); return IterType(&parLayer.m_tiles, implem::buildPastEndCoordinate(m_position, to), to); } template void Viewport::setSize (const coords& parSize) { m_size = parSize; m_tyler.preload(m_position, m_position + m_size); } template void Viewport::setFrom (const coords& parFrom) { m_position = parFrom; m_tyler.preload(m_position, m_position + m_size); } template void Viewport::setFromSize (const coords& parFrom, const coords& parSize) { m_position = parFrom; m_size = parSize; m_tyler.preload(m_position, m_position + m_size); } } //namespace dk