Lint: rename de helpers file-static y constexpr locales
Tanda local de identifier-naming: ningún símbolo cross-file, todo contenido en su propio TU. De paso traduce los catalán/spanish a inglés allá donde aplica. - shape_renderer.cpp: apply_3d_rotation → apply3dRotation, transform_point → transformPoint, perspective_factor → PERSPECTIVE_FACTOR (constexpr). - debris_manager.cpp: transform_point → transformPoint (otro file-static con el mismo nombre, no comparte símbolo con shape_renderer). - logo_scene.cpp: calcular_progress_letra → computeLetterProgress. - vector_text.cpp: char_width/char_height → BASE_CHAR_WIDTH/BASE_CHAR_HEIGHT (el sufijo BASE_ evita el conflicto con la macro CHAR_WIDTH de Windows headers que clang-tidy detectó). - floating_score_manager.cpp::draw: constexpr scale/spacing → SCALE/SPACING. - game_scene.cpp::dibuixar_missatge_stage: escala_base/spacing → BASE_SCALE/SPACING (constexpr locales). - game_scene.cpp::dibuixar_continue: constexpr spacing → SPACING. - game_scene.cpp en stepGameOver: constexpr scale/spacing → SCALE/SPACING. - ship_animator.cpp::actualizar_exiting: constexpr Vec2 punt_fuga → VANISHING_POINT. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
424d0d2b89
commit
1214599c4c
8 files changed
+42
-42
No files matched your search
@@ -11,8 +11,8 @@
|
||||
namespace Graphics {
|
||||
|
||||
// Constants para mides base dels caràcters
|
||||
constexpr float char_width = 20.0F; // Amplada base del caràcter
|
||||
constexpr float char_height = 40.0F; // Altura base del caràcter
|
||||
constexpr float BASE_CHAR_WIDTH = 20.0F; // Amplada base del caràcter
|
||||
constexpr float BASE_CHAR_HEIGHT = 40.0F; // Altura base del caràcter
|
||||
|
||||
VectorText::VectorText(Rendering::Renderer* renderer)
|
||||
: renderer_(renderer) {
|
||||
@@ -185,16 +185,16 @@ void VectorText::render(const std::string& text, const Vec2& position, float sca
|
||||
}
|
||||
|
||||
// Ancho de un carácter base (20 px a scale 1.0)
|
||||
const float char_width_scaled = char_width * scale;
|
||||
const float char_width_scaled = BASE_CHAR_WIDTH * scale;
|
||||
|
||||
// Spacing escalado
|
||||
const float spacing_scaled = spacing * scale;
|
||||
|
||||
// Altura de un carácter escalado (necesario para ajustar Y)
|
||||
const float char_height_scaled = char_height * scale;
|
||||
const float char_height_scaled = BASE_CHAR_HEIGHT * scale;
|
||||
|
||||
// Posición X del borde izquierdo del carácter actual
|
||||
// (se ajustará +char_width/2 para obtener el centro al renderizar)
|
||||
// (se ajustará +BASE_CHAR_WIDTH/2 para obtener el centro al renderizar)
|
||||
float current_x = position.x;
|
||||
|
||||
// Iterar sobre cada byte del string (con detecció UTF-8)
|
||||
@@ -254,7 +254,7 @@ auto VectorText::get_text_width(const std::string& text, float scale, float spac
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
const float char_width_scaled = char_width * scale;
|
||||
const float char_width_scaled = BASE_CHAR_WIDTH * scale;
|
||||
const float spacing_scaled = spacing * scale;
|
||||
|
||||
// Contar caracteres visuals (no bytes) - manejar UTF-8
|
||||
@@ -277,7 +277,7 @@ auto VectorText::get_text_width(const std::string& text, float scale, float spac
|
||||
}
|
||||
|
||||
auto VectorText::get_text_height(float scale) const -> float {
|
||||
return char_height * scale;
|
||||
return BASE_CHAR_HEIGHT * scale;
|
||||
}
|
||||
|
||||
} // namespace Graphics
|
||||
Reference in new issue
Block a user