diff --git a/source/engine.cpp b/source/engine.cpp index 926d351..03195f5 100644 --- a/source/engine.cpp +++ b/source/engine.cpp @@ -1831,6 +1831,15 @@ void Engine::performDemoAction(bool is_lite) { // Randomizar todo al iniciar modo DEMO void Engine::randomizeOnDemoStart(bool is_lite) { + // Si venimos de LOGO con PNG_SHAPE, cambiar figura obligatoriamente + // PNG_SHAPE es exclusivo del modo LOGO y no debe aparecer en DEMO/DEMO_LITE + if (current_shape_type_ == ShapeType::PNG_SHAPE) { + ShapeType shapes[] = {ShapeType::SPHERE, ShapeType::LISSAJOUS, ShapeType::HELIX, + ShapeType::TORUS, ShapeType::CUBE, ShapeType::CYLINDER, + ShapeType::ICOSAHEDRON, ShapeType::ATOM}; + activateShape(shapes[rand() % 8]); + } + if (is_lite) { // DEMO LITE: Solo randomizar física/figura + gravedad // Elegir aleatoriamente entre modo física o figura @@ -1932,18 +1941,18 @@ void Engine::enterLogoMode(bool from_demo) { logo_previous_texture_index_ = current_texture_index_; logo_previous_shape_scale_ = shape_scale_factor_; - // Buscar índice de textura "tiny" - size_t tiny_index = current_texture_index_; // Por defecto mantener actual + // Buscar índice de textura "small" + size_t small_index = current_texture_index_; // Por defecto mantener actual for (size_t i = 0; i < texture_names_.size(); i++) { - if (texture_names_[i] == "tiny") { - tiny_index = i; + if (texture_names_[i] == "small") { + small_index = i; break; } } // Aplicar configuración fija del Modo Logo - if (tiny_index != current_texture_index_) { - current_texture_index_ = tiny_index; + if (small_index != current_texture_index_) { + current_texture_index_ = small_index; int old_size = current_ball_size_; current_ball_size_ = textures_[current_texture_index_]->getWidth(); updateBallSizes(old_size, current_ball_size_); @@ -1955,8 +1964,10 @@ void Engine::enterLogoMode(bool from_demo) { } } - // Cambiar a tema MONOCHROME - theme_manager_->switchToTheme(5); // MONOCHROME + // Cambiar a tema aleatorio entre: MONOCHROME, LAVENDER, CRIMSON, ESMERALDA + int logo_themes[] = {5, 6, 7, 8}; // MONOCHROME, LAVENDER, CRIMSON, ESMERALDA + int random_theme = logo_themes[rand() % 4]; + theme_manager_->switchToTheme(random_theme); // Establecer escala a 120% shape_scale_factor_ = LOGO_MODE_SHAPE_SCALE; @@ -2023,6 +2034,14 @@ void Engine::exitLogoMode(bool return_to_demo) { } else { // Volver al modo previo (DEMO o DEMO_LITE) setState(previous_app_mode_); + + // Si la figura activa es PNG_SHAPE, cambiar a otra figura aleatoria + if (current_shape_type_ == ShapeType::PNG_SHAPE) { + ShapeType shapes[] = {ShapeType::SPHERE, ShapeType::LISSAJOUS, ShapeType::HELIX, + ShapeType::TORUS, ShapeType::CUBE, ShapeType::CYLINDER, + ShapeType::ICOSAHEDRON, ShapeType::ATOM}; + activateShape(shapes[rand() % 8]); + } } }