corregit: el mode demo ja funciona correctament
This commit is contained in:
@@ -53,20 +53,19 @@ struct DemoKeys {
|
||||
using DemoData = std::vector<DemoKeys>;
|
||||
|
||||
struct Demo {
|
||||
bool enabled; // Indica si está activo el modo demo
|
||||
bool recording; // Indica si está activado el modo para grabar la demo
|
||||
int counter; // Contador para el modo demo
|
||||
bool enabled = false; // Indica si está activo el modo demo
|
||||
bool recording = false; // Indica si está activado el modo para grabar la demo
|
||||
float elapsed_s = 0.0F; // Segundos transcurridos de demo
|
||||
int index = 0; // Contador para el modo demo
|
||||
DemoKeys keys; // Variable con las pulsaciones de teclas del modo demo
|
||||
std::vector<DemoData> data; // Vector con diferentes sets de datos con los movimientos para la demo
|
||||
|
||||
Demo()
|
||||
: enabled(false),
|
||||
recording(false),
|
||||
counter(0) {}
|
||||
Demo(bool e, bool r, int c, const DemoKeys &k, const std::vector<DemoData> &d)
|
||||
Demo() = default;
|
||||
|
||||
Demo(bool e, bool r, int c, const DemoKeys& k, const std::vector<DemoData>& d)
|
||||
: enabled(e),
|
||||
recording(r),
|
||||
counter(c),
|
||||
index(c),
|
||||
keys(k),
|
||||
data(d) {}
|
||||
};
|
||||
@@ -88,21 +87,21 @@ extern Overrides overrides; // Configuración global de overrides
|
||||
|
||||
// Colisiones y geometría
|
||||
auto distanceSquared(int x1, int y1, int x2, int y2) -> double;
|
||||
auto getCollisionPoint(const Circle &a, const Circle &b) -> SDL_FPoint;
|
||||
auto checkCollision(const Circle &a, const Circle &b) -> bool;
|
||||
auto checkCollision(const Circle &a, const SDL_FRect &b) -> bool;
|
||||
auto checkCollision(const SDL_FRect &a, const SDL_FRect &b) -> bool;
|
||||
auto checkCollision(const SDL_FPoint &p, const SDL_FRect &r) -> bool;
|
||||
auto getCollisionPoint(const Circle& a, const Circle& b) -> SDL_FPoint;
|
||||
auto checkCollision(const Circle& a, const Circle& b) -> bool;
|
||||
auto checkCollision(const Circle& a, const SDL_FRect& b) -> bool;
|
||||
auto checkCollision(const SDL_FRect& a, const SDL_FRect& b) -> bool;
|
||||
auto checkCollision(const SDL_FPoint& p, const SDL_FRect& r) -> bool;
|
||||
|
||||
// Conversión y manipulación de cadenas
|
||||
auto stringToBool(const std::string &str) -> bool;
|
||||
auto stringToBool(const std::string& str) -> bool;
|
||||
auto boolToString(bool value) -> std::string;
|
||||
auto boolToOnOff(bool value) -> std::string;
|
||||
auto toLower(const std::string &str) -> std::string;
|
||||
auto trim(const std::string &str) -> std::string;
|
||||
auto toLower(const std::string& str) -> std::string;
|
||||
auto trim(const std::string& str) -> std::string;
|
||||
|
||||
// Dibujo
|
||||
void drawCircle(SDL_Renderer *renderer, int32_t center_x, int32_t center_y, int32_t radius);
|
||||
void drawCircle(SDL_Renderer* renderer, int32_t center_x, int32_t center_y, int32_t radius);
|
||||
|
||||
// Funciones de suavizado (easing)
|
||||
auto easeOutQuint(double time) -> double;
|
||||
@@ -123,17 +122,17 @@ auto easeOutCubic(double time) -> double;
|
||||
auto easeInCubic(double time) -> double;
|
||||
|
||||
// Utilidades varias
|
||||
auto stringInVector(const std::vector<std::string> &vec, const std::string &str) -> bool; // Comprueba si un vector contiene una cadena
|
||||
void printWithDots(const std::string &text1, const std::string &text2, const std::string &text3); // Imprime una línea con puntos
|
||||
auto truncateWithEllipsis(const std::string &input, size_t length) -> std::string; // Trunca un string y le añade puntos suspensivos
|
||||
auto stringInVector(const std::vector<std::string>& vec, const std::string& str) -> bool; // Comprueba si un vector contiene una cadena
|
||||
void printWithDots(const std::string& text1, const std::string& text2, const std::string& text3); // Imprime una línea con puntos
|
||||
auto truncateWithEllipsis(const std::string& input, size_t length) -> std::string; // Trunca un string y le añade puntos suspensivos
|
||||
|
||||
// Demo
|
||||
auto loadDemoDataFromFile(const std::string &file_path) -> DemoData;
|
||||
auto loadDemoDataFromFile(const std::string& file_path) -> DemoData;
|
||||
|
||||
#ifdef RECORDING
|
||||
bool saveDemoFile(const std::string &file_path, const DemoData &dd);
|
||||
bool saveDemoFile(const std::string& file_path, const DemoData& dd);
|
||||
#endif
|
||||
|
||||
// Ficheros y rutas
|
||||
auto getFileName(const std::string &path) -> std::string; // Obtiene el nombre de un fichero a partir de una ruta
|
||||
auto getPath(const std::string &full_path) -> std::string; // Obtiene la ruta eliminando el nombre del fichero
|
||||
auto getFileName(const std::string& path) -> std::string; // Obtiene el nombre de un fichero a partir de una ruta
|
||||
auto getPath(const std::string& full_path) -> std::string; // Obtiene la ruta eliminando el nombre del fichero
|
||||
Reference in New Issue
Block a user