namespace dk { ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template LayerBase::LayerBase (const coords& parCount, const coords& parTileSize, const coords& parMasterTileSize) : m_count(parCount / (parMasterTileSize / parTileSize)), m_tilesize(parTileSize), m_mastersize(parMasterTileSize) { DK_ASSERT((parMasterTileSize / parTileSize) * parTileSize == parMasterTileSize); } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template Layer::Layer (const coords& parTileSize, const coords& parMasterTileSize, TileMapData& parTilemap) : LayerBase(parTilemap.mapSize(), parTileSize, parMasterTileSize), m_tilemap(parTilemap) { } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template typename Layer::iterator Layer::begin() { return iterator(&m_tiles, coords(0), this->m_count); } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template typename Layer::iterator Layer::end() { return iterator(&m_tiles, implem::buildPastEndCoordinate(coords(0), this->m_count), this->m_count); } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template void Layer::preload (const coords& parFrom, const coords& parTo) { m_tiles.clear(); const auto area = implem::area(parTo - parFrom); m_tiles.reserve(area); m_tilemap.fetch(m_tiles, parFrom, parTo); //m_streamer->copy(m_tiles, parFrom, parTo);:w } }