boot.h

Go to the documentation of this file.
00001 
00002 //            Copyright (C) 2004-2007 by The Allacrost Project
00003 //                         All Rights Reserved
00004 //
00005 // This code is licensed under the GNU GPL version 2. It is free software
00006 // and you may modify it and/or redistribute it under the terms of this license.
00007 // See http://www.gnu.org/copyleft/gpl.html for details.
00009 
00019 #ifndef __BOOT_HEADER__
00020 #define __BOOT_HEADER__
00021 
00022 #include <string>
00023 #include <vector>
00024 
00025 #include "utils.h"
00026 #include "defs.h"
00027 
00028 #include "video.h"
00029 #include "mode_manager.h"
00030 
00031 #include "boot_menu.h"
00032 #include "boot_credits.h"
00033 #include "boot_welcome.h"
00034 
00036 namespace hoa_boot {
00037 
00039 extern bool BOOT_DEBUG;
00040 
00042 namespace private_boot {
00043 
00044 } // namespace private_boot
00045 
00046 /*!****************************************************************************
00047  * \brief Handles everything that needs to be done on the game's boot screen.
00048  *
00049  * This is the first mode that is pushed onto the game stack when the program starts.
00050  * Because the user can set various game settings from this game mode, it has a
00051  * heavy amount of interaction with the GameSettings class.
00052  *
00053  *****************************************************************************/
00054 class BootMode : public hoa_mode_manager::GameMode {
00055 private:
00057   bool _fade_out;
00058 
00060   static bool _logo_animating;
00061 
00063   std::vector<hoa_audio::MusicDescriptor> _boot_music;
00065   std::vector<hoa_audio::SoundDescriptor> _boot_sounds;
00067   std::vector<hoa_video::StillImage> _boot_images;
00068 
00070   CreditsScreen _credits_screen;
00071 
00073   WelcomeScreen _welcome_screen;
00074 
00076   BootMenu * _current_menu;
00077 
00079   BootMenu _main_menu;
00080 
00082   BootMenu _options_menu;
00083 
00085   BootMenu _video_options_menu;
00086 
00088   BootMenu _audio_options_menu;
00089 
00091   BootMenu _key_settings_menu;
00092 
00094   BootMenu _joy_settings_menu;
00095 
00097   BootMenu _resolution_menu;
00098 
00100   bool _latest_version;
00101 
00103   bool _has_modified_settings;
00104 
00106   std::string _latest_version_number;
00107 
00108 
00139   void _AnimateLogo();
00140 
00142   void _DrawBackgroundItems();
00143 
00145   void _EndOpeningAnimation();
00146 
00148   SDLKey _WaitKeyPress();
00149 
00151   uint8 _WaitJoyPress();
00152 
00157   void _RedefineUpKey();
00158   void _RedefineDownKey();
00159   void _RedefineLeftKey();
00160   void _RedefineRightKey();
00161   void _RedefineConfirmKey();
00162   void _RedefineCancelKey();
00163   void _RedefineMenuKey();
00164   void _RedefineSwapKey();
00165   void _RedefineLeftSelectKey();
00166   void _RedefineRightSelectKey();
00167   void _RedefinePauseKey();
00169 
00174   void _RedefineConfirmJoy();
00175   void _RedefineCancelJoy();
00176   void _RedefineMenuJoy();
00177   void _RedefineSwapJoy();
00178   void _RedefineLeftSelectJoy();
00179   void _RedefineRightSelectJoy();
00180   void _RedefinePauseJoy();
00182 
00187   void _SetupMainMenu();
00188   void _SetupOptionsMenu();
00189   void _SetupVideoOptionsMenu();
00190   void _SetupAudioOptionsMenu();
00191   void _SetupKeySetttingsMenu();
00192   void _SetupJoySetttingsMenu();
00193   void _SetupResolutionMenu();
00195 
00196   // Main Menu handlers
00198   void _OnNewGame();
00200   void _OnLoadGame();
00202   void _OnOptions();
00204   void _OnCredits();
00206   void _OnQuit();
00208   void _OnBattleDebug();
00210   void _OnMenuDebug();
00212   void _OnShopDebug();
00213 
00214   // Options' handlers
00216   void _OnVideoOptions();
00218   void _OnAudioOptions();
00220   void _OnKeySettings();
00222   void _OnJoySettings();
00223 
00225   void _OnResolution();
00227   void _OnVideoMode();
00228 
00230   void _OnSoundLeft();
00232   void _OnSoundRight();
00234   void _OnMusicLeft();
00236   void _OnMusicRight();
00237 
00238 
00243   void _SetResolution(int32 width, int32 height);
00244   void _OnResolution640x480();
00245   void _OnResolution800x600();
00246   void _OnResolution1024x768();
00248 
00250   void _OnBrightnessLeft();
00251 
00253   void _OnBrightnessRight();
00254 
00255 
00257   void _OnRestoreDefaultKeys();
00259   void _OnRestoreDefaultJoyButtons();
00260 
00261 
00263   void _UpdateVideoOptions();
00264 
00266   void _UpdateAudioOptions();
00267 
00269   void _UpdateKeySettings();
00270 
00272   void _UpdateJoySettings();
00273 
00275   void _SaveSettingsFile();
00276 
00277 public:
00279   BootMode();
00281   ~BootMode();
00282 
00284   void Reset();
00286   void Update();
00288   void Draw();
00289 
00290 };
00291 
00292 } // namespace hoa_boot
00293 
00294 #endif

Generated on Fri Jul 6 23:11:11 2007 for Hero of Allacrost by  doxygen 1.5.1