From b1fae3873c3e36cbb0cf1b61284469bc0607f0eb Mon Sep 17 00:00:00 2001 From: NaiJi Date: Wed, 14 Dec 2022 19:07:10 +0400 Subject: [PATCH] chore: Minor naming cleaning --- include/core/precisionevaluator.h | 8 ++++---- src/application/shared/application/log.h | 2 +- src/application/src/log.cpp | 2 +- src/impl/sfml/application/applicationsfml.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/core/precisionevaluator.h b/include/core/precisionevaluator.h index 7cf48a8..1fb4520 100644 --- a/include/core/precisionevaluator.h +++ b/include/core/precisionevaluator.h @@ -23,7 +23,10 @@ class PrecisionEvaluator _end_handling_offset = _offset + intervals.back(); } - inline microsec offset() const noexcept { return _offset; } + inline microsec offset() const noexcept + { + return _offset; + } inline bool isActive(microsec music_play_offset) const noexcept { @@ -35,9 +38,6 @@ class PrecisionEvaluator { microsec shift_from_perfect = std::abs(odds - offset()); - std::cout << "Shift " << ((odds > _offset) ? "late: " : "early: ") - << shift_from_perfect << "\n"; - std::size_t raw_grade; for (raw_grade = 0; raw_grade < _intervals.size(); ++raw_grade) { diff --git a/src/application/shared/application/log.h b/src/application/shared/application/log.h index 6930d91..d2bc316 100644 --- a/src/application/shared/application/log.h +++ b/src/application/shared/application/log.h @@ -35,7 +35,7 @@ class Log void log(LogLevel level, const std::string &fmt, ...); private: - inline std::string _getLabel(LogLevel level) + inline std::string getLabel(LogLevel level) { switch (level) { diff --git a/src/application/src/log.cpp b/src/application/src/log.cpp index c931d10..57738f8 100644 --- a/src/application/src/log.cpp +++ b/src/application/src/log.cpp @@ -23,5 +23,5 @@ void Log::log(LogLevel level, const std::string &fmt, ...) std::vsnprintf(&buf[0], len + 1, fmt.c_str(), args); va_end(args); - std::cout << this->_getLabel(level) << " " << &buf[0] << std::endl; + std::cout << this->getLabel(level) << " " << &buf[0] << std::endl; } diff --git a/src/impl/sfml/application/applicationsfml.cpp b/src/impl/sfml/application/applicationsfml.cpp index 844f873..a478927 100644 --- a/src/impl/sfml/application/applicationsfml.cpp +++ b/src/impl/sfml/application/applicationsfml.cpp @@ -51,8 +51,8 @@ void ApplicationSFML::run() } } - bool isOneFramePassed = time_since_last_update >= TIME_PER_FRAME; - if (isOneFramePassed) + bool is_frame_passed = time_since_last_update >= TIME_PER_FRAME; + if (is_frame_passed) { time_since_last_update -= TIME_PER_FRAME; update(time_since_last_update.asMicroseconds());