Fase 1a: Punt -> Vec2 amb operadors moderns
Primera sub-fase del naming sweep. Punt era un struct sense
operacions, conservat per compatibilitat amb el Pascal original.
Substituit per Vec2, un aggregate amb operadors aritmetics, dot,
length, normalized i length_squared (camelBack: lengthSquared)
seguint les regles del .clang-tidy del projecte.
Canvis:
- core/types.hpp reescrit: nou struct Vec2 amb +=,-=,*=,/=,
unary -, ==, dot, length, lengthSquared, normalized
- Operadors fora de la classe: +, -, *, / (amb float per ambdues
bandes), - unari, ==
- Vec2 segueix sent aggregate (sense constructors definits):
els 'designated initializers' del codi existent funcionen igual:
Vec2{.x = ..., .y = ...}
- Sed global sobre 35 fitxers: tots els 'Punt' -> 'Vec2'
Net: 35 fitxers tocats, +180 / -114. Compila i enllaça.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6cf990bc1d
commit
cd38101f99
35 files changed
+180
-114
No files matched your search
@@ -31,12 +31,12 @@ class DebrisManager {
|
||||
// - velocitat_angular: velocitat angular heretada (rad/s, per defecte 0)
|
||||
// - factor_herencia_visual: factor de herència rotació visual (0.0-1.0, per defecte 0.0)
|
||||
void explotar(const std::shared_ptr<Graphics::Shape>& shape,
|
||||
const Punt& centre,
|
||||
const Vec2& centre,
|
||||
float angle,
|
||||
float escala,
|
||||
float velocitat_base,
|
||||
float brightness = 1.0F,
|
||||
const Punt& velocitat_objecte = {.x = 0.0F, .y = 0.0F},
|
||||
const Vec2& velocitat_objecte = {.x = 0.0F, .y = 0.0F},
|
||||
float velocitat_angular = 0.0F,
|
||||
float factor_herencia_visual = 0.0F,
|
||||
const std::string& sound = Defaults::Sound::EXPLOSION);
|
||||
@@ -67,7 +67,7 @@ class DebrisManager {
|
||||
Debris* trobar_slot_lliure();
|
||||
|
||||
// Calcular direcció d'explosió (radial, des del centre cap al segment)
|
||||
[[nodiscard]] Punt calcular_direccio_explosio(const Punt& p1, const Punt& p2, const Punt& centre_objecte) const;
|
||||
[[nodiscard]] Vec2 calcular_direccio_explosio(const Vec2& p1, const Vec2& p2, const Vec2& centre_objecte) const;
|
||||
};
|
||||
|
||||
} // namespace Effects
|
||||
Reference in new issue
Block a user