style: aplicar readability-uppercase-literal-suffix

- Cambiar todos los literales float de minúscula a mayúscula (1.0f → 1.0F)
- 657 correcciones aplicadas automáticamente con clang-tidy
- Check 1/N completado

🤖 Generated with Claude Code
This commit is contained in:
2025-12-18 13:06:48 +01:00
parent 44cd0857e0
commit bc94eff176
41 changed files with 705 additions and 594 deletions

View File

@@ -10,7 +10,7 @@
namespace Rendering {
ColorOscillator::ColorOscillator()
: accumulated_time_(0.0f) {
: accumulated_time_(0.0F) {
// Inicialitzar amb el color mínim
current_line_color_ = {Defaults::Color::LINE_MIN_R,
Defaults::Color::LINE_MIN_G,
@@ -54,8 +54,8 @@ void ColorOscillator::update(float delta_time) {
float ColorOscillator::calculateOscillationFactor(float time, float frequency) {
// Oscil·lació senoïdal: sin(t * freq * 2π)
// Mapejar de [-1, 1] a [0, 1]
float radians = time * frequency * 2.0f * Defaults::Math::PI;
return (std::sin(radians) + 1.0f) / 2.0f;
float radians = time * frequency * 2.0F * Defaults::Math::PI;
return (std::sin(radians) + 1.0F) / 2.0F;
}
SDL_Color ColorOscillator::interpolateColor(SDL_Color min, SDL_Color max, float factor) {

View File

@@ -6,6 +6,6 @@
namespace Rendering {
// Factor d'escala global (inicialitzat a 1.0 per defecte)
float g_current_scale_factor = 1.0f;
float g_current_scale_factor = 1.0F;
} // namespace Rendering

View File

@@ -9,7 +9,7 @@ namespace Rendering {
// Algorisme de Bresenham per dibuixar línies
// Retorna true si hi ha col·lisió (per Fase 10)
// brightness: factor de brillantor (0.0-1.0, default 1.0 = màxima brillantor)
bool linea(SDL_Renderer* renderer, int x1, int y1, int x2, int y2, bool dibuixar, float brightness = 1.0f);
bool linea(SDL_Renderer* renderer, int x1, int y1, int x2, int y2, bool dibuixar, float brightness = 1.0F);
// [NUEVO] Establir el color global de les línies (oscil·lació)
void setLineColor(SDL_Color color);

View File

@@ -35,15 +35,15 @@ float angle_punt(const Punt& p) {
if (p.y != 0) {
return std::atan(p.x / p.y);
}
return 0.0f;
return 0.0F;
}
void crear_poligon_regular(Poligon& pol, uint8_t n, float r) {
// Crear un polígon regular amb n costats i radi r
// Distribueix els punts uniformement al voltant d'un cercle
float interval = 2.0f * Defaults::Math::PI / n;
float act = 0.0f;
float interval = 2.0F * Defaults::Math::PI / n;
float act = 0.0F;
for (uint8_t i = 0; i < n; i++) {
pol.ipuntx[i].r = r;
@@ -52,15 +52,15 @@ void crear_poligon_regular(Poligon& pol, uint8_t n, float r) {
}
// Inicialitzar propietats del polígon
pol.centre.x = 320.0f;
pol.centre.y = 200.0f;
pol.angle = 0.0f;
pol.centre.x = 320.0F;
pol.centre.y = 200.0F;
pol.angle = 0.0F;
// Convertir velocitat de px/frame a px/s: 2 px/frame × 20 FPS = 40 px/s
pol.velocitat = Defaults::Physics::ENEMY_SPEED * 20.0f;
pol.velocitat = Defaults::Physics::ENEMY_SPEED * 20.0F;
pol.n = n;
// Convertir rotació de rad/frame a rad/s: 0.0785 rad/frame × 20 FPS = 1.57
// rad/s (~90°/s)
pol.drotacio = 0.078539816f * 20.0f;
pol.rotacio = 0.0f;
pol.drotacio = 0.078539816F * 20.0F;
pol.rotacio = 0.0F;
pol.esta = true;
}

View File

@@ -17,7 +17,7 @@
SDLManager::SDLManager()
: finestra_(nullptr),
renderer_(nullptr),
fps_accumulator_(0.0f),
fps_accumulator_(0.0F),
fps_frame_count_(0),
fps_display_(0),
current_width_(Defaults::Window::WIDTH),
@@ -28,7 +28,7 @@ SDLManager::SDLManager()
zoom_factor_(Defaults::Window::BASE_ZOOM),
windowed_width_(Defaults::Window::WIDTH),
windowed_height_(Defaults::Window::HEIGHT),
max_zoom_(1.0f) {
max_zoom_(1.0F) {
// Inicialitzar SDL3
if (!SDL_Init(SDL_INIT_VIDEO)) {
std::cerr << "Error inicialitzant SDL3: " << SDL_GetError() << std::endl;
@@ -81,7 +81,7 @@ SDLManager::SDLManager()
SDLManager::SDLManager(int width, int height, bool fullscreen)
: finestra_(nullptr),
renderer_(nullptr),
fps_accumulator_(0.0f),
fps_accumulator_(0.0F),
fps_frame_count_(0),
fps_display_(0),
current_width_(width),
@@ -92,7 +92,7 @@ SDLManager::SDLManager(int width, int height, bool fullscreen)
zoom_factor_(static_cast<float>(width) / Defaults::Window::WIDTH),
windowed_width_(width),
windowed_height_(height),
max_zoom_(1.0f) {
max_zoom_(1.0F) {
// Inicialitzar SDL3
if (!SDL_Init(SDL_INIT_VIDEO)) {
std::cerr << "Error inicialitzant SDL3: " << SDL_GetError() << std::endl;
@@ -221,7 +221,7 @@ void SDLManager::applyZoom(float new_zoom) {
new_zoom = std::round(new_zoom / Defaults::Window::ZOOM_INCREMENT) * Defaults::Window::ZOOM_INCREMENT;
// No change?
if (std::abs(new_zoom - zoom_factor_) < 0.01f) {
if (std::abs(new_zoom - zoom_factor_) < 0.01F) {
return;
}
@@ -430,10 +430,10 @@ void SDLManager::updateFPS(float delta_time) {
fps_frame_count_++;
// Actualitzar display cada 0.5 segons
if (fps_accumulator_ >= 0.5f) {
if (fps_accumulator_ >= 0.5F) {
fps_display_ = static_cast<int>(fps_frame_count_ / fps_accumulator_);
fps_frame_count_ = 0;
fps_accumulator_ = 0.0f;
fps_accumulator_ = 0.0F;
// Actualitzar títol de la finestra
std::string vsync_state = (Options::rendering.vsync == 1) ? "ON" : "OFF";
@@ -468,7 +468,7 @@ void SDLManager::toggleVSync() {
}
// Reset FPS counter para evitar valores mixtos entre regímenes
fps_accumulator_ = 0.0f;
fps_accumulator_ = 0.0F;
fps_frame_count_ = 0;
// Guardar configuració

View File

@@ -12,7 +12,7 @@ namespace Rendering {
// Helper: aplicar rotació 3D a un punt 2D (assumeix Z=0)
static Punt apply_3d_rotation(float x, float y, const Rotation3D& rot) {
float z = 0.0f; // Tots els punts 2D comencen a Z=0
float z = 0.0F; // Tots els punts 2D comencen a Z=0
// Pitch (rotació eix X): cabeceo arriba/baix
float cos_pitch = std::cos(rot.pitch);
@@ -35,7 +35,7 @@ static Punt apply_3d_rotation(float x, float y, const Rotation3D& rot) {
// Proyecció perspectiva (Z-divide simple)
// Naus volen cap al punt de fuga (320, 240) a "infinit" (Z → +∞)
// Z més gran = més lluny = més petit a pantalla
constexpr float perspective_factor = 500.0f;
constexpr float perspective_factor = 500.0F;
float scale_factor = perspective_factor / (perspective_factor + z2);
return {x3 * scale_factor, y3 * scale_factor};
@@ -87,7 +87,7 @@ void render_shape(SDL_Renderer* renderer,
}
// Si progress < 1.0, no dibuixar (tot o res)
if (progress < 1.0f) {
if (progress < 1.0F) {
return;
}

View File

@@ -19,16 +19,16 @@ struct Rotation3D {
float roll; // Rotació eix Z (alabeo lateral)
Rotation3D()
: pitch(0.0f),
yaw(0.0f),
roll(0.0f) {}
: pitch(0.0F),
yaw(0.0F),
roll(0.0F) {}
Rotation3D(float p, float y, float r)
: pitch(p),
yaw(y),
roll(r) {}
bool has_rotation() const {
return pitch != 0.0f || yaw != 0.0f || roll != 0.0f;
return pitch != 0.0F || yaw != 0.0F || roll != 0.0F;
}
};
@@ -45,10 +45,10 @@ void render_shape(SDL_Renderer* renderer,
const std::shared_ptr<Graphics::Shape>& shape,
const Punt& posicio,
float angle,
float escala = 1.0f,
float escala = 1.0F,
bool dibuixar = true,
float progress = 1.0f,
float brightness = 1.0f,
float progress = 1.0F,
float brightness = 1.0F,
const Rotation3D* rotation_3d = nullptr);
} // namespace Rendering