namespace dk { ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template Tyler::Tyler (const coords& parTileSize) : m_size(0), m_tilesize(parTileSize) { } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template typename Tyler::coords::scalar_type Tyler::tiles_count() const { typename coords::scalar_type retval = 1; for (uint32_t d = 0; d < D; ++d) { retval *= m_size[d]; } return retval; } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template template Layer& Tyler::push_layer (BaseMapSource* parTilemap, int parIndex) { return push_layer(parTilemap, coords(static_cast(1)), parIndex); } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template template Layer& Tyler::push_layer (BaseMapSource* parTilemap, const coords& parSubdiv, int parIndex) { //TODO: store the index (void)parIndex; auto newLayer = new Layer(m_tilesize / parSubdiv, m_tilesize, parTilemap); if (m_size == coords(0)) { m_size = newLayer->mapSize(); } else { DK_ASSERT(newLayer->mapSize() == m_size); if (newLayer->mapSize() != m_size) { throw SizeMismatchException(); } } DK_ASSERT(newLayer->count() == m_size * parSubdiv); m_layers.push_back(LayerPtr(newLayer)); return *newLayer; } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template template void Tyler::push_layer_void (BaseMapSource* parTilemap, int parIndex) { push_layer(parTilemap, parIndex); } ///-------------------------------------------------------------------------- ///-------------------------------------------------------------------------- template void Tyler::preload (const coords& parFrom, const coords& parTo) { for (auto& layer : m_layers) { layer->preload(parFrom, parTo); } } } //namespace dk