treballant en PixelReveal

This commit is contained in:
2026-03-19 08:20:03 +01:00
parent c4d4a3b930
commit 31bbaf997f
8 changed files with 167 additions and 165 deletions

View File

@@ -7,13 +7,14 @@
#include <vector> // Para vector
class SurfaceSprite; // lines 8-8
class Surface; // lines 9-9
class PixelReveal;
class DeltaTimer;
class Ending {
public:
// --- Constructor y Destructor ---
Ending();
~Ending() = default;
~Ending();
// --- Bucle principal ---
void run();
@@ -34,10 +35,9 @@ class Ending {
struct EndingSurface {
std::shared_ptr<Surface> image_surface; // Surface a mostrar
std::shared_ptr<SurfaceSprite> image_sprite; // SSprite para mostrar la textura
std::shared_ptr<Surface> cover_surface; // Surface que cubre a la otra textura
std::shared_ptr<SurfaceSprite> cover_sprite; // SSprite para mostrar la textura que cubre a la otra textura
int cover_clip_desp{0}; // Desplazamiento del spriteClip de la textura de cobertura
int cover_clip_height{0}; // Altura del spriteClip de la textura de cobertura
std::unique_ptr<PixelReveal> pixel_reveal; // Efecto de revelado pixel a pixel
int pos_x{0}; // Posición X de renderizado
int pos_y{0}; // Posición Y de renderizado
};
struct TextAndPosition {
@@ -64,8 +64,10 @@ class Ending {
static constexpr float SCENE_2_DURATION = 16.667F; // 1000 frames @ 60fps
static constexpr float SCENE_3_DURATION = 13.333F; // 800 frames @ 60fps
static constexpr float SCENE_4_DURATION = 16.667F; // 1000 frames @ 60fps
static constexpr float TEXT_REVEAL_SPEED = 30.0F; // 2px cada 4 frames @ 60fps
static constexpr float IMAGE_REVEAL_SPEED = 60.0F; // 2px cada 2 frames @ 60fps
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 = 10; // Pasos de revelado por fila (más pasos = efecto más visible)
static constexpr float TEXT_LAPSE = 1.333F; // 80 frames @ 60fps
static constexpr float FADEOUT_START_OFFSET = 1.667F; // Inicio fade-out 100 frames antes del fin
static constexpr float ENDING_DURATION = 2.0F; // Duración del estado ENDING (2 segundos)