refactor(scenes): flux centralitzat amb SceneId+ExitRequest; TitleScene attract → LOGO amb fade-to-black

This commit is contained in:
JailDesigner committed 2026-05-06 18:33:31 +02:00
1 parent 25ce524470
commit b6d6ee471c
17 files changed
+368 -121

No files matched your search

+8 -5
View File
@@ -17,6 +17,7 @@
#include "core/ui/ui_config.hpp"
#include "game/options.hpp"
#include "game/scenes/placeholder_input.hpp"
#include "game/scenes/scene_flow.hpp"
#include "utils/defaults.hpp"
#include "utils/defines.hpp"
@@ -30,10 +31,9 @@ namespace {
} // namespace
IntroScene::IntroScene(std::shared_ptr<Text> font, DebugConfig::StartingPlayers starting_players, SceneFactory next_factory)
IntroScene::IntroScene(std::shared_ptr<Text> font, DebugConfig::StartingPlayers starting_players)
: font_(std::move(font)),
starting_players_(starting_players),
next_factory_(std::move(next_factory)) {
starting_players_(starting_players) {
std::cout << "[scene] " << SCENE_NAME << " start (players=" << DebugConfig::toString(starting_players_) << ")\n";
}
@@ -52,8 +52,11 @@ void IntroScene::update(int delta_ms) {
return ev.type == SDL_EVENT_KEY_DOWN && !Placeholder::isReservedScancode(ev.key.scancode);
});
if ((timer_ms_ <= 0 || SKIPPED) && next_factory_) {
next_scene_ = next_factory_(starting_players_);
if (timer_ms_ <= 0 || SKIPPED) {
exit_request_ = ExitRequest{
.next = SceneId::GAME,
.params = GameParams{.starting_players = starting_players_},
};
}
Notifier::get().update(delta_ms);