arreglos en make y cmake
This commit is contained in:
@@ -682,25 +682,39 @@ auto loadPostFXFromFile() -> bool {
|
||||
preset.name = p["name"].get_value<std::string>();
|
||||
}
|
||||
if (p.contains("vignette")) {
|
||||
try { preset.vignette = p["vignette"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.vignette = p["vignette"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("scanlines")) {
|
||||
try { preset.scanlines = p["scanlines"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.scanlines = p["scanlines"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("chroma")) {
|
||||
try { preset.chroma = p["chroma"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.chroma = p["chroma"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("mask")) {
|
||||
try { preset.mask = p["mask"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.mask = p["mask"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("gamma")) {
|
||||
try { preset.gamma = p["gamma"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.gamma = p["gamma"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("curvature")) {
|
||||
try { preset.curvature = p["curvature"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.curvature = p["curvature"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
if (p.contains("bleeding")) {
|
||||
try { preset.bleeding = p["bleeding"].get_value<float>(); } catch (...) {}
|
||||
try {
|
||||
preset.bleeding = p["bleeding"].get_value<float>();
|
||||
} catch (...) {}
|
||||
}
|
||||
postfx_presets.push_back(preset);
|
||||
}
|
||||
@@ -794,11 +808,11 @@ auto savePostFXToFile() -> bool {
|
||||
|
||||
// Cargar los presets recién creados
|
||||
postfx_presets.clear();
|
||||
postfx_presets.push_back({"CRT", 0.6F, 0.7F, 0.15F, 0.6F, 0.8F, 0.0F, 0.0F});
|
||||
postfx_presets.push_back({"NTSC", 0.4F, 0.5F, 0.2F, 0.4F, 0.5F, 0.0F, 0.6F});
|
||||
postfx_presets.push_back({"CURVED", 0.5F, 0.6F, 0.1F, 0.5F, 0.7F, 0.8F, 0.0F});
|
||||
postfx_presets.push_back({"SCANLINES",0.0F, 0.8F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F});
|
||||
postfx_presets.push_back({"SUBTLE", 0.3F, 0.4F, 0.05F, 0.0F, 0.3F, 0.0F, 0.0F});
|
||||
postfx_presets.push_back({"CRT", 0.6F, 0.7F, 0.15F, 0.6F, 0.8F, 0.0F, 0.0F});
|
||||
postfx_presets.push_back({"NTSC", 0.4F, 0.5F, 0.2F, 0.4F, 0.5F, 0.0F, 0.6F});
|
||||
postfx_presets.push_back({"CURVED", 0.5F, 0.6F, 0.1F, 0.5F, 0.7F, 0.8F, 0.0F});
|
||||
postfx_presets.push_back({"SCANLINES", 0.0F, 0.8F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F});
|
||||
postfx_presets.push_back({"SUBTLE", 0.3F, 0.4F, 0.05F, 0.0F, 0.3F, 0.0F, 0.0F});
|
||||
current_postfx_preset = 0;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -116,14 +116,14 @@ struct Game {
|
||||
|
||||
// Estructura para un preset de PostFX
|
||||
struct PostFXPreset {
|
||||
std::string name; // Nombre del preset
|
||||
float vignette{0.6F}; // Intensidad de la viñeta (0.0 = ninguna, 1.0 = máxima)
|
||||
float scanlines{0.7F}; // Intensidad de las scanlines (0.0 = desactivadas, 1.0 = máximas)
|
||||
float chroma{0.15F}; // Intensidad de la aberración cromática (0.0 = ninguna, 1.0 = máxima)
|
||||
float mask{0.0F}; // Intensidad de la máscara de fósforo RGB (0.0 = desactivada, 1.0 = máxima)
|
||||
float gamma{0.0F}; // Corrección gamma input 2.4 / output 2.2 (0.0 = off, 1.0 = plena)
|
||||
float curvature{0.0F}; // Distorsión barrel CRT (0.0 = plana, 1.0 = máxima curvatura)
|
||||
float bleeding{0.0F}; // Sangrado de color NTSC horizontal Y/C (0.0 = off, 1.0 = máximo)
|
||||
std::string name; // Nombre del preset
|
||||
float vignette{0.6F}; // Intensidad de la viñeta (0.0 = ninguna, 1.0 = máxima)
|
||||
float scanlines{0.7F}; // Intensidad de las scanlines (0.0 = desactivadas, 1.0 = máximas)
|
||||
float chroma{0.15F}; // Intensidad de la aberración cromática (0.0 = ninguna, 1.0 = máxima)
|
||||
float mask{0.0F}; // Intensidad de la máscara de fósforo RGB (0.0 = desactivada, 1.0 = máxima)
|
||||
float gamma{0.0F}; // Corrección gamma input 2.4 / output 2.2 (0.0 = off, 1.0 = plena)
|
||||
float curvature{0.0F}; // Distorsión barrel CRT (0.0 = plana, 1.0 = máxima curvatura)
|
||||
float bleeding{0.0F}; // Sangrado de color NTSC horizontal Y/C (0.0 = off, 1.0 = máximo)
|
||||
};
|
||||
|
||||
// --- Variables globales ---
|
||||
@@ -148,12 +148,12 @@ inline int current_postfx_preset{0}; // Índice del preset de Pos
|
||||
inline std::string postfx_file_path{}; // Ruta del fichero postfx.yaml
|
||||
|
||||
// --- Funciones públicas ---
|
||||
void init(); // Crea e inicializa las opciones del programa
|
||||
void setConfigFile(const std::string& path); // Establece la ruta del fichero de configuración
|
||||
auto loadFromFile() -> bool; // Carga las opciones desde el fichero configurado
|
||||
auto saveToFile() -> bool; // Guarda las opciones al fichero configurado
|
||||
void setPostFXFile(const std::string& path); // Establece la ruta del fichero de PostFX
|
||||
auto loadPostFXFromFile() -> bool; // Carga los presets de PostFX desde el fichero
|
||||
auto savePostFXToFile() -> bool; // Guarda los presets de PostFX por defecto
|
||||
void init(); // Crea e inicializa las opciones del programa
|
||||
void setConfigFile(const std::string& path); // Establece la ruta del fichero de configuración
|
||||
auto loadFromFile() -> bool; // Carga las opciones desde el fichero configurado
|
||||
auto saveToFile() -> bool; // Guarda las opciones al fichero configurado
|
||||
void setPostFXFile(const std::string& path); // Establece la ruta del fichero de PostFX
|
||||
auto loadPostFXFromFile() -> bool; // Carga los presets de PostFX desde el fichero
|
||||
auto savePostFXToFile() -> bool; // Guarda los presets de PostFX por defecto
|
||||
|
||||
} // namespace Options
|
||||
@@ -34,7 +34,7 @@ enum class Options {
|
||||
|
||||
// --- Variables de estado globales ---
|
||||
#ifdef _DEBUG
|
||||
inline Scene current = Scene::GAME; // Escena actual
|
||||
inline Scene current = Scene::GAME; // Escena actual
|
||||
inline Options options = Options::LOGO_TO_LOADING_SCREEN; // Opciones de la escena actual
|
||||
#else
|
||||
inline Scene current = Scene::LOGO; // Escena actual
|
||||
|
||||
@@ -66,7 +66,7 @@ class Ending {
|
||||
static constexpr float TEXT_PIXELS_PER_SECOND = 30.0F; // Filas de texto reveladas por segundo
|
||||
static constexpr float IMAGE_PIXELS_PER_SECOND = 60.0F; // Filas de imagen reveladas por segundo
|
||||
static constexpr float STEP_DURATION = 2.0F / 60.0F; // Segundos por paso de revelado (2 frames @ 60fps)
|
||||
static constexpr int REVEAL_STEPS = 4; // Pasos de revelado por fila
|
||||
static constexpr int REVEAL_STEPS = 4; // Pasos de revelado por fila
|
||||
static constexpr float TEXT_LAPSE = 1.333F; // 80 frames @ 60fps
|
||||
static constexpr float FADEOUT_START_OFFSET = 1.667F; // Inicio cortinilla 100 frames antes del fin
|
||||
static constexpr float COVER_PIXELS_PER_SECOND = 120.0F; // Filas cubiertas por segundo
|
||||
|
||||
@@ -288,17 +288,12 @@ void Ending2::updateSprites(float delta) {
|
||||
const float CANVAS_H = static_cast<float>(Options::game.height);
|
||||
|
||||
// Checkpoint inferior: sprite entra per baix → generar de dalt a baix
|
||||
if (Y > static_cast<float>(ENTRY_EXIT_PADDING)
|
||||
&& Y <= CANVAS_H - H - ENTRY_EXIT_PADDING
|
||||
&& sprite->getProgress() >= 1.0F
|
||||
&& sprite->isTransitionDone()) {
|
||||
if (Y > static_cast<float>(ENTRY_EXIT_PADDING) && Y <= CANVAS_H - H - ENTRY_EXIT_PADDING && sprite->getProgress() >= 1.0F && sprite->isTransitionDone()) {
|
||||
sprite->startGenerate(TRANSITION_DURATION_MS, DissolveDirection::UP);
|
||||
}
|
||||
|
||||
// Checkpoint superior: sprite surt per dalt → dissoldre de dalt a baix
|
||||
if (Y <= static_cast<float>(ENTRY_EXIT_PADDING)
|
||||
&& sprite->getProgress() <= 0.0F
|
||||
&& sprite->isTransitionDone()) {
|
||||
if (Y <= static_cast<float>(ENTRY_EXIT_PADDING) && sprite->getProgress() <= 0.0F && sprite->isTransitionDone()) {
|
||||
sprite->startDissolve(TRANSITION_DURATION_MS, DissolveDirection::DOWN);
|
||||
}
|
||||
}
|
||||
@@ -313,16 +308,11 @@ void Ending2::updateTextSprites(float delta) {
|
||||
const float H = sprite->getHeight();
|
||||
const float CANVAS_H = static_cast<float>(Options::game.height);
|
||||
|
||||
if (Y > static_cast<float>(ENTRY_EXIT_PADDING)
|
||||
&& Y <= CANVAS_H - H - ENTRY_EXIT_PADDING
|
||||
&& sprite->getProgress() >= 1.0F
|
||||
&& sprite->isTransitionDone()) {
|
||||
if (Y > static_cast<float>(ENTRY_EXIT_PADDING) && Y <= CANVAS_H - H - ENTRY_EXIT_PADDING && sprite->getProgress() >= 1.0F && sprite->isTransitionDone()) {
|
||||
sprite->startGenerate(TRANSITION_DURATION_MS, DissolveDirection::UP);
|
||||
}
|
||||
|
||||
if (Y <= static_cast<float>(ENTRY_EXIT_PADDING)
|
||||
&& sprite->getProgress() <= 0.0F
|
||||
&& sprite->isTransitionDone()) {
|
||||
if (Y <= static_cast<float>(ENTRY_EXIT_PADDING) && sprite->getProgress() <= 0.0F && sprite->isTransitionDone()) {
|
||||
sprite->startDissolve(TRANSITION_DURATION_MS, DissolveDirection::DOWN);
|
||||
}
|
||||
}
|
||||
@@ -338,17 +328,12 @@ void Ending2::updateTexts(float delta) {
|
||||
const float CANVAS_H = static_cast<float>(Options::game.height);
|
||||
|
||||
// Checkpoint inferior: text entra per baix → generar de dalt a baix
|
||||
if (Y > static_cast<float>(ENTRY_EXIT_PADDING)
|
||||
&& Y <= CANVAS_H - H - ENTRY_EXIT_PADDING
|
||||
&& sprite->getProgress() >= 1.0F
|
||||
&& sprite->isTransitionDone()) {
|
||||
if (Y > static_cast<float>(ENTRY_EXIT_PADDING) && Y <= CANVAS_H - H - ENTRY_EXIT_PADDING && sprite->getProgress() >= 1.0F && sprite->isTransitionDone()) {
|
||||
sprite->startGenerate(TRANSITION_DURATION_MS, DissolveDirection::UP);
|
||||
}
|
||||
|
||||
// Checkpoint superior: text surt per dalt → dissoldre de dalt a baix
|
||||
if (Y <= static_cast<float>(ENTRY_EXIT_PADDING)
|
||||
&& sprite->getProgress() <= 0.0F
|
||||
&& sprite->isTransitionDone()) {
|
||||
if (Y <= static_cast<float>(ENTRY_EXIT_PADDING) && sprite->getProgress() <= 0.0F && sprite->isTransitionDone()) {
|
||||
sprite->startDissolve(TRANSITION_DURATION_MS, DissolveDirection::DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
#include <string> // Para string
|
||||
#include <vector> // Para vector
|
||||
|
||||
#include "utils/defines.hpp" // Para GameCanvas::WIDTH, GameCanvas::FIRST_QUAR...
|
||||
|
||||
#include "core/rendering/surface_dissolve_sprite.hpp" // Para SurfaceDissolveSprite
|
||||
#include "utils/defines.hpp" // Para GameCanvas::WIDTH, GameCanvas::FIRST_QUAR...
|
||||
|
||||
class SurfaceMovingSprite;
|
||||
class DeltaTimer;
|
||||
@@ -44,8 +43,8 @@ class Ending2 {
|
||||
static constexpr int DIST_SPRITE_SPRITE = 0; // Distancia entre dos sprites de la misma columna
|
||||
static constexpr int INITIAL_Y_OFFSET = 40; // Offset inicial en Y para posicionar sprites
|
||||
static constexpr int SCREEN_MESH_HEIGHT = 8; // Altura de la malla superior/inferior de la pantalla
|
||||
static constexpr int FADE_H = 24; // Alçada de la zona de dissolució als cantons (files)
|
||||
static constexpr float TRANSITION_DURATION_MS = 500.0F; // ms per canviar d'estat (generar o dissoldre)
|
||||
static constexpr int FADE_H = 24; // Alçada de la zona de dissolució als cantons (files)
|
||||
static constexpr float TRANSITION_DURATION_MS = 500.0F; // ms per canviar d'estat (generar o dissoldre)
|
||||
static constexpr int ENTRY_EXIT_PADDING = 2; // px de padding als bordes per activar dissolució/generació
|
||||
static constexpr int TEXT_SPACING_MULTIPLIER = 2; // Multiplicador para espaciado entre líneas de texto
|
||||
|
||||
@@ -80,8 +79,8 @@ class Ending2 {
|
||||
// Objetos y punteros a recursos
|
||||
std::vector<std::shared_ptr<SurfaceDissolveSprite>> sprites_; // Vector con todos los sprites a dibujar
|
||||
std::vector<std::shared_ptr<SurfaceDissolveSprite>> sprite_texts_; // Vector con los sprites de texto de los sprites
|
||||
std::vector<std::shared_ptr<SurfaceDissolveSprite>> texts_; // Vector con los sprites de texto
|
||||
std::unique_ptr<DeltaTimer> delta_timer_; // Timer para time-based update
|
||||
std::vector<std::shared_ptr<SurfaceDissolveSprite>> texts_; // Vector con los sprites de texto
|
||||
std::unique_ptr<DeltaTimer> delta_timer_; // Timer para time-based update
|
||||
|
||||
// Variables de estado
|
||||
State state_; // Controla el estado de la clase
|
||||
|
||||
Reference in New Issue
Block a user