Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r4453 r4597  
    11
    22
    3 /* 
     3/*
    44   orxonox - the future of 3D-vertical-scrollers
    55
     
    1313   ### File Specific:
    1414   main-programmer: Patrick Boenzli
    15    co-programmer: 
     15   co-programmer:
    1616*/
    1717
     
    2828using namespace std;
    2929/**
    30    \brief standard constructor
    31 */
    32 GLMenuImageScreen::GLMenuImageScreen ()
    33 {
    34    this->init();
    35 }
    36 
    37 /**
    3830   \param root The Element to load the GLMenu from
    3931*/
    4032GLMenuImageScreen::GLMenuImageScreen(const TiXmlElement* root)
    4133{
    42   this->init();
    43   this->loadParams(root);
    44 }
    45 
    46 /**
    47    \brief Loads a GLMenu from an inputElement
    48    \param root The Element to load the GLMenu from
    49 */
    50 void GLMenuImageScreen::loadParams(const TiXmlElement* root)
    51 {
    52   LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage)
    53     .describe("sets the image to load onto the loadscreen");
    54 
    55   LoadParam<GLMenuImageScreen>(root, "BackgroundPS", this, &GLMenuImageScreen::setPosScale)
    56     .describe("The Position and Scale of the Background Image in %(0-1.0). PosX, PosY, SizeX, SizeY");
    57 
    58   LoadParam<GLMenuImageScreen>(root, "BarImage", this, &GLMenuImageScreen::setBarImage)
    59     .describe("sets the image of the LoadingBar");
    60  
    61   LoadParam<GLMenuImageScreen>(root, "BarPS", this, &GLMenuImageScreen::setBarPosScale)
    62     .describe("The Position and Scale of the Loading Bar in %(0-1.0). PosX, PosY, SizeX, SizeY");
    63 
    64   LoadParam<GLMenuImageScreen>(root, "ElementCount", this, &GLMenuImageScreen::setMaximum)
    65     .describe("The Count of elements to load into the bar (this is only a maximum value)");
    66 }
    67 
    68 /**
    69    \brief standard deconstructor
    70    \todo this deconstructor is not jet implemented - do it
    71 */
    72 GLMenuImageScreen::~GLMenuImageScreen()
    73 {
    74   delete this->backMat;
    75   delete this->barMat;
    76 }
    77 
    78 /**
    79    \brief function to init the screen
    80 */
    81 void GLMenuImageScreen::init ()
    82 {
    8334  this->setClassID(CL_GLMENU_IMAGE_SCREEN, "GLMenuImageScreen");
    84 
     35  this->setName("GLMenuLoadScreen");
    8536  // Select Our VU Meter Background Texture
    8637  this->backMat = new Material("load_screen");
     
    9243  this->setBarPosScale( .6, .75, .3, .1);
    9344  // End of Background image code.
    94 }
    95 
    96 /**
     45
     46  if (root)
     47    this->loadParams(root);
     48}
     49
     50/**
     51   \brief Loads a GLMenu from an inputElement
     52   \param root The Element to load the GLMenu from
     53*/
     54void GLMenuImageScreen::loadParams(const TiXmlElement* root)
     55{
     56  LoadParam<GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage)
     57    .describe("sets the image to load onto the loadscreen");
     58
     59  LoadParam<GLMenuImageScreen>(root, "BackgroundPS", this, &GLMenuImageScreen::setPosScale)
     60    .describe("The Position and Scale of the Background Image in %(0-1.0). PosX, PosY, SizeX, SizeY");
     61
     62  LoadParam<GLMenuImageScreen>(root, "BarImage", this, &GLMenuImageScreen::setBarImage)
     63    .describe("sets the image of the LoadingBar");
     64
     65  LoadParam<GLMenuImageScreen>(root, "BarPS", this, &GLMenuImageScreen::setBarPosScale)
     66    .describe("The Position and Scale of the Loading Bar in %(0-1.0). PosX, PosY, SizeX, SizeY");
     67
     68  LoadParam<GLMenuImageScreen>(root, "ElementCount", this, &GLMenuImageScreen::setMaximum)
     69    .describe("The Count of elements to load into the bar (this is only a maximum value)");
     70}
     71
     72/**
     73   \brief standard deconstructor
     74   \todo this deconstructor is not jet implemented - do it
     75*/
     76GLMenuImageScreen::~GLMenuImageScreen()
     77{
     78  delete this->backMat;
     79  delete this->barMat;
     80}
     81
     82/**
    9783    \brief sets the background image name
    9884    \param backImageName name of the backgroun-image
     
    191177
    192178
    193 /** 
     179/**
    194180    \brief call this to trigger a progress event
    195    
     181
    196182    this has to redraw the progress bar and the whole image
    197183 */
     
    211197  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    212198
    213   PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 
    214             this->currentValue, this->maxValue);
     199  PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",
     200            this->currentValue, this->maxValue);
    215201
    216202  /* screen size */
    217203  int screenWidth = GraphicsEngine::getInstance()->getResolutionX();
    218204  int screenHeight = GraphicsEngine::getInstance()->getResolutionY();
    219  
     205
    220206  int imageWidth = (int)(screenWidth * this->scaleX);
    221207  int imageHeight = (int)(screenHeight * this->scaleY);
     
    229215  int barW = (int)(this->barW *screenWidth);
    230216  int barH = (int)(this->barH *screenHeight);
    231  
     217
    232218  float val = (float)this->currentValue/(float)this->maxValue;
    233                  
     219
    234220  if( val > barW)
    235221    val = barW;
     
    245231  glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);
    246232  glEnd();
    247  
     233
    248234  glDisable(GL_TEXTURE_2D);
    249235  /* draw white border */
     
    256242  glColor3f(1.0, 1.0, 1.0);
    257243  glEnd();
    258  
     244
    259245  /* draw the progress bar */
    260246  barMat->select();
     
    275261    glColor3f(1.0, 1.0, 1.0);
    276262    glEnd();
    277    
    278     /* draw black border 
     263
     264    /* draw black border
    279265    glBegin(GL_QUADS);
    280266    glColor3f(0.0, 0.0, 0.0);
     
    285271    glColor3f(1.0, 1.0, 1.0);
    286272    glEnd();
    287    
     273
    288274  */
    289275
    290276  GraphicsEngine::leave2DMode();
    291277
    292   SDL_GL_SwapBuffers();             
    293 }
    294  
    295 
     278  SDL_GL_SwapBuffers();
     279}
     280
     281
Note: See TracChangeset for help on using the changeset viewer.