Back to index

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

#include <configuration.h>

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

List of all members.

Public Member Functions

 Configuration ()
 ~Configuration ()
void loop (float timeStep)
void setWidgetPositions ()
bool keyPressEvent (unsigned int key)
void back ()
void graphics ()
void video ()
void audio ()
void keyboard ()
void joystick ()
virtual bool keyboardEvent (SDLKey key, bool release)
virtual bool keyPressEvent (SDLKey key)
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::Buttonmp_graphicsBtn
pp::Buttonmp_videoBtn
pp::Buttonmp_audioBtn
pp::Buttonmp_keyboardBtn
pp::Buttonmp_joystickBtn
pp::Buttonmp_backBtn
pp::Labelmp_titleLbl

Detailed Description

Definition at line 28 of file configuration.h.


Constructor & Destructor Documentation

Definition at line 29 of file configuration.cpp.

{
  play_music( "options_screen" );
       if(GameMode::prevmode==GAME_TYPE_SELECT || GameMode::prevmode == PAUSED){
              preConfigMode = GameMode::prevmode;
       }
       
       pp::Vec2d pos(0,0);
       
       mp_titleLbl = new pp::Label(pos,"heading",_("Configuration"));
       mp_titleLbl->alignment.center();
       mp_titleLbl->alignment.middle();   
       
       mp_graphicsBtn = new pp::Button(pos,
                                 pp::Vec2d(300, 40),
                                 "button_label",
                                 _("Graphics") );
    mp_graphicsBtn->setHilitFontBinding( "button_label_hilit" );
    mp_graphicsBtn->signalClicked.Connect(pp::CreateSlot(this,&Configuration::graphics));
       
       mp_videoBtn = new pp::Button(pos,
                                 pp::Vec2d(300, 40), 
                                 "button_label", 
                                 _("Video") );
    mp_videoBtn->setHilitFontBinding( "button_label_hilit" );
       mp_videoBtn->signalClicked.Connect(pp::CreateSlot(this,&Configuration::video));     

       mp_audioBtn = new pp::Button(pos,
                                 pp::Vec2d(300, 40), 
                                 "button_label", 
                                 _("Audio") );
    mp_audioBtn->setHilitFontBinding( "button_label_hilit" );
       mp_audioBtn->signalClicked.Connect(pp::CreateSlot(this,&Configuration::audio));     

       mp_keyboardBtn = new pp::Button(pos,
                                 pp::Vec2d(300, 40), 
                                 "button_label", 
                                 _("Keyboard") );
       mp_keyboardBtn->setHilitFontBinding( "button_label_hilit" );
       mp_keyboardBtn->signalClicked.Connect(pp::CreateSlot(this,&Configuration::keyboard));      

       mp_joystickBtn = new pp::Button(pos,
                                 pp::Vec2d(300, 40), 
                                 "button_label", 
                                 _("Joystick") );
       mp_joystickBtn->setHilitFontBinding( "button_label_hilit" );
       mp_joystickBtn->signalClicked.Connect(pp::CreateSlot(this,&Configuration::joystick));      


    mp_backBtn = new pp::Button(pos,
                                 pp::Vec2d(300, 40), 
                                 "button_label", 
                                 _("Back") );
    mp_backBtn->setHilitFontBinding( "button_label_hilit" );
    mp_backBtn->signalClicked.Connect(pp::CreateSlot(this,&Configuration::back));          
}

Here is the call graph for this function:

Definition at line 86 of file configuration.cpp.

{
       delete mp_graphicsBtn;
       delete mp_videoBtn;
       delete mp_audioBtn;
       delete mp_keyboardBtn;
       delete mp_joystickBtn;
       delete mp_backBtn;
       delete mp_titleLbl;
}

Member Function Documentation

Definition at line 172 of file configuration.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file configuration.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:

Definition at line 158 of file configuration.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 186 of file configuration.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 179 of file configuration.cpp.

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 Configuration::keyPressEvent ( unsigned int  key)

Definition at line 138 of file configuration.cpp.

{
       switch (key){
              case 27:
              case 'q':
                     back();
              return true;
       }      
       return false;
}

Here is the call graph for this function:

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

Reimplemented in EventSelect, EventRaceSelect, RaceSelect, GameOver, CreditsTrans, ConfigMode, Racing, GameTypeSelect, Paused, Credits, and Intro.

Definition at line 91 of file loop.h.

{return false;};
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 Configuration::loop ( float  timeStep) [virtual]

Implements GameMode.

Definition at line 98 of file configuration.cpp.

{
       update_audio();
    set_gl_options( GUI );
    clear_rendering_context();
    UIMgr.setupDisplay();
       drawSnow(timeStep);
       theme.drawMenuDecorations();
       setWidgetPositions();
    UIMgr.draw();
    reshape( getparam_x_resolution(), getparam_y_resolution() );
    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;};

Definition at line 113 of file configuration.cpp.

{
       int w = getparam_x_resolution();
    int h = getparam_y_resolution();
       
       pp::Vec2d pos(w/2,h/2+100);

       mp_titleLbl->setPosition(pos);
       
       pos.x-=150;
       pos.y-=80;
       mp_graphicsBtn->setPosition(pos);
       pos.y-=40;
       mp_videoBtn->setPosition(pos);
       pos.y-=40;
       mp_audioBtn->setPosition(pos);
       pos.y-=40;
       mp_keyboardBtn->setPosition(pos);
       pos.y-=40;
       mp_joystickBtn->setPosition(pos);
       pos.y-=60;
       mp_backBtn->setPosition(pos);      
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 165 of file configuration.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 32 of file configuration.h.

Definition at line 36 of file configuration.h.

Definition at line 30 of file configuration.h.

Definition at line 34 of file configuration.h.

Definition at line 33 of file configuration.h.

Definition at line 37 of file configuration.h.

Definition at line 31 of file configuration.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: