fix: arreglada la acceleració dels credits sense dependre de vsync
This commit is contained in:
@@ -80,21 +80,27 @@ void Credits::run()
|
||||
// Actualiza las variables
|
||||
void Credits::update()
|
||||
{
|
||||
if (SDL_GetTicks() - ticks_ > ticks_speed_)
|
||||
constexpr Uint32 TICKS_SPEED_ = 15;
|
||||
|
||||
if (SDL_GetTicks() - ticks_ > TICKS_SPEED_)
|
||||
{
|
||||
ticks_ = SDL_GetTicks();
|
||||
tiled_bg_->update();
|
||||
balloon_manager_->update();
|
||||
updateTextureDstRects();
|
||||
throwBalloons();
|
||||
for (auto &player : players_)
|
||||
const int repeat = want_to_pass_ ? 4 : 1;
|
||||
for (int i = 0; i < repeat; ++i)
|
||||
{
|
||||
player->update();
|
||||
tiled_bg_->update();
|
||||
balloon_manager_->update();
|
||||
updateTextureDstRects();
|
||||
throwBalloons();
|
||||
for (auto &player : players_)
|
||||
{
|
||||
player->update();
|
||||
}
|
||||
updateAllFades();
|
||||
++counter_;
|
||||
}
|
||||
updateAllFades();
|
||||
Screen::get()->update();
|
||||
globalInputs::update();
|
||||
++counter_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +184,6 @@ void Credits::checkInput()
|
||||
{
|
||||
// Si todavía estan los creditos en marcha, se pasan solos a toda pastilla
|
||||
want_to_pass_ = true;
|
||||
ticks_speed_ = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user