Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3746 in orxonox.OLD for orxonox/branches/levelloader/src/glmenu


Ignore:
Timestamp:
Apr 7, 2005, 3:54:49 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Merged trunk into branch… still not working though…

Location:
orxonox/branches/levelloader/src/glmenu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.cc

    r3605 r3746  
    4141{
    4242   this->setClassName ("GLMenuImageScreen");
     43   this->init();
    4344}
    4445
     
    5051GLMenuImageScreen::~GLMenuImageScreen()
    5152{
    52   if (backMat)
    53     delete backMat;
     53  if (this->backMat)
     54    delete this->backMat;
    5455}
    5556
     
    8182  // Select Our VU Meter Background Texture
    8283  this->backMat = new Material("load_screen");
    83   this->backMat->setDiffuseMap("../data/pictures/load_screen.jpg");
     84  this->backMat->setDiffuseMap("pictures/load_screen.jpg");
    8485  this->maxValue = 10;
    8586  this->currentValue = 0;
     
    110111void GLMenuImageScreen::draw ()
    111112{
    112   /*
    113   // Display a quad texture to the screen
    114   glEnable(GL_TEXTURE_2D);
    115   glBegin(GL_QUADS);
    116  
    117   // Display the top left vertice
    118   glTexCoord2f(0.0f, 1.0f);
    119   glVertex3f(-2.5, 2.5, 0);
    120  
    121   // Display the bottom left vertice
    122   glTexCoord2f(0.0f, 0.0f);
    123   glVertex3f(-2.5, -2.5, 0);
    124  
    125   // Display the bottom right vertice
    126   glTexCoord2f(1.0f, 0.0f);
    127   glVertex3f(2.5, -2.5, 0);
    128  
    129   // Display the top right vertice
    130   glTexCoord2f(1.0f, 1.0f);
    131   glVertex3f(2.5, 2.5, 0);
    132 
    133   glEnd();
    134   glEnable(GL_TEXTURE_2D); 
    135   */
    136113
    137114  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
     115
     116  PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",
     117         this->currentValue, this->maxValue);
    138118
    139119  /* screen size */
     
    154134  int barWidth = 230;
    155135  int barHeight = 30;
    156 
    157   int val = (int)((float)this->currentValue/(float)this->maxValue) * barWidth;
     136 
     137  float val = ((float)this->currentValue/(float)this->maxValue) * barWidth;
     138  if( val > (float)barWidth)
     139    val = (float)barWidth;
    158140
    159141  glMatrixMode(GL_PROJECTION);
     
    170152  glDisable(GL_LIGHTING);
    171153
     154  /* draw the progress bar */
    172155  glBegin(GL_QUADS);
    173156  glColor3f(0.96, 0.84, 0.34);
    174157  glVertex2i(barX, barY);
    175   glVertex2i(barX + val, barY);
    176   glVertex2i(barX + val, barY + barHeight);
     158  glVertex2i(barX + (int)val, barY);
     159  glVertex2i(barX + (int)val, barY + barHeight);
    177160  glVertex2i(barX, barY + barHeight);
    178161  glColor3f(1.0, 1.0, 1.0);
     
    223206  glPopAttrib();
    224207
    225   SDL_GL_SwapBuffers();                   
     208  SDL_GL_SwapBuffers();             
    226209}
    227210 
  • orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.h

    r3605 r3746  
    4545  float offsetX, offsetY;    //!< offset of the image from left and up
    4646  Material* backMat;         //!< Background Material.
     47
     48  /* progress bar values */
    4749  int currentValue;          //!< the current count of step() calls fired yet
    4850  int maxValue;              //!< total count of steps
Note: See TracChangeset for help on using the changeset viewer.