style: aplicar checks modernize-* (215 fixes)
Cambios aplicados:
- [[nodiscard]] añadido a funciones que retornan valores
- .starts_with() en lugar de .find() == 0
- Inicializadores designados {.x=0, .y=0}
- auto en castings obvios
- = default para constructores triviales
- Funciones deleted movidas a public
- std::numbers::pi_v<float> (C++20)
Checks excluidos:
- use-trailing-return-type: Estilo controversial
- avoid-c-arrays: Arrays C aceptables en ciertos contextos
This commit is contained in:
@@ -232,7 +232,7 @@ void ShipAnimator::actualitzar_exiting(NauTitol& nau, float delta_time) {
|
||||
float eased_progress = Easing::ease_in_quad(progress);
|
||||
|
||||
// Punt de fuga (centre del starfield)
|
||||
constexpr Punt punt_fuga{VANISHING_POINT_X, VANISHING_POINT_Y};
|
||||
constexpr Punt punt_fuga{.x = VANISHING_POINT_X, .y = VANISHING_POINT_Y};
|
||||
|
||||
// Lerp posició cap al punt de fuga (preservar posició inicial actual)
|
||||
// Nota: posicio_inicial conté la posició on estava quan es va activar EXITING
|
||||
@@ -257,7 +257,7 @@ void ShipAnimator::configurar_nau_p1(NauTitol& nau) {
|
||||
nau.temps_estat = 0.0F;
|
||||
|
||||
// Posicions (clock 8, bottom-left)
|
||||
nau.posicio_objectiu = {P1_TARGET_X(), P1_TARGET_Y()};
|
||||
nau.posicio_objectiu = {.x = P1_TARGET_X(), .y = P1_TARGET_Y()};
|
||||
|
||||
// Calcular posició inicial (fora de pantalla)
|
||||
nau.posicio_inicial = calcular_posicio_fora_pantalla(CLOCK_8_ANGLE);
|
||||
@@ -292,7 +292,7 @@ void ShipAnimator::configurar_nau_p2(NauTitol& nau) {
|
||||
nau.temps_estat = 0.0F;
|
||||
|
||||
// Posicions (clock 4, bottom-right)
|
||||
nau.posicio_objectiu = {P2_TARGET_X(), P2_TARGET_Y()};
|
||||
nau.posicio_objectiu = {.x = P2_TARGET_X(), .y = P2_TARGET_Y()};
|
||||
|
||||
// Calcular posició inicial (fora de pantalla)
|
||||
nau.posicio_inicial = calcular_posicio_fora_pantalla(CLOCK_4_ANGLE);
|
||||
@@ -330,7 +330,7 @@ Punt ShipAnimator::calcular_posicio_fora_pantalla(float angle_rellotge) const {
|
||||
float x = (Defaults::Game::WIDTH / 2.0F) + (extended_radius * std::cos(angle_rellotge));
|
||||
float y = (Defaults::Game::HEIGHT / 2.0F) + (extended_radius * std::sin(angle_rellotge));
|
||||
|
||||
return {x, y};
|
||||
return {.x = x, .y = y};
|
||||
}
|
||||
|
||||
} // namespace Title
|
||||
|
||||
Reference in New Issue
Block a user