Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6142 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Dec 16, 2005, 7:13:57 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merge the ObjectManager to the trunk
merged with command:
svn merge -r6082:HEAD objectmanager/ ../trunk/

conflicts resolution was easy this time :)
but specially merged the world to network_world

Location:
trunk/src/lib/graphics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/graphics_engine.cc

    r6011 r6142  
    1919#include "resource_manager.h"
    2020#include "event_handler.h"
     21
     22#include "world_entity.h"
    2123
    2224#include "render_2d.h"
     
    573575}
    574576
     577void GraphicsEngine::draw(const std::list<WorldEntity*>& drawList ) const
     578{
     579  std::list<WorldEntity*>::const_iterator entity;
     580  for (entity = drawList.begin(); entity != drawList.end(); entity++)
     581    if ((*entity)->isVisible())
     582      (*entity)->draw();
     583}
     584
     585
    575586/**
    576587 * displays the Frames per second
  • trunk/src/lib/graphics/graphics_engine.h

    r5857 r6142  
    1515#include "glincl.h"
    1616
     17#include <list>
     18
    1719// Forward Declaration
    1820class Text;
    1921class IniParser;
    2022class SubString;
     23class WorldEntity;
    2124
    2225//! class to handle graphics
     
    6669    void tick(float dt);
    6770    void draw() const;
     71    void draw(const std::list<WorldEntity*>& drawList) const;
    6872    void displayFPS(bool display);
    6973
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5944 r6142  
    1818#include "element_2d.h"
    1919#include "render_2d.h"
     20
     21#include <algorithm>
    2022
    2123#include "p_node.h"
     
    8284  if (this->parent != NULL)
    8385  {
    84     this->parent->children.remove(this);
     86    this->parent->eraseChild(this);
    8587    this->parent = NULL;
    8688  }
     
    512514  {
    513515    PRINTF(5)("Element2D::addChild() - reparenting node: removing it and adding it again\n");
    514     child->parent->children.remove(child);
     516    child->parent->eraseChild(child);
    515517  }
    516518  child->parent = this;
     
    581583  if (this->parent != NULL)
    582584  {
    583     this->parent->children.remove(this);
     585    this->parent->eraseChild(this);
    584586    this->parent = NULL;
    585587  }
     
    655657  if (parentNode != NULL)
    656658    this->setParentSoft2D(parentNode, bias);
     659}
     660
     661/** @param child the child to be erased from this Nodes List */
     662void Element2D::eraseChild(Element2D* child)
     663{
     664  std::list<Element2D*>::iterator childIT = std::find(this->children.begin(), this->children.end(), child);
     665  this->children.erase(childIT);
    657666}
    658667
     
    733742    else if (unlikely(this->bindNode != NULL))
    734743    {
    735       GLdouble projectPos[3];
     744      GLdouble projectPos[3] = {0, 0, 0};
    736745      gluProject(this->bindNode->getAbsCoor().x,
    737746                 this->bindNode->getAbsCoor().y,
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5775 r6142  
    195195
    196196  private:
     197    void eraseChild(Element2D* child);
    197198    /** tells the child that the parent's Coordinate has changed */
    198199    inline void parentCoorChanged () { this->bRelCoorChanged = true; }
Note: See TracChangeset for help on using the changeset viewer.