renomena tipus _t/_e a CamelCase (Circle, Color, Section, ...)

This commit is contained in:
2026-05-14 22:16:36 +02:00
parent 9a2da460cc
commit 0bc55f5732
37 changed files with 209 additions and 209 deletions
+20 -20
View File
@@ -11,56 +11,56 @@ constexpr int DIFFICULTY_NORMAL = 1;
constexpr int DIFFICULTY_HARD = 2;
// Estructura para definir un circulo
struct circle_t {
struct Circle {
int x;
int y;
int r;
};
// Estructura para definir una linea horizontal
struct h_line_t {
struct HorizontalLine {
int x1, x2, y;
};
// Estructura para definir una linea vertical
struct v_line_t {
struct VerticalLine {
int x, y1, y2;
};
// Estructura para definir una linea diagonal
struct d_line_t {
struct DiagonalLine {
int x1, y1, x2, y2;
};
// Estructura para definir una linea
struct line_t {
struct Line {
int x1, y1, x2, y2;
};
// Estructura para definir un color
struct color_t {
struct Color {
Uint8 r;
Uint8 g;
Uint8 b;
color_t()
Color()
: r(0),
g(0),
b(0) {} // Constructor por defecto
color_t(Uint8 red, Uint8 green, Uint8 blue)
Color(Uint8 red, Uint8 green, Uint8 blue)
: r(red),
g(green),
b(blue) {}
};
// Estructura para saber la seccion y subseccion del programa
struct section_t {
struct Section {
Uint8 name;
Uint8 subsection;
};
// Estructura para mapear el teclado usado en la demo
struct demoKeys_t {
struct DemoKeys {
Uint8 left;
Uint8 right;
Uint8 noInput;
@@ -70,7 +70,7 @@ struct demoKeys_t {
};
// Estructura para albergar métodos de control
struct input_t {
struct InputDevice {
int id; // Identificador en el vector de mandos
std::string name; // Nombre del dispositivo
Uint8 deviceType; // Tipo de dispositivo (teclado o mando)
@@ -80,10 +80,10 @@ struct input_t {
auto distanceSquared(int x1, int y1, int x2, int y2) -> double;
// Detector de colisiones entre dos circulos
auto checkCollision(const circle_t &a, const circle_t &b) -> bool;
auto checkCollision(const Circle &a, const Circle &b) -> bool;
// Detector de colisiones entre un circulo y un rectangulo
auto checkCollision(const circle_t &a, const SDL_Rect &b) -> bool;
auto checkCollision(const Circle &a, const SDL_Rect &b) -> bool;
// Detector de colisiones entre un dos rectangulos
auto checkCollision(const SDL_Rect &a, const SDL_Rect &b) -> bool;
@@ -92,25 +92,25 @@ auto checkCollision(const SDL_Rect &a, const SDL_Rect &b) -> bool;
auto checkCollision(const SDL_Point &p, const SDL_Rect &r) -> bool;
// Detector de colisiones entre una linea horizontal y un rectangulo
auto checkCollision(const h_line_t &l, const SDL_Rect &r) -> bool;
auto checkCollision(const HorizontalLine &l, const SDL_Rect &r) -> bool;
// Detector de colisiones entre una linea vertical y un rectangulo
auto checkCollision(const v_line_t &l, const SDL_Rect &r) -> bool;
auto checkCollision(const VerticalLine &l, const SDL_Rect &r) -> bool;
// Detector de colisiones entre una linea horizontal y un punto
auto checkCollision(const h_line_t &l, const SDL_Point &p) -> bool;
auto checkCollision(const HorizontalLine &l, const SDL_Point &p) -> bool;
// Detector de colisiones entre dos lineas
auto checkCollision(const line_t &l1, const line_t &l2) -> SDL_Point;
auto checkCollision(const Line &l1, const Line &l2) -> SDL_Point;
// Detector de colisiones entre dos lineas
auto checkCollision(const d_line_t &l1, const v_line_t &l2) -> SDL_Point;
auto checkCollision(const DiagonalLine &l1, const VerticalLine &l2) -> SDL_Point;
// Detector de colisiones entre un punto y una linea diagonal
auto checkCollision(const SDL_Point &p, const d_line_t &l) -> bool;
auto checkCollision(const SDL_Point &p, const DiagonalLine &l) -> bool;
// Normaliza una linea diagonal
void normalizeLine(d_line_t &l);
void normalizeLine(DiagonalLine &l);
// Convierte una cadena en un valor booleano
auto stringToBool(const std::string &str) -> bool;