Back to index

extremetuxracer  0.5beta
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes
Paused Class Reference

#include <paused.h>

Inheritance diagram for Paused:
Inheritance graph
[legend]
Collaboration diagram for Paused:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Paused ()
 ~Paused ()
void loop (float timeStep)
bool keyPressEvent (SDLKey key)
void resume ()
void quit ()
void configuration ()
virtual bool keyboardEvent (SDLKey key, bool release)
virtual bool keyReleaseEvent (SDLKey key)
virtual bool mouseButtonEvent (int button, int x, int y, bool pressed)
virtual bool mouseButtonPressEvent (int button, int x, int y)
virtual bool mouseButtonReleaseEvent (int button, int x, int y)

Static Public Attributes

static GameModecurrentMode = NULL
static game_mode_t mode
static game_mode_t prevmode

Protected Member Functions

void drawSnow (float timeStep, bool windy=false)
 custom function for drawing snow in the ui

Private Attributes

pp::Framemp_backgroundFrm
pp::Buttonmp_configBtn
pp::Buttonmp_resumeBtn
pp::Buttonmp_quitBtn
pp::Labelmp_pausedLbl

Detailed Description

Definition at line 29 of file paused.h.


Constructor & Destructor Documentation

Definition at line 47 of file paused.cpp.

{
       int centerX = getparam_x_resolution() / 2;
       int centerY = getparam_y_resolution() / 2;
       
       mp_backgroundFrm = new pp::Frame(pp::Vec2d(centerX-120,centerY-100),
                                                          pp::Vec2d(240,200));
       
       mp_pausedLbl = new pp::Label(pp::Vec2d(centerX,centerY+90),"paused",_("Paused"));
       mp_pausedLbl->alignment.center();
       mp_pausedLbl->alignment.top();
       

       mp_configBtn = new pp::Button(pp::Vec2d(centerX-150,centerY-15),
                                   pp::Vec2d(300, 40),
                                   "button_label",
                                   _("Configuration") );
       
    mp_configBtn->setHilitFontBinding("button_label_hilit");
       mp_configBtn->signalClicked.Connect(pp::CreateSlot(this,&Paused::configuration));
       
       mp_resumeBtn = new pp::Button(pp::Vec2d(centerX-150,centerY-55),
                                   pp::Vec2d(300, 40),
                                   "button_label",
                                   _("Resume") );
       
    mp_resumeBtn->setHilitFontBinding("button_label_hilit");
       mp_resumeBtn->signalClicked.Connect(pp::CreateSlot(this,&Paused::resume));

       mp_quitBtn = new pp::Button(pp::Vec2d(centerX-150,centerY-95),
                                   pp::Vec2d(300, 40),
                                   "button_label",
                                   _("Quit") );
       
    mp_quitBtn->setHilitFontBinding("button_label_hilit");
       mp_quitBtn->signalClicked.Connect(pp::CreateSlot(this,&Paused::quit));

if (gameMgr->gametype!=GameMgr::PRACTICING) {
std::string mus = gameMgr->currentEvent->music;
mus += "_paused";
play_music( (char *)mus.c_str() );
}
else
{
play_music("paused");
}

}

Here is the call graph for this function:

Definition at line 96 of file paused.cpp.

{
       delete mp_configBtn;
       delete mp_resumeBtn;
       delete mp_quitBtn;
       delete mp_backgroundFrm;
       delete mp_pausedLbl;
}

Member Function Documentation

Definition at line 203 of file paused.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void GameMode::drawSnow ( float  timeStep,
bool  windy = false 
) [protected, inherited]

custom function for drawing snow in the ui

Definition at line 203 of file loop.cpp.

{
       // check wether ui snow is 
       if(getparam_ui_snow()){
              // update and draw snow
              update_ui_snow( timeStep, windy );
              draw_ui_snow();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool GameMode::keyboardEvent ( SDLKey  key,
bool  release 
) [inline, virtual, inherited]

Reimplemented in Racing.

Definition at line 90 of file loop.h.

{return false;};
bool Paused::keyPressEvent ( SDLKey  key) [virtual]

Reimplemented from GameMode.

Definition at line 173 of file paused.cpp.

{
       if(key=='q') {
              Paused::quit();
        } else {
              if(Benchmark::getMode() == Benchmark::PAUSED){
                     set_game_mode( GAME_OVER );
              }else{
                     set_game_mode( RACING );
              }
       }
       winsys_post_redisplay();
       return true;
}

Here is the call graph for this function:

virtual bool GameMode::keyReleaseEvent ( SDLKey  key) [inline, virtual, inherited]

Reimplemented in HighscoreShow, and SplashScreen.

Definition at line 92 of file loop.h.

{return false;};
void Paused::loop ( float  timeStep) [virtual]

Implements GameMode.

Definition at line 106 of file paused.cpp.

{
    int width, height;
    width = getparam_x_resolution();
    height = getparam_y_resolution();

    // Check joystick 
    if ( is_joystick_active() ) {
              update_joystick();

              if ( is_joystick_continue_button_down() )
              {
                     set_game_mode( RACING );
                     winsys_post_redisplay();
                  return;
              }
    }

    fpsCounter.update();

    update_audio();

    clear_rendering_context();

    fogPlane.setup();

    update_player_pos( players[0], 0 );
    update_view( players[0], 0 );

    setup_view_frustum( players[0], NEAR_CLIP_DIST, 
                     getparam_forward_clip_distance() );

    draw_sky( players[0].view.pos );

    draw_fog_plane( );

    set_course_clipping( true );
    set_course_eye_point( players[0].view.pos );
    setup_course_lighting();
    render_course();
    //Draw snow
    if(gameMgr->getCurrentRace().snowing) {
        draw_snow(players[0].view.pos);
    }
    draw_trees();

    if ( getparam_draw_particles() ) {
              draw_particles( players[0] );
    }

    ModelHndl->draw_tux();
    draw_tux_shadow();

    set_gl_options( GUI );

    UIMgr.setupDisplay();

    HUD1.draw(players[0]);
       
       if(Benchmark::getMode()!=Benchmark::PAUSED){
       UIMgr.draw();
       }      
       reshape( width, height );
    winsys_swap_buffers();
}

Here is the call graph for this function:

virtual bool GameMode::mouseButtonEvent ( int  button,
int  x,
int  y,
bool  pressed 
) [inline, virtual, inherited]

Reimplemented in GameOver.

Definition at line 94 of file loop.h.

{return false;};
virtual bool GameMode::mouseButtonPressEvent ( int  button,
int  x,
int  y 
) [inline, virtual, inherited]

Definition at line 95 of file loop.h.

{return false;};
virtual bool GameMode::mouseButtonReleaseEvent ( int  button,
int  x,
int  y 
) [inline, virtual, inherited]

Reimplemented in CreditsTrans, and SplashScreen.

Definition at line 96 of file loop.h.

{return false;};
void Paused::quit ( )

Definition at line 196 of file paused.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Paused::resume ( )

Definition at line 189 of file paused.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

GameMode * GameMode::currentMode = NULL [static, inherited]

Definition at line 96 of file loop.h.

game_mode_t GameMode::mode [static, inherited]

Definition at line 99 of file loop.h.

Definition at line 31 of file paused.h.

Definition at line 32 of file paused.h.

Definition at line 35 of file paused.h.

Definition at line 34 of file paused.h.

Definition at line 33 of file paused.h.

game_mode_t GameMode::prevmode [static, inherited]

Definition at line 100 of file loop.h.


The documentation for this class was generated from the following files: