From 6d1f173c676c5c34ee37fe6ca85642de9c4ca577 Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Thu, 11 May 2023 06:57:07 +0200 Subject: [PATCH] [Fix] (Display) : fix time --- src/Display/Modules/CanvasModule.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Display/Modules/CanvasModule.cpp b/src/Display/Modules/CanvasModule.cpp index de17a0cb5..b1699f8b7 100644 --- a/src/Display/Modules/CanvasModule.cpp +++ b/src/Display/Modules/CanvasModule.cpp @@ -58,6 +58,11 @@ namespace RayTracer::Display { sprite.setTexture(texture); window.draw(sprite); window.draw(text); + if (_clock.getElapsedTime() > sf::seconds(0.5) && this->_scene.getCameras()[this->_position].get().getCluster() != 1) { + this->_scene.getCameras()[this->_position].get().setCluster(1); + this->_scene.cancel(); + this->_scene.renders(); + } } void CanvasModule::start(sf::RenderWindow &window) { @@ -89,11 +94,6 @@ namespace RayTracer::Display { {sf::Keyboard::Z, std::bind(&CanvasModule::goForward, this, std::ref(window), std::ref(event))}, }; - if (_clock.getElapsedTime() > sf::seconds(0.5) && this->_scene.getCameras()[this->_position].get().getCluster() != 1) { - this->_scene.getCameras()[this->_position].get().setCluster(1); - this->_scene.cancel(); - this->_scene.renders(); - } if (event.type == sf::Event::KeyPressed) { auto it = keyMap.find(event.key.code); if (it != keyMap.end()) {