#include "m_menu.h" #include "jgame.h" #include "jinput.h" #include "controller.h" #include "jdraw.h" #include "config.h" #include #include "jaudio.h" #include "actor.h" namespace modules { namespace menu { draw::surface *surf; int anim_pos=0; int retras=4; int selected_option = OPTION_JUGAR; bool prologo_desbloquejat = false; int min_option = 1; void init() { if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg"); selected_option = OPTION_JUGAR; ::game::setUpdateTicks(64); draw::loadPalette("test.gif"); surf = draw::getSurface("test.gif"); draw::restorecol(2); if (config::isProgoloDesbloquejat()) min_option=0; } int loop() { if (controller::pressed(KEY_MENU)) { return OPTION_EIXIR; } if (controller::pressed(KEY_DOWN) || input::keyPressed(SDL_SCANCODE_DOWN)) { audio::playSound("snd_push.wav", SOUND_BASIC); selected_option++; if (selected_option==6) selected_option=min_option; } if (controller::pressed(KEY_UP) || input::keyPressed(SDL_SCANCODE_UP)) { audio::playSound("snd_push.wav", SOUND_BASIC); selected_option--; if (selected_option