#include "doorkeeper.hpp" #include "doorkeeperConfig.h" #include #include #include int main() { typedef dk::Tyler<2> Tiler; typedef std::unique_ptr ifstreamptr; Tiler tiler(Tiler::coords(10, 6), Tiler::coords(64)); const std::string map1(DATA_PATH"/test.map"); const std::string map2(DATA_PATH"/test_2.map"); std::cout << "Loading " << map1 << '\n'; auto bottom_layer = &tiler.push_layer(dk::Layer::streamer_type(ifstreamptr(new std::ifstream(map1)))); //std::cout << "Loading " << map2 << '\n'; //tiler.push_layer(dk::Layer::streamer_type(ifstreamptr(new std::ifstream(map2))), dk::Vector(2)); dk::Viewport<2> viewport(tiler, Tiler::coords(0), Tiler::coords(10, 6)); dk::Viewport<2> viewport_small(tiler, Tiler::coords(1), Tiler::coords(9, 5)); { int col = 0; const auto tilecount = bottom_layer->count(); for (auto tile : *bottom_layer) { std::cout << tile; ++col; if (col == tilecount.x()) { col = 0; std::cout << '\n'; } } } #if !defined(NDEBUG) std::cout << "Map size: " << tiler.map_size() << '\n'; #endif std::cout << "Total tiles: " << tiler.tiles_count() << '\n'; return 0; }