clang-tidy modernize
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_GetTicks, SDL_SetRenderTarget
|
||||
|
||||
#include <array>
|
||||
#include <algorithm> // Para find_if, clamp, find, min
|
||||
#include <cstdlib> // Para rand, size_t
|
||||
#include <functional> // Para function
|
||||
@@ -1404,7 +1405,7 @@ void Game::initDemo(int player_id) {
|
||||
{
|
||||
constexpr auto NUM_DEMOS = 3;
|
||||
const auto DEMO = rand() % NUM_DEMOS;
|
||||
const int STAGES[NUM_DEMOS] = {0, 3, 5};
|
||||
constexpr std::array<int, NUM_DEMOS> STAGES = {0, 3, 5};
|
||||
Stage::number = STAGES[DEMO];
|
||||
}
|
||||
|
||||
@@ -1695,7 +1696,7 @@ void Game::checkAndUpdateBalloonSpeed() {
|
||||
return;
|
||||
|
||||
const float PERCENT = static_cast<float>(Stage::power) / Stage::get(Stage::number).power_to_complete;
|
||||
const float THRESHOLDS[] = {0.2f, 0.4f, 0.6f, 0.8f};
|
||||
constexpr std::array<float, 4> THRESHOLDS = {0.2f, 0.4f, 0.6f, 0.8f};
|
||||
|
||||
for (size_t i = 0; i < std::size(THRESHOLDS); ++i) {
|
||||
if (balloon_manager_->getBalloonSpeed() == BALLOON_SPEED[i] && PERCENT > THRESHOLDS[i]) {
|
||||
|
||||
Reference in New Issue
Block a user