Lint: rename de locales (constants + const-ref vars)
Tanda de identifier-naming de variables y constantes locales a funciones
o archivos. Ninguno cross-file (los símbolos públicos quedan para una
pasada manual con VS Code).
- audio_adapter.cpp: path → PATH (const local en 3 funciones).
- vector_text.cpp: symbols → SYMBOLS, char_width_scaled → CHAR_WIDTH_SCALED,
char_height_scaled → CHAR_HEIGHT_SCALED, spacing_scaled → SPACING_SCALED
(const locales en render/renderCentered/get_text_width).
- physics_world.cpp: acceleration → ACCELERATION (const local en update).
- constants.hpp::dins_zona_joc: point → POINT.
- game_scene.cpp:
- stepGameOver: game_over_text → GAME_OVER_TEXT.
- dibuixar_marcador: scale/spacing → SCALE/SPACING (const), y la ref
local 'scoreboard' (const SDL_FRect&) → 'scoreboard_zone' para no
colisionar con Defaults::Zones::SCOREBOARD (las refs no son
"constant" según el .clang-tidy y deben ser lower_case).
- dibuixar_missatge_stage: max_width → MAX_WIDTH (const local).
- dibuixar_continue: continue_text/counter_str/continues_text →
UPPER_CASE.
- title_scene.cpp::draw (sección MAIN): spacing → SPACING, main_text →
MAIN_TEXT, escala_main → MAIN_SCALE.
- shape_renderer.cpp: const Vec2& SHAPE_CENTRE → shape_centre (es ref,
no constant).
- collision_system.cpp: const Vec2& POS_ENEMIC → enemy_pos (ref + traducción).
- init_hud_animator.cpp: refs ZONA → zone (en 2 funciones), SCOREBOARD →
scoreboard_zone (sin colisionar con Defaults::Zones::SCOREBOARD).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,21 +31,21 @@ auto computeRangeProgress(float global_progress,
|
||||
|
||||
auto computeShipPosition(float progress, const Vec2& final_position) -> Vec2 {
|
||||
const float EASED = Easing::ease_out_quad(progress);
|
||||
const SDL_FRect& ZONA = Defaults::Zones::PLAYAREA;
|
||||
const SDL_FRect& zone = Defaults::Zones::PLAYAREA;
|
||||
// Y inicial: 50 px bajo la zona de juego.
|
||||
const float Y_INI = ZONA.y + ZONA.h + 50.0F;
|
||||
const float Y_INI = zone.y + zone.h + 50.0F;
|
||||
const float Y_ANIM = Y_INI + ((final_position.y - Y_INI) * EASED);
|
||||
return Vec2{.x = final_position.x, .y = Y_ANIM};
|
||||
}
|
||||
|
||||
void drawBordersAnimated(Rendering::Renderer* renderer, float progress) {
|
||||
const SDL_FRect& ZONA = Defaults::Zones::PLAYAREA;
|
||||
const SDL_FRect& zone = Defaults::Zones::PLAYAREA;
|
||||
const float EASED = Easing::ease_out_quad(progress);
|
||||
|
||||
const int X1 = static_cast<int>(ZONA.x);
|
||||
const int Y1 = static_cast<int>(ZONA.y);
|
||||
const int X2 = static_cast<int>(ZONA.x + ZONA.w);
|
||||
const int Y2 = static_cast<int>(ZONA.y + ZONA.h);
|
||||
const int X1 = static_cast<int>(zone.x);
|
||||
const int Y1 = static_cast<int>(zone.y);
|
||||
const int X2 = static_cast<int>(zone.x + zone.w);
|
||||
const int Y2 = static_cast<int>(zone.y + zone.h);
|
||||
const int CX = (X1 + X2) / 2;
|
||||
|
||||
constexpr float PHASE_1_END = 0.33F;
|
||||
@@ -85,9 +85,9 @@ void drawScoreboardAnimated(const Graphics::VectorText& text,
|
||||
|
||||
constexpr float SCALE = 0.85F;
|
||||
constexpr float SPACING = 0.0F;
|
||||
const SDL_FRect& SCOREBOARD = Defaults::Zones::SCOREBOARD;
|
||||
const float CENTRE_X = SCOREBOARD.w / 2.0F;
|
||||
const float Y_FINAL = SCOREBOARD.y + (SCOREBOARD.h / 2.0F);
|
||||
const SDL_FRect& scoreboard_zone = Defaults::Zones::SCOREBOARD;
|
||||
const float CENTRE_X = scoreboard_zone.w / 2.0F;
|
||||
const float Y_FINAL = scoreboard_zone.y + (scoreboard_zone.h / 2.0F);
|
||||
// Posición inicial: fuera de la pantalla por debajo.
|
||||
const auto Y_INI = static_cast<float>(Defaults::Game::HEIGHT);
|
||||
const float Y_ANIM = Y_INI + ((Y_FINAL - Y_INI) * EASED);
|
||||
|
||||
Reference in New Issue
Block a user