Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3368 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jan 7, 2005, 2:44:22 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: finished implementing loadscreen. looks quite fancy… enjoy :))

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r3367 r3368  
    8181  this->backTex = new Texture();
    8282  this->backTex->loadImage("load_screen.jpg");
     83
     84  this->maxValue = 10;
     85  this->currentValue = 0;
    8386
    8487  // End of Background image code.
     
    147150 
    148151  /* loadbar pos */
    149   int barX = 400;
     152  int barX = 390;
    150153  int barY = 50;
    151154  int barWidth = 230;
    152155  int barHeight = 30;
     156
     157  int val = ((float)this->currentValue/(float)this->maxValue) * barWidth;
    153158
    154159  glMatrixMode(GL_PROJECTION);
     
    168173  glColor3f(0.96, 0.84, 0.34);
    169174  glVertex2i(barX, barY);
     175  glVertex2i(barX + val, barY);
     176  glVertex2i(barX + val, barY + barHeight);
     177  glVertex2i(barX, barY + barHeight);
     178  glColor3f(1.0, 1.0, 1.0);
     179  glEnd();
     180
     181  glBegin(GL_QUADS);
     182  glColor3f(0.0, 0.0, 0.0);
     183  glVertex2i(barX, barY);
    170184  glVertex2i(barX + barWidth, barY);
    171185  glVertex2i(barX + barWidth, barY + barHeight);
    172186  glVertex2i(barX, barY + barHeight);
     187  glColor3f(1.0, 1.0, 1.0);
     188  glEnd();
     189
     190  /* draw black border */
     191  glBegin(GL_QUADS);
     192  glColor3f(0.0, 0.0, 0.0);
     193  glVertex2i(barX-1, barY-1);
     194  glVertex2i(barX + barWidth +1, barY-1);
     195  glVertex2i(barX + barWidth+1, barY + barHeight+1);
     196  glVertex2i(barX - 1, barY + barHeight +1);
     197  glColor3f(1.0, 1.0, 1.0);
     198  glEnd();
     199
     200  /* draw white border */
     201  glBegin(GL_QUADS);
     202  glColor3f(1.0, 1.0, 1.0);
     203  glVertex2i(barX-2, barY-2);
     204  glVertex2i(barX + barWidth +2, barY-2);
     205  glVertex2i(barX + barWidth+2, barY + barHeight+2);
     206  glVertex2i(barX - 2, barY + barHeight +2);
    173207  glColor3f(1.0, 1.0, 1.0);
    174208  glEnd();
     
    190224
    191225  SDL_GL_SwapBuffers();                   
    192   SDL_Delay(5000);
    193226}
    194227 
     
    224257   \param maximum of steps
    225258*/
    226 void GLMenuImageScreen::setMaximum(int maxStep)
    227 {
    228   this->maxStep = maxStep;
     259void GLMenuImageScreen::setMaximum(int maxValue)
     260{
     261  this->maxValue = maxValue;
    229262}
    230263
     
    235268int GLMenuImageScreen::getMaximum()
    236269{
    237   return this->maxStep;
     270  return this->maxValue;
    238271}
    239272
     
    267300{
    268301  this->currentValue++;
    269 }
     302  this->draw();
     303}
  • orxonox/trunk/src/glmenu_imagescreen.h

    r3367 r3368  
    3232  void setSize (float height, float width);
    3333 
    34   void setMaximum (int maxStep);
     34  void setMaximum (int maxValue);
    3535  int getMaximum ();
    3636  void setValue (int currentValue);
     
    4444  Texture* backTex;          //! background texture
    4545  int currentValue;          //! the current count of step() calls fired yet
    46   int maxStep;               //! total count of steps
     46  int maxValue;               //! total count of steps
    4747
    4848};
  • orxonox/trunk/src/world.cc

    r3365 r3368  
    148148 
    149149  //GLMenuImageScreen*
    150   glmis = new GLMenuImageScreen();
    151   glmis->init();
    152   glmis->draw();
     150  this->glmis = new GLMenuImageScreen();
     151  this->glmis->init();
     152  this->glmis->setMaximum(10);
     153  this->glmis->draw();
    153154 
    154155  printf ("World::displayLoadScreen - end\n");
     
    159160{
    160161  printf ("World::releaseLoadScreen - start\n");
    161 
     162  this->glmis->setValue(this->glmis->getMaximum());
     163  SDL_Delay(2000);
    162164  printf ("World::releaseLoadScreen - end\n");
    163165}
     
    226228      trackManager->join(4, fork21, fork22, fork13, fork14);
    227229
     230      /*monitor progress*/
     231      this->glmis->step();
     232
    228233      /*
    229234      tmpCurve->addNode(Vector(10,0,-10));
     
    272277            myPlayer->setName ("player");
    273278            this->spawn (myPlayer);
    274             this->localPlayer = myPlayer;           
     279            this->localPlayer = myPlayer;
     280
     281            /*monitor progress*/
     282            this->glmis->step();           
    275283
    276284            // bind input
     
    283291            this->getCamera()->bind (myPlayer);
    284292            this->localPlayer->addChild (this->localCamera);
    285            
     293
     294            /*monitor progress*/
     295            this->glmis->step();
    286296
    287297            Vector* es = new Vector (50, 2, 0);
     
    290300            env->setName ("env");
    291301            this->spawn(env, es, qs);
    292 
     302           
     303            /*monitor progress*/
     304            this->glmis->step();
    293305
    294306            break;
Note: See TracChangeset for help on using the changeset viewer.