mogut options.section a SceneManager

This commit is contained in:
2025-10-26 14:18:45 +01:00
parent df4965a84b
commit 51330db998
15 changed files with 129 additions and 120 deletions

View File

@@ -1,3 +1,5 @@
#include "game/scene_manager.hpp" // Para SceneManager
#include "game/scenes/ending2.hpp"
#include <SDL3/SDL.h>
@@ -20,8 +22,8 @@
// Constructor
Ending2::Ending2()
: state_(EndingState::PRE_CREDITS, SDL_GetTicks(), STATE_PRE_CREDITS_DURATION_) {
Options::section.section = Options::Scene::ENDING2;
Options::section.subsection = Options::SceneOptions::NONE;
SceneManager::current = SceneManager::Scene::ENDING2;
SceneManager::options = SceneManager::Options::NONE;
// Inicializa el vector de colores
const std::vector<std::string> COLORS = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
@@ -146,7 +148,7 @@ void Ending2::checkInput() {
void Ending2::run() {
JA_PlayMusic(Resource::get()->getMusic("ending2.ogg"));
while (Options::section.section == Options::Scene::ENDING2) {
while (SceneManager::current == SceneManager::Scene::ENDING2) {
update();
checkEvents();
render();
@@ -179,8 +181,8 @@ void Ending2::updateState() {
case EndingState::FADING:
if (state_.hasEnded(EndingState::FADING)) {
Options::section.section = Options::Scene::LOGO;
Options::section.subsection = Options::SceneOptions::LOGO_TO_INTRO;
SceneManager::current = SceneManager::Scene::LOGO;
SceneManager::options = SceneManager::Options::LOGO_TO_INTRO;
}
break;