small refactor

master
Vectozavr 2022-07-22 21:02:21 +07:00
parent 562e7290e8
commit 5ad78dfe70
1 changed files with 4 additions and 18 deletions

View File

@ -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<sf::Uint8>(255.0 * (1.0 - static_cast<double>(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<sf::Uint8>(255.0 * (1.0 - static_cast<double>(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));