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:
@@ -17,12 +17,12 @@
|
||||
|
||||
Nau::Nau(SDL_Renderer* renderer, const char* shape_file)
|
||||
: renderer_(renderer),
|
||||
centre_({0.0f, 0.0f}),
|
||||
angle_(0.0f),
|
||||
velocitat_(0.0f),
|
||||
centre_({0.0F, 0.0F}),
|
||||
angle_(0.0F),
|
||||
velocitat_(0.0F),
|
||||
esta_tocada_(false),
|
||||
brightness_(Defaults::Brightness::NAU),
|
||||
invulnerable_timer_(0.0f) {
|
||||
invulnerable_timer_(0.0F) {
|
||||
// [NUEVO] Carregar forma compartida des de fitxer
|
||||
forma_ = Graphics::ShapeLoader::load(shape_file);
|
||||
|
||||
@@ -52,14 +52,14 @@ void Nau::inicialitzar(const Punt* spawn_point, bool activar_invulnerabilitat) {
|
||||
}
|
||||
|
||||
// Estat inicial
|
||||
angle_ = 0.0f;
|
||||
velocitat_ = 0.0f;
|
||||
angle_ = 0.0F;
|
||||
velocitat_ = 0.0F;
|
||||
|
||||
// Activar invulnerabilidad solo si es respawn
|
||||
if (activar_invulnerabilitat) {
|
||||
invulnerable_timer_ = Defaults::Ship::INVULNERABILITY_DURATION;
|
||||
} else {
|
||||
invulnerable_timer_ = 0.0f;
|
||||
invulnerable_timer_ = 0.0F;
|
||||
}
|
||||
|
||||
esta_tocada_ = false;
|
||||
@@ -120,10 +120,10 @@ void Nau::actualitzar(float delta_time) {
|
||||
return;
|
||||
|
||||
// Decrementar timer de invulnerabilidad
|
||||
if (invulnerable_timer_ > 0.0f) {
|
||||
if (invulnerable_timer_ > 0.0F) {
|
||||
invulnerable_timer_ -= delta_time;
|
||||
if (invulnerable_timer_ < 0.0f) {
|
||||
invulnerable_timer_ = 0.0f;
|
||||
if (invulnerable_timer_ < 0.0F) {
|
||||
invulnerable_timer_ = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,10 +160,10 @@ void Nau::dibuixar() const {
|
||||
// [NUEVO] Convertir suma de velocitat_visual a escala multiplicativa
|
||||
// Radio base del ship = 12 px
|
||||
// velocitat_visual = 0-6 → r = 12-18 → escala = 1.0-1.5
|
||||
float velocitat_visual = velocitat_ / 33.33f;
|
||||
float escala = 1.0f + (velocitat_visual / 12.0f);
|
||||
float velocitat_visual = velocitat_ / 33.33F;
|
||||
float escala = 1.0F + (velocitat_visual / 12.0F);
|
||||
|
||||
Rendering::render_shape(renderer_, forma_, centre_, angle_, escala, true, 1.0f, brightness_);
|
||||
Rendering::render_shape(renderer_, forma_, centre_, angle_, escala, true, 1.0F, brightness_);
|
||||
}
|
||||
|
||||
void Nau::aplicar_fisica(float delta_time) {
|
||||
@@ -174,10 +174,10 @@ void Nau::aplicar_fisica(float delta_time) {
|
||||
// S'usa (angle - PI/2) perquè angle=0 apunta cap amunt, no cap a la dreta
|
||||
// velocitat_ està en px/s, així que multipliquem per delta_time
|
||||
float dy =
|
||||
(velocitat_ * delta_time) * std::sin(angle_ - Constants::PI / 2.0f) +
|
||||
(velocitat_ * delta_time) * std::sin(angle_ - Constants::PI / 2.0F) +
|
||||
centre_.y;
|
||||
float dx =
|
||||
(velocitat_ * delta_time) * std::cos(angle_ - Constants::PI / 2.0f) +
|
||||
(velocitat_ * delta_time) * std::cos(angle_ - Constants::PI / 2.0F) +
|
||||
centre_.x;
|
||||
|
||||
// Boundary checking amb radi de la nau
|
||||
@@ -199,10 +199,10 @@ void Nau::aplicar_fisica(float delta_time) {
|
||||
}
|
||||
|
||||
// Fricció - desacceleració gradual (time-based)
|
||||
if (velocitat_ > 0.1f) {
|
||||
if (velocitat_ > 0.1F) {
|
||||
velocitat_ -= Defaults::Physics::FRICTION * delta_time;
|
||||
if (velocitat_ < 0.0f) {
|
||||
velocitat_ = 0.0f;
|
||||
if (velocitat_ < 0.0F) {
|
||||
velocitat_ = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user