diff --git a/engine/Engine.cpp b/engine/Engine.cpp index b0eaba5..dff36f4 100644 --- a/engine/Engine.cpp +++ b/engine/Engine.cpp @@ -123,8 +123,8 @@ void Engine::printDebugInfo() const { std::to_string((camera->position().x())) + "\n Y: " + std::to_string((camera->position().y())) + "\n Z: " + std::to_string((camera->position().z())) + "\n RY:" + - std::to_string(camera->angle().y()/M_PI) + "PI\n RL: " + - std::to_string(camera->angleLeftUpLookAt().x()/M_PI) + "PI\n\n" + + std::to_string(camera->angle().y()/Consts::PI) + "PI\n RL: " + + std::to_string(camera->angleLeftUpLookAt().x()/Consts::PI) + "PI\n\n" + std::to_string(screen->width()) + "x" + std::to_string(screen->height()) + "\t" + std::to_string(Time::fps()) + " fps"; @@ -169,15 +169,8 @@ void Engine::printDebugInfo() const { static_cast(255.0 * (1.0 - static_cast(width) / timerWidth)), 0, 100}); - std::string fps; - if(timer.elapsedSeconds() > 0) { - fps = std::to_string((int) (1.0 / timer.elapsedSeconds())); - } else { - fps = "inf"; - } - screen->drawText( - timerName.substr(2, timerName.size()) + ":\t" + fps + " / s \t (" + + timerName.substr(2, timerName.size()) + ":\t" + std::to_string(timer.elapsedMilliseconds()) + " ms \t (" + std::to_string((int) (100 * timer.elapsedSeconds() / totalTime)) + "%)", Vec2D{xPos + 10, yPos + height * i + 5}, 30, sf::Color(0, 0, 0, 150)); @@ -195,14 +188,7 @@ void Engine::printDebugInfo() const { static_cast(255.0 * (1.0 - static_cast(width) / timerWidth)), 0, 100}); - std::string fps; - if(totalTime - timeSum > 0) { - fps = std::to_string((int) (1.0 / (totalTime - timeSum))); - } else { - fps = "inf"; - } - - screen->drawText("other:\t" + fps + " / s \t (" + + screen->drawText("other:\t" + std::to_string(1000*(totalTime - timeSum)) + " ms \t (" + std::to_string((int) (100 * (totalTime - timeSum) / totalTime)) + "%)", Vec2D{xPos + 10, yPos + height * i + 5}, 30, sf::Color(0, 0, 0, 150));