Skip to content

Commit

Permalink
[Fix] (Display) : fix time
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed May 11, 2023
1 parent fa99553 commit 6d1f173
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Display/Modules/CanvasModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 6d1f173

Please sign in to comment.