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:
@@ -38,7 +38,7 @@ static Punt apply_3d_rotation(float x, float y, const Rotation3D& rot) {
|
||||
constexpr float perspective_factor = 500.0F;
|
||||
float scale_factor = perspective_factor / (perspective_factor + z2);
|
||||
|
||||
return {x3 * scale_factor, y3 * scale_factor};
|
||||
return {.x = x3 * scale_factor, .y = y3 * scale_factor};
|
||||
}
|
||||
|
||||
// Helper: transformar un punt amb rotació, escala i trasllació
|
||||
@@ -69,7 +69,7 @@ static Punt transform_point(const Punt& point, const Punt& shape_centre, const P
|
||||
float rotated_y = (scaled_x * sin_a) + (scaled_y * cos_a);
|
||||
|
||||
// 5. Aplicar trasllació a posició mundial
|
||||
return {rotated_x + posicio.x, rotated_y + posicio.y};
|
||||
return {.x = rotated_x + posicio.x, .y = rotated_y + posicio.y};
|
||||
}
|
||||
|
||||
void render_shape(SDL_Renderer* renderer,
|
||||
|
||||
Reference in New Issue
Block a user