fmod error solve
This commit is contained in:
parent
b5e08cedd5
commit
ec790fd381
4 changed files with 74 additions and 75 deletions
|
@ -94,14 +94,12 @@ void Game::run() {
|
|||
processEvents(audioEmitter);
|
||||
audioEmitter.audioUpdate();
|
||||
update(TimePerFrame);
|
||||
updateStatistics(audioEmitter);
|
||||
}
|
||||
}
|
||||
|
||||
void Game::processEvents(AudioEmitter &audioEmitter) {
|
||||
while (const std::optional event = mWindow.pollEvent()) {
|
||||
if (event->is<sf::Event::Closed>()) {
|
||||
audioEmitter.audioEnd();
|
||||
mWindow.close();
|
||||
break;
|
||||
}
|
||||
|
@ -145,15 +143,6 @@ void Game::render() {
|
|||
mWindow.display();
|
||||
}
|
||||
|
||||
void Game::updateStatistics(AudioEmitter &audioEmitter) {
|
||||
mStatisticsText.setString(std::format(
|
||||
"Mesure = {}\nBeat = {} us", ceil(audioEmitter.getTimeTempo() / 8.f),
|
||||
ceil(fmod(audioEmitter.getTimeTempo(), 8.f))));
|
||||
|
||||
mStatisticsUpdateTime -= sf::seconds(1.0f);
|
||||
mStatisticsNumFrames = 0;
|
||||
}
|
||||
|
||||
void Game::update_scores(bool good_action) {
|
||||
if (good_action) {
|
||||
score += score_multiplier;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue