Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2386 for code/branches/overlay


Ignore:
Timestamp:
Dec 10, 2008, 4:23:21 PM (16 years ago)
Author:
bhildebr
Message:

CreateLines and Scoreboard are now running without segfaults

Location:
code/branches/overlay/src/orxonox/overlays/stats
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/overlay/src/orxonox/overlays/stats/CreateLines.cc

    r2320 r2386  
    6767        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
    6868
     69        unsigned int colIndex = 0;
     70
    6971        while (textColumns_.size() < numberOfColumns) {
    7072
    71             Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex)));
     73            Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex) + convertToString(colIndex)));
    7274            textColumns_.push_back(tempTextArea);
    7375            this->background_->addChild(tempTextArea);
     76
     77            colIndex++;
    7478
    7579        }
  • code/branches/overlay/src/orxonox/overlays/stats/Scoreboard.cc

    r2320 r2386  
    5252    {
    5353        RegisterObject(Scoreboard);
     54
     55        createlines_ = new CreateLines(this);
     56        // this->gametype_ = new Gametype(this);
     57    }
     58
     59    /**
     60        @brief Initializes the lines.
     61    */
     62    void Scoreboard::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     63    {
     64        SUPER(Scoreboard, XMLPort, xmlElement, mode);
     65
     66        printLines();
     67
     68        COUT(0) << "XMLPort executed." << std::endl;
     69
    5470    }
    5571
     
    6076
    6177        numberOfColumns = 2;
    62         numberOfLines = this->gametype_->getNumberOfPlayers();
    63         columnIndex = 0;
    64         topOffset = 0.3;
     78        // numberOfLines = this->gametype_->getNumberOfPlayers();
     79        numberOfLines = 3;
     80        topOffset = 0.1;
    6581        lineSpacing = 0.1;
    6682
    6783        for (unsigned int i = 0; i < numberOfLines; i++) {
    6884
    69             leftOffset = 0.3;
     85            columnIndex = 0;
     86            leftOffset = 0.1;
    7087
    7188            this->createlines_->setNumberOfColumns(numberOfColumns, i);
    7289
    73             columnText = this->gametype_->getPlayersName();
     90            // columnText = this->gametype_->getPlayersName();
     91            columnText = "PlayerName";
    7492            this->createlines_->alignColumn(columnIndex, topOffset, leftOffset);
    7593            this->createlines_->setColumnText(columnIndex, columnText);
    7694
    7795            columnIndex++;
    78             leftOffset = leftOffset + 0.4;
     96            leftOffset = leftOffset + 0.3;
    7997
    80             columnText = this->gametype_->getPlayersFrags();
     98            // columnText = this->gametype_->getPlayersFrags();
     99            columnText = "PlayerFrags";
    81100            this->createlines_->alignColumn(columnIndex, topOffset, leftOffset);
    82101            this->createlines_->setColumnText(columnIndex, columnText);
  • code/branches/overlay/src/orxonox/overlays/stats/Scoreboard.h

    r2320 r2386  
    4747        ~Scoreboard() {}
    4848
     49        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     50
    4951        inline void setGametype(Gametype* gt)
    5052            { this->gametype_ = gt; }
  • code/branches/overlay/src/orxonox/overlays/stats/Stats.cc

    r2200 r2386  
    101101    }
    102102
    103     /**
    104         @brief Used to control the actual scrolling and the cursor.
    105     */
    106 
    107103    void Stats::tick(float dt)
    108104    {
Note: See TracChangeset for help on using the changeset viewer.