clang-tidy modernize
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <cmath> // Para abs
|
||||
#include <stdexcept> // Para runtime_error
|
||||
#include <string> // Para basic_string, string
|
||||
#include <string_view>
|
||||
#include <vector> // Para vector
|
||||
|
||||
#include "audio.h" // Para Audio
|
||||
@@ -30,7 +31,8 @@
|
||||
#include "utils.h" // Para Color, Zone, SHADOW_TEXT_COLOR, NO_TEXT...
|
||||
|
||||
// Textos
|
||||
constexpr const char TEXT_COPYRIGHT[] = "@2020,2025 JailDesigner";
|
||||
constexpr std::string_view TEXT_COPYRIGHT = "@2020,2025 JailDesigner";
|
||||
|
||||
|
||||
// Constructor
|
||||
Credits::Credits()
|
||||
@@ -218,7 +220,7 @@ void Credits::fillTextTexture() {
|
||||
|
||||
// Texto con el copyright
|
||||
y += mini_logo_sprite->getHeight() + 3;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXT_COPYRIGHT, 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, std::string(TEXT_COPYRIGHT), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
// Resetea el renderizador
|
||||
SDL_SetRenderTarget(Screen::get()->getRenderer(), nullptr);
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
@@ -433,7 +433,7 @@ void Title::renderCopyright() {
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW,
|
||||
param.game.game_area.center_x,
|
||||
anchor_.copyright_text,
|
||||
TEXT_COPYRIGHT,
|
||||
std::string(TEXT_COPYRIGHT),
|
||||
1,
|
||||
NO_TEXT_COLOR,
|
||||
1,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <memory> // Para unique_ptr, shared_ptr
|
||||
#include <vector>
|
||||
#include <string_view>
|
||||
|
||||
#include "section.h" // Para Options
|
||||
|
||||
@@ -16,7 +17,8 @@ class Text;
|
||||
class TiledBG;
|
||||
|
||||
// Textos
|
||||
constexpr const char TEXT_COPYRIGHT[] = "@2020,2025 JailDesigner";
|
||||
constexpr std::string_view TEXT_COPYRIGHT = "@2020,2025 JailDesigner";
|
||||
|
||||
|
||||
// Parámetros
|
||||
constexpr bool ALLOW_TITLE_ANIMATION_SKIP = false;
|
||||
|
||||
Reference in New Issue
Block a user