Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10368 in orxonox.OLD for trunk/src/lib/gui


Ignore:
Timestamp:
Jan 25, 2007, 2:18:07 PM (17 years ago)
Author:
patrick
Message:

merged the branche playability into the trunk

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1010autom4te.cache
        1111aclocal.m4
         12tags
         13test.bmp
         14config.sub
         15config.guess
         16OrxonoxPlayability.kdevses
         17OrxonoxPlayability.kdevelop.pcs
  • trunk/src/lib/gui/gl/glgui_bar.cc

    r9869 r10368  
    7171
    7272    this->_value = value;
    73     this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
     73    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum)
    7474        ,this->getSizeY2D() - borderTop() - borderBottom());
    7575  }
     
    9999
    100100    this->_frontRect.setTopLeft(borderLeft(), borderTop());
    101     this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
    102                              ,this->getSizeY2D() - borderTop() - borderBottom());
     101    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum)
     102        ,this->getSizeY2D() - borderTop() - borderBottom());
    103103
    104104  }
  • trunk/src/lib/gui/gl/glgui_box.cc

    r9869 r10368  
    1818#include "glgui_box.h"
    1919#include <cassert>
     20#include <iostream>
    2021#include "debug.h"
     22#include "network_log.h"
     23
    2124
    2225namespace OrxGui
     
    177180  void GLGuiBox::resize()
    178181  {
    179     if (orientation() == OrxGui::Vertical)
     182    if (this->orientation() == OrxGui::Vertical)
    180183    {
    181184      float height = borderTop();
     
    186189      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    187190      {
    188         (*widget)->setRelCoor2D(borderLeft(), height);
    189         height += (*widget)->getSizeY2D();
    190         width = fmax(width, (*widget)->getSizeX2D());
     191        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
     192        //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
     193        //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
     194        float realSizeX, realSizeY;
     195        int angleAbs = (int)(*widget)->getAbsDir2D();
     196        int angleRel = (int)(*widget)->getRelDir2D();
     197        //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n';
     198        if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180)
     199        {
     200          realSizeX = (*widget)->getSizeX2D();
     201          realSizeY = (*widget)->getSizeY2D();
     202          //std::cout<<"box vertical, widget 0or180";
     203        }
     204        else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270)
     205        {
     206          realSizeX = (*widget)->getSizeY2D();
     207          realSizeY = (*widget)->getSizeX2D();
     208          //std::cout<<"box vertical, widget 90or270";
     209        }
     210
     211        (*widget)->setRelCoor2D(borderLeft(), height + borderTop());
     212        height += realSizeY;
     213        width = fmax(width, realSizeX);
    191214      }
    192215
     
    205228      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    206229      {
     230        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
     231        //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n';
     232        //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
     233        //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
     234        float realSizeX, realSizeY;
     235        int angleAbs = (int)(*widget)->getAbsDir2D();
     236        int angleRel = (int)(*widget)->getRelDir2D();
     237        //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n';
     238        if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180)
     239        {
     240          realSizeX = (*widget)->getSizeX2D();
     241          realSizeY = (*widget)->getSizeY2D();
     242          //std::cout<<"box horicontal, widget 0or180";
     243        }
     244        else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270)
     245        {
     246          realSizeX = (*widget)->getSizeY2D();
     247          realSizeY = (*widget)->getSizeX2D();
     248          //std::cout<<"box horicontal, widget 90or270";
     249        }
     250
    207251        (*widget)->setRelCoor2D(width, borderTop());
    208         height = fmax(height, (*widget)->getSizeY2D());
    209         width += (*widget)->getSizeX2D();
     252        height = fmax(height, realSizeY);
     253        width += realSizeX;
    210254      }
    211255
  • trunk/src/lib/gui/gl/glgui_widget.cc

    r10317 r10368  
    915915  }
    916916
     917  void GLGuiWidget::beginDraw() const
     918  {
     919    glPushMatrix();
     920    glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
     921    glRotatef(this->getAbsDir2D(), 0, 0, 1);
     922  }
     923
    917924
    918925}
  • trunk/src/lib/gui/gl/glgui_widget.h

    r9869 r10368  
    244244
    245245    /// RENDERING
    246     inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
     246    void beginDraw() const;
    247247    inline void endDraw() const { glPopMatrix(); };
    248248
Note: See TracChangeset for help on using the changeset viewer.