hoa_pause::PauseMode Class Reference

A mode pushed onto the game mode stack when the user pauses the game. More...

#include <pause.h>

Inheritance diagram for hoa_pause::PauseMode:

Inheritance graph
[legend]
Collaboration diagram for hoa_pause::PauseMode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Draw ()
 Draws the next frame to be displayed on the screen.
 PauseMode ()
void Reset ()
 Resets appropriate class members. Called whenever PauseMode is made the active game mode.
void Update ()
 Updates the game state by the amount of time that has elapsed.
 ~PauseMode ()

Private Attributes

float _saved_music_volume
 Retains the original volume levels when this mode is active. Volume is restored when the mode is destroyed.
hoa_video::StillImage _saved_screen
 An image of the last frame shown on the screen before PauseMode was called.
float _saved_sound_volume

Detailed Description

A mode pushed onto the game mode stack when the user pauses the game.

****************************************************************************

This class basically saves the last frame displayed to the screen, grays it out a little, and then renders the text "Paused" in the center of the screen. The game remains paused until the user either presses the pause button again or tries to quit the game.

Note:
1) During some scenes of the game you might need the audio to be synchronized with the flow of action. If the user tries to pause the game you will want to pause the audio so the audio doesn't go out of synch with the action. In order to do this, when you begin such a scene you need to call the SetPauseVolumeAction() function of the GameSettings class with the argument SETTINGS_PAUSE_AUDIO. When you are finished with this type of scene, you must must MUST remember to set this member back to its original value.

Definition at line 55 of file pause.h.


Constructor & Destructor Documentation

hoa_pause::PauseMode::PauseMode (  ) 

Definition at line 36 of file pause.cpp.

References _saved_screen, hoa_video::GameVideo::CaptureScreen(), hoa_mode_manager::MODE_MANAGER_PAUSE_MODE, hoa_mode_manager::GameMode::mode_type, hoa_pause::PAUSE_DEBUG, and hoa_video::VideoManager.

Here is the call graph for this function:

hoa_pause::PauseMode::~PauseMode (  ) 

Definition at line 64 of file pause.cpp.

References _saved_screen, hoa_video::GameVideo::DeleteImage(), hoa_pause::PAUSE_DEBUG, and hoa_video::VideoManager.

Here is the call graph for this function:


Member Function Documentation

void hoa_pause::PauseMode::Draw (  )  [virtual]

Draws the next frame to be displayed on the screen.

Implements hoa_mode_manager::GameMode.

Definition at line 106 of file pause.cpp.

References _saved_screen, hoa_video::GameVideo::DrawImage(), hoa_video::GameVideo::DrawText(), hoa_video::GameVideo::GetHeight(), hoa_video::GameVideo::GetWidth(), hoa_video::GameVideo::Move(), hoa_video::GameVideo::SetCoordSys(), hoa_video::GameVideo::SetDrawFlags(), hoa_video::VIDEO_X_CENTER, hoa_video::VIDEO_X_LEFT, and hoa_video::VideoManager.

Here is the call graph for this function:

void hoa_pause::PauseMode::Reset (  )  [virtual]

Resets appropriate class members. Called whenever PauseMode is made the active game mode.

Implements hoa_mode_manager::GameMode.

Definition at line 88 of file pause.cpp.

References hoa_video::GameVideo::SetCoordSys(), hoa_video::GameVideo::SetDrawFlags(), hoa_video::GameVideo::SetFont(), hoa_video::VIDEO_X_LEFT, hoa_video::VIDEO_Y_BOTTOM, and hoa_video::VideoManager.

Here is the call graph for this function:

void hoa_pause::PauseMode::Update (  )  [virtual]

Updates the game state by the amount of time that has elapsed.

Implements hoa_mode_manager::GameMode.

Definition at line 98 of file pause.cpp.


Member Data Documentation

float hoa_pause::PauseMode::_saved_music_volume [private]

Retains the original volume levels when this mode is active. Volume is restored when the mode is destroyed.

Definition at line 63 of file pause.h.

hoa_video::StillImage hoa_pause::PauseMode::_saved_screen [private]

An image of the last frame shown on the screen before PauseMode was called.

Definition at line 58 of file pause.h.

Referenced by Draw(), PauseMode(), and ~PauseMode().

float hoa_pause::PauseMode::_saved_sound_volume [private]

Definition at line 64 of file pause.h.


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:15:34 2007 for Hero of Allacrost by  doxygen 1.5.1