muguda la logica de demo de utils.cpp a demo.cpp
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
// --- Constantes ---
|
||||
constexpr int BLOCK = 8;
|
||||
constexpr int TOTAL_DEMO_DATA = 2000;
|
||||
|
||||
// --- Estructuras ---
|
||||
struct Overrides {
|
||||
@@ -32,43 +31,6 @@ struct Circle {
|
||||
r(radius) {}
|
||||
};
|
||||
|
||||
struct DemoKeys {
|
||||
Uint8 left;
|
||||
Uint8 right;
|
||||
Uint8 no_input;
|
||||
Uint8 fire;
|
||||
Uint8 fire_left;
|
||||
Uint8 fire_right;
|
||||
|
||||
explicit DemoKeys(Uint8 l = 0, Uint8 r = 0, Uint8 ni = 0, Uint8 f = 0, Uint8 fl = 0, Uint8 fr = 0)
|
||||
: left(l),
|
||||
right(r),
|
||||
no_input(ni),
|
||||
fire(f),
|
||||
fire_left(fl),
|
||||
fire_right(fr) {}
|
||||
};
|
||||
|
||||
// --- Tipos ---
|
||||
using DemoData = std::vector<DemoKeys>;
|
||||
|
||||
struct 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() = default;
|
||||
|
||||
Demo(bool e, bool r, int c, const DemoKeys& k, const std::vector<DemoData>& d)
|
||||
: enabled(e),
|
||||
recording(r),
|
||||
index(c),
|
||||
keys(k),
|
||||
data(d) {}
|
||||
};
|
||||
|
||||
struct Zone {
|
||||
SDL_FRect rect; // Rectangulo que define la zona
|
||||
@@ -126,12 +88,6 @@ auto stringInVector(const std::vector<std::string>& vec, const std::string& str)
|
||||
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;
|
||||
|
||||
#ifdef RECORDING
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user