jo arreglant lo de claude
This commit is contained in:
@@ -445,52 +445,56 @@ void Ending::updateSpriteCovers() {
|
|||||||
// Píxeles revelados: tiempo * velocidad
|
// Píxeles revelados: tiempo * velocidad
|
||||||
const float PIXELS_REVEALED = TIME_SINCE_TRIGGER * TEXT_REVEAL_SPEED;
|
const float PIXELS_REVEALED = TIME_SINCE_TRIGGER * TEXT_REVEAL_SPEED;
|
||||||
|
|
||||||
|
// Obtiene el sprite
|
||||||
|
auto SPRITE_TEXT = sprite_texts_.at(ti.index);
|
||||||
|
|
||||||
// Obtener altura inicial de la superficie
|
// Obtener altura inicial de la superficie
|
||||||
const float INITIAL_HEIGHT = sprite_texts_.at(ti.index).image_surface->getHeight();
|
const float INITIAL_HEIGHT = SPRITE_TEXT.image_surface->getHeight();
|
||||||
const float Y_INITIAL = sprite_texts_.at(ti.index).image_sprite->getY();
|
const float Y_INITIAL = SPRITE_TEXT.image_sprite->getY();
|
||||||
|
|
||||||
// Fase 1: Revelar malla decorativa (8 píxeles)
|
// Fase 1: Revelar malla decorativa (8 píxeles)
|
||||||
if (PIXELS_REVEALED < 8.0F) {
|
if (PIXELS_REVEALED < 8.0F) {
|
||||||
sprite_texts_.at(ti.index).cover_clip_desp = static_cast<int>(8.0F - PIXELS_REVEALED);
|
SPRITE_TEXT.cover_clip_desp = static_cast<int>(8.0F - PIXELS_REVEALED);
|
||||||
sprite_texts_.at(ti.index).cover_clip_height = static_cast<int>(INITIAL_HEIGHT);
|
SPRITE_TEXT.cover_clip_height = static_cast<int>(INITIAL_HEIGHT);
|
||||||
sprite_texts_.at(ti.index).cover_sprite->setY(Y_INITIAL);
|
SPRITE_TEXT.cover_sprite->setY(Y_INITIAL);
|
||||||
}
|
}
|
||||||
// Fase 2: Revelar contenido
|
// Fase 2: Revelar contenido
|
||||||
else {
|
else {
|
||||||
sprite_texts_.at(ti.index).cover_clip_desp = 8;
|
SPRITE_TEXT.cover_clip_desp = 0;
|
||||||
const float CONTENT_PIXELS = PIXELS_REVEALED - 8.0F;
|
const int CONTENT_PIXELS = PIXELS_REVEALED - 8.0F;
|
||||||
sprite_texts_.at(ti.index).cover_clip_height = std::max(0, static_cast<int>(INITIAL_HEIGHT - CONTENT_PIXELS));
|
SPRITE_TEXT.cover_clip_height = std::max(0, static_cast<int>(INITIAL_HEIGHT - CONTENT_PIXELS));
|
||||||
sprite_texts_.at(ti.index).cover_sprite->setY(Y_INITIAL + static_cast<int>(CONTENT_PIXELS));
|
SPRITE_TEXT.cover_sprite->setY(Y_INITIAL + static_cast<int>(CONTENT_PIXELS));
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite_texts_.at(ti.index).cover_sprite->setClip(
|
SPRITE_TEXT.cover_sprite->setClip(
|
||||||
0,
|
0,
|
||||||
sprite_texts_.at(ti.index).cover_clip_desp,
|
SPRITE_TEXT.cover_clip_desp,
|
||||||
sprite_texts_.at(ti.index).cover_sprite->getWidth(),
|
SPRITE_TEXT.cover_sprite->getWidth(),
|
||||||
sprite_texts_.at(ti.index).cover_clip_height);
|
SPRITE_TEXT.cover_clip_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza la cortinilla de las imágenes (revelación continua desde el inicio de la escena)
|
// Actualiza la cortinilla de las imágenes (revelación continua desde el inicio de la escena)
|
||||||
|
auto SPRITE_PICS = sprite_pics_.at(current_scene_);
|
||||||
const float PIXELS_REVEALED = state_time_ * IMAGE_REVEAL_SPEED;
|
const float PIXELS_REVEALED = state_time_ * IMAGE_REVEAL_SPEED;
|
||||||
const float INITIAL_HEIGHT = sprite_pics_.at(current_scene_).image_surface->getHeight();
|
const float INITIAL_HEIGHT = SPRITE_PICS.image_surface->getHeight();
|
||||||
const float Y_INITIAL = sprite_pics_.at(current_scene_).image_sprite->getY();
|
const float Y_INITIAL = SPRITE_PICS.image_sprite->getY();
|
||||||
|
|
||||||
// Fase 1: Revelar malla decorativa (8 píxeles)
|
// Fase 1: Revelar malla decorativa (8 píxeles)
|
||||||
if (PIXELS_REVEALED < 8.0F) {
|
if (PIXELS_REVEALED < 8.0F) {
|
||||||
sprite_pics_.at(current_scene_).cover_clip_desp = static_cast<int>(8.0F - PIXELS_REVEALED);
|
SPRITE_PICS.cover_clip_desp = static_cast<int>(8.0F - PIXELS_REVEALED);
|
||||||
sprite_pics_.at(current_scene_).cover_clip_height = static_cast<int>(INITIAL_HEIGHT);
|
SPRITE_PICS.cover_clip_height = static_cast<int>(INITIAL_HEIGHT);
|
||||||
sprite_pics_.at(current_scene_).cover_sprite->setY(Y_INITIAL);
|
SPRITE_PICS.cover_sprite->setY(Y_INITIAL);
|
||||||
}
|
}
|
||||||
// Fase 2: Revelar contenido
|
// Fase 2: Revelar contenido
|
||||||
else {
|
else {
|
||||||
sprite_pics_.at(current_scene_).cover_clip_desp = 8;
|
SPRITE_PICS.cover_clip_desp = 0;
|
||||||
const float CONTENT_PIXELS = PIXELS_REVEALED - 8.0F;
|
const int CONTENT_PIXELS = PIXELS_REVEALED - 8.0F;
|
||||||
sprite_pics_.at(current_scene_).cover_clip_height = std::max(0, static_cast<int>(INITIAL_HEIGHT - CONTENT_PIXELS));
|
SPRITE_PICS.cover_clip_height = std::max(0, static_cast<int>(INITIAL_HEIGHT - CONTENT_PIXELS));
|
||||||
sprite_pics_.at(current_scene_).cover_sprite->setY(Y_INITIAL + static_cast<int>(CONTENT_PIXELS));
|
SPRITE_PICS.cover_sprite->setY(Y_INITIAL + static_cast<int>(CONTENT_PIXELS));
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite_pics_.at(current_scene_).cover_sprite->setClip(0, sprite_pics_.at(current_scene_).cover_clip_desp, sprite_pics_.at(current_scene_).cover_sprite->getWidth(), sprite_pics_.at(current_scene_).cover_clip_height);
|
SPRITE_PICS.cover_sprite->setClip(0, SPRITE_PICS.cover_clip_desp, SPRITE_PICS.cover_sprite->getWidth(), SPRITE_PICS.cover_clip_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba si se ha de cambiar de escena
|
// Comprueba si se ha de cambiar de escena
|
||||||
|
|||||||
Reference in New Issue
Block a user