Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8378 in orxonox.OLD


Ignore:
Timestamp:
Jun 14, 2006, 12:31:32 PM (18 years ago)
Author:
bensch
Message:

gui: step 1: remove frontMat

Location:
branches/gui/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_bar.cc

    r8145 r8378  
    4646    this->setClassID(CL_GLGUI_BAR, "GLGuiBar");
    4747
    48     this->frontMaterial().setDiffuse(1,1,1);
     48    this->frontColor().setColor(1,1,1);
    4949
    5050    this->setSize2D(50, 10);
     
    6464    GLGuiWidget::draw();
    6565
    66     this->frontMaterial().select();
     66    //this->frontMaterial().select();
    6767    glBegin(GL_QUADS);
    6868
  • branches/gui/src/lib/gui/gl/glgui_button.cc

    r8145 r8378  
    5555
    5656    this->_label.setFont("fonts/final_frontier.ttf", 20);
    57     this->frontMaterial().setDiffuse(1, 0, 0);
     57    this->frontColor().setColor(1, 0, 0, 1.0);
    5858
    5959    this->_label.setParent2D(this);
  • branches/gui/src/lib/gui/gl/glgui_checkbutton.cc

    r8145 r8378  
    6868    this->setSize2D(this->labelText().getSizeX2D() + 30 + borderLeft() + borderRight(), this->labelText().getSizeY2D() + 10 + borderTop()+borderBottom());
    6969    GLGuiWidget::resize();
    70     this->frontRect().setTopLeft(borderLeft(), borderTop());
    71     this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()) , this->getSizeY2D() - (borderTop() + borderBottom()));
     70/*    this->frontRect().setTopLeft(borderLeft(), borderTop());
     71    this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()) , this->getSizeY2D() - (borderTop() + borderBottom()));*/
    7272  }
    7373
     
    8989    GLGuiButton::draw();
    9090
    91     this->frontMaterial().select();
    92     this->drawRect(this->frontRect());
     91//     this->frontMaterial().select();
     92//     this->drawRect(this->frontRect());
    9393
    9494    if (this->bActive)
  • branches/gui/src/lib/gui/gl/glgui_image.cc

    r8145 r8378  
    4545    this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage");
    4646
    47     this->frontMaterial().setDiffuseMap(this->texture);
    48     this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     47//     this->frontMaterial().setDiffuseMap(this->texture);
     48//     this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    4949
    5050    this->resize();
     
    5454  void GLGuiImage::loadImageFromTexture(const Texture& texture)
    5555  {
    56     this->frontMaterial().setDiffuseMap(texture);
    57     this->frontMaterial().setDiffuse(1,1,1);
     56/*    this->frontMaterial().setDiffuseMap(texture);
     57    this->frontMaterial().setDiffuse(1,1,1);*/
    5858  }
    5959
     
    7575  void GLGuiImage::resize()
    7676  {
    77     this->frontRect().setTopLeft(this->borderLeft(), this->borderTop());
    78     this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );
     77/*    this->frontRect().setTopLeft(this->borderLeft(), this->borderTop());
     78    this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );*/
    7979    GLGuiWidget::resize();
    8080  }
     
    8989    GLGuiWidget::draw();
    9090
    91     this->frontMaterial().select();
    92     this->drawRect(this->frontRect());
     91/*    this->frontMaterial().select();*/
     92/*    this->drawRect(this->frontRect());*/
    9393    this->endDraw();
    9494  }
  • branches/gui/src/lib/gui/gl/glgui_inputline.cc

    r8145 r8378  
    167167    this->setSize2D( this->text.getSize2D() + Vector2D(borderLeft() + borderRight() + 4.0, borderTop() + borderBottom() + 4.0));
    168168    GLGuiWidget::resize();
    169     this->frontRect().setTopLeft(borderLeft(), borderTop());
    170     this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));
     169/*    this->frontRect().setTopLeft(borderLeft(), borderTop());
     170    this->frontRect().setSize(this->getSize2D() - Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));*/
    171171  }
    172172
     
    218218    GLGuiWidget::draw();
    219219
    220     this->frontMaterial().select();
    221     GLGuiWidget::drawRect(this->frontRect());
     220//     this->frontMaterial().select();
     221//     GLGuiWidget::drawRect(this->frontRect());
    222222
    223223    this->endDraw();
  • branches/gui/src/lib/gui/gl/glgui_pushbutton.cc

    r8145 r8378  
    4949
    5050    GLGuiWidget::resize();
    51     this->frontRect().setTopLeft(borderLeft(), borderTop());
    52     this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()));
     51/*    this->frontRect().setTopLeft(borderLeft(), borderTop());
     52    this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()));*/
    5353  }
    5454
     
    9797    GLGuiButton::draw();
    9898
    99     this->frontMaterial().select();
    100     this->drawRect(this->frontRect());
    10199    this->endDraw();
    102100    //   this->label->draw();
  • branches/gui/src/lib/gui/gl/glgui_slider.cc

    r8335 r8378  
    161161  {
    162162    GLGuiWidget::resize();
    163     this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);
    164     this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);
     163/*    this->frontRect().setTopLeft(this->borderLeft(), this->getSizeY2D()/2.0 - 2.0);
     164    this->frontRect().setSize(this->getSizeX2D() - borderLeft() - borderRight(), 4.0);*/
    165165  }
    166166
     
    228228    GLGuiWidget::draw();
    229229
    230     this->frontMaterial().select();
    231     this->drawRect(this->frontRect());
     230    //this->frontMaterial().select();
     231//     this->drawRect(this->frontRect());
    232232
    233233    this->drawRect(Rect2D(this->sliderPosition()-_sliderWidth/2.0, 0*this->borderTop(), _sliderWidth, this->getSizeY2D() - (borderTop() + borderBottom()) ));
  • branches/gui/src/lib/gui/gl/glgui_textfield.cc

    r8145 r8378  
    5353    GLGuiWidget::draw();
    5454
    55     this->frontMaterial().select();
    56     this->drawRect(this->frontRect());
     55/*    this->frontMaterial().select();
     56    this->drawRect(this->frontRect());*/
    5757    this->endDraw();
    5858  }
  • branches/gui/src/lib/gui/gl/glgui_widget.cc

    r8335 r8378  
    6767
    6868    this->_backMat.setDiffuse(1.0, 1.0, 1.0);
    69     this->_frontMat.setDiffuse(1.0, 0.0, 0.0);
     69    this->_frontColor.setColor(1.0, 0.0, 0.0);
    7070
    7171    this->_borderLeft = 1.0;
     
    176176  void GLGuiWidget::clicking(const Vector2D& pos)
    177177  {
    178     this->frontMaterial().setDiffuse(0, 0, 1);
     178    this->frontColor().setColor(0, 0, 1);
    179179
    180180  }
     
    182182  void GLGuiWidget::releasing(const Vector2D& pos)
    183183  {
    184     this->frontMaterial().setDiffuse(0,1,0);
     184    this->frontColor().setColor(0,1,0);
    185185
    186186  }
     
    188188  void GLGuiWidget::receivedFocus()
    189189  {
    190     this->frontMaterial().setDiffuse(0, 1, 0);
     190    this->frontColor().setColor(0, 1, 0);
    191191  }
    192192
    193193  void GLGuiWidget::removedFocus()
    194194  {
    195     this->frontMaterial().setDiffuse(1, 0, 0);
     195    this->frontColor().setColor(1, 0, 0);
    196196
    197197  }
  • branches/gui/src/lib/gui/gl/glgui_widget.h

    r8312 r8378  
    9292    const Rect2D& backRect() const { return this->_backRect; };
    9393
    94     Material& frontMaterial() { return this->_frontMat; };
    95     const Material& frontMaterial() const { return this->_frontMat; };
    96     Rect2D& frontRect() { return this->_frontRect; };
    97     const Rect2D& frontRect() const { return this->_frontRect; };
     94    Color& frontColor() { return this->_frontColor; };
     95    const Color& frontColor() const { return this->_frontColor; };
    9896
    9997    /** @brief sets all borders to the same value. */
     
    162160    Rect2D                         _backRect;
    163161
    164     Material                       _frontMat;
    165     Rect2D                         _frontRect;
     162    Color                          _frontColor;
    166163
    167164    float                          _borderLeft;
  • branches/gui/src/lib/util/color.h

    r8376 r8378  
    1616{
    1717public:
    18   Color(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 0.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; };
     18  Color(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; };
    1919  Color(const Color& c) { _rgba[0] = c.r(); _rgba[1] = c.g(); _rgba[2] = c.b(); _rgba[3] = c.a(); }
    2020
    21   float& operator[](unsigned int i) { return _rgba[i]; }
    22   const float& operator[](unsigned int i) const { return _rgba[i]; }
     21  inline float& operator[](unsigned int i) { return _rgba[i]; }
     22  inline const float& operator[](unsigned int i) const { return _rgba[i]; }
    2323
    24   float r() const { return _rgba[0]; }
    25   float& r() { return _rgba[0]; }
    26   float g() const { return _rgba[1]; }
    27   float& g() { return _rgba[1]; }
    28   float b() const { return _rgba[2]; }
    29   float& b() { return _rgba[2]; }
    30   float a() const { return _rgba[3]; }
    31   float& a() { return _rgba[3]; }
     24  inline float r() const { return _rgba[0]; }
     25  inline float& r() { return _rgba[0]; }
     26  inline float g() const { return _rgba[1]; }
     27  inline float& g() { return _rgba[1]; }
     28  inline float b() const { return _rgba[2]; }
     29  inline float& b() { return _rgba[2]; }
     30  inline float a() const { return _rgba[3]; }
     31  inline float& a() { return _rgba[3]; }
     32
     33  void setColor(float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f) { _rgba[0] = r; _rgba[1] = g; _rgba[2] = b; _rgba[3] = a; };
    3234
    3335
  • branches/gui/src/util/hud.cc

    r8145 r8378  
    7676    this->energyWidget->backMaterial().setDiffuseMap("hud_energy_background.png");
    7777    this->energyWidget->backMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    78     this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
    79     this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     78/*    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
     79    this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
    8080  }
    8181
     
    132132      weapon->getEnergyWidget()->backMaterial().setDiffuse( .8,.2,.11);
    133133      weapon->getEnergyWidget()->backMaterial().setTransparency(.1);
    134       weapon->getEnergyWidget()->frontMaterial().setDiffuse( .2,.5,.7);
    135       weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
     134      weapon->getEnergyWidget()->frontColor().setColor( .2,.5,.7,.6);
     135//      weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
    136136      this->weaponsWidgets.push_back(weapon->getEnergyWidget());
    137137    }
Note: See TracChangeset for help on using the changeset viewer.