diff options
Diffstat (limited to 'src/control/RPGEdit.cpp')
-rw-r--r-- | src/control/RPGEdit.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/control/RPGEdit.cpp b/src/control/RPGEdit.cpp index 31998b2..e22d8fa 100644 --- a/src/control/RPGEdit.cpp +++ b/src/control/RPGEdit.cpp @@ -74,10 +74,7 @@ void RPGEdit::systemLoop() { { std::unique_lock<std::mutex> lock(modelMutex); - uint64_t time = std::min(timeProvider.now(), handledTime); - - Model::Position pos = ctx->getViewPosition(time); - mapView->render(pos.x, pos.y, time); + ctx->render(std::min(timeProvider.now(), handledTime)); } SDL_RenderPresent(window->getRenderer()); @@ -104,11 +101,11 @@ void RPGEdit::eventLoop() { void RPGEdit::run() { std::shared_ptr<Model::Map> map = Model::Map::load("test"); - ctx = std::make_shared<MapContext>(&eventBus, &inputHandler, map); - window = std::make_shared<View::Window>(); mapView = std::make_shared<View::MapView>(window, map); + ctx = std::make_shared<MapContext>(&eventBus, &inputHandler, mapView.get(), map); + eventThread = std::thread([this] { eventLoop(); }); systemLoop(); |