cd38101f99
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>
20 lines
511 B
C++
20 lines
511 B
C++
// main.cpp - Vec2 d'entrada del joc Asteroides
|
|
// © 1999 Visente i Sergi (versió Pascal)
|
|
// © 2025 Port a C++20 amb SDL3
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "core/system/director.hpp"
|
|
|
|
int main(int argc, char* argv[]) {
|
|
// Convertir arguments a std::vector<std::string>
|
|
std::vector<std::string> args(argv, argv + argc);
|
|
|
|
// Crear director (inicialitza sistema, opcions, configuració)
|
|
Director director(args);
|
|
|
|
// Executar bucle principal del joc
|
|
return director.run();
|
|
}
|