pause.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 
00025 #ifndef __PAUSE_HEADER__
00026 #define __PAUSE_HEADER__
00027 
00028 #include "utils.h"
00029 #include "defs.h"
00030 #include "mode_manager.h"
00031 #include "video.h"
00032 
00034 namespace hoa_pause {
00035 
00037 extern bool PAUSE_DEBUG;
00038 
00039 /*!****************************************************************************
00040  * \brief A mode pushed onto the game mode stack when the user pauses the game.
00041  *
00042  * This class basically saves the last frame displayed to the screen, grays it
00043  * out a little, and then renders the text "Paused" in the center of the screen.
00044  * The game remains paused until the user either presses the pause button again
00045  * or tries to quit the game.
00046  *
00047  * \note 1) During some scenes of the game you might need the audio to be synchronized
00048  * with the flow of action. If the user tries to pause the game you will want to pause 
00049  * the audio so the audio doesn't go out of synch with the action. In order to do this, 
00050  * when you begin such a scene you need to call the SetPauseVolumeAction() function of 
00051  * the  GameSettings class with the argument SETTINGS_PAUSE_AUDIO. When you are finished 
00052  * with this type of scene, you must must MUST remember to set this member back to its 
00053  * original value.
00054  *****************************************************************************/ 
00055 class PauseMode : public hoa_mode_manager::GameMode {
00056 private:
00058   hoa_video::StillImage _saved_screen;
00059 
00063   float _saved_music_volume;
00064   float _saved_sound_volume;
00065 public:
00066   PauseMode();
00067   ~PauseMode();
00068   
00070   void Reset();
00072   void Update();
00074   void Draw();
00075 };
00076 
00077 } // namespace hoa_pause
00078 
00079 #endif

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