Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10194 in orxonox.OLD for branches/playability/src/lib/gui/gl


Ignore:
Timestamp:
Jan 8, 2007, 9:19:39 PM (18 years ago)
Author:
muellmic
Message:

implementing interface 'by hand' without still buggy packing-function. can't test with spaceship because of segfault

File:
1 edited

Legend:

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

    r10139 r10194  
    2222#include "network_log.h"
    2323
     24
    2425namespace OrxGui
    2526{
     
    188189      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    189190      {
    190         float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
    191         float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
    192         float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
     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        }
    193210
    194211        (*widget)->setRelCoor2D(borderLeft(), height + borderTop());
     
    211228      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    212229      {
    213         float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
     230        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
    214231        //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n';
    215         float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
    216         float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
     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        }
    217250
    218251        (*widget)->setRelCoor2D(width, borderTop());
Note: See TracChangeset for help on using the changeset viewer.