Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2006, 10:38:51 PM (18 years ago)
Author:
bensch
Message:

trunk: Elements that are supposed to be on the Background stay there:

Changed:
Element2D: render from - to - LAYERS
Render2D: Renders from - to - LAYERS
GraphicsEngine: new function drawBackgroundElements
ObjectManager: new List OM_BACKGROUND
Skybox/sphere: in OM_LIST OM_BACKGROUND

@patrick: do you like it too ??

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r7727 r7840  
    3232SHELL_COMMAND(debug, Element2D, debug2DSC);
    3333
    34 using namespace std;
    3534
    3635/**
     
    199198
    200199/**
    201  * moves a Element to another layer
     200 * @brief moves a Element to another layer
    202201 * @param layer the Layer this is drawn on
    203202 */
     
    254253
    255254/**
    256  * sets the relative coordinate of the Element2D to its parent
     255 * @brief sets the relative coordinate of the Element2D to its parent
    257256 * @param relCoord the relative coordinate to the parent
    258257 */
     
    269268
    270269/**
    271  * sets the relative coordinate of the Element2D to its Parent
     270 * @brief sets the relative coordinate of the Element2D to its Parent
    272271 * @param x the x coordinate
    273272 * @param y the y coordinate
     
    279278
    280279/**
    281  * sets the Relative coordinate to the parent in Pixels
     280 * @brief sets the Relative coordinate to the parent in Pixels
    282281 * @param x the relCoord X
    283282 * @param y the relCoord Y
     
    290289
    291290/**
    292  * sets a new relative position smoothely
     291 * @brief sets a new relative position smoothely
    293292 * @param relCoordSoft the new Position to iterate to
    294293 * @param bias how fast to iterate to this position
     
    304303
    305304/**
    306  * sets a new relative position smoothely
     305 * @brief sets a new relative position smoothely
    307306 * @param x the new x-coordinate in Pixels of the Position to iterate to
    308307 * @param y the new y-coordinate in Pixels of the Position to iterate to
     
    317316
    318317/**
    319  * set relative coordinates smoothely
     318 * @brief set relative coordinates smoothely
    320319 * @param x x-relative coordinates to its parent
    321320 * @param y y-relative coordinates to its parent
     
    420419
    421420/**
    422  * shift coordinate ralative
     421 * @brief shift coordinate ralative
    423422 * @param shift shift vector
    424423 *
     
    433432
    434433/**
    435  * shifts in PixelSpace
     434 * @brief shifts in PixelSpace
    436435 * @param x the pixels to shift in X
    437436 * @param y the pixels to shift in Y
     
    444443
    445444/**
    446  * set relative direction
     445 * @brief set relative direction
    447446 * @param relDir to its parent
    448447 */
     
    460459
    461460/**
    462  * sets the Relative Direction of this node to its parent in a Smoothed way
     461 * @brief sets the Relative Direction of this node to its parent in a Smoothed way
    463462 * @param relDirSoft the direction to iterate to smoothely.
    464463 * @param bias how fast to iterate to the new Direction
     
    474473
    475474/**
    476  * sets the absolute direction
     475 * @brief sets the absolute direction
    477476 * @param absDir absolute coordinates
    478477 */
     
    494493
    495494/**
    496  * sets the absolute direction softly
     495 * @brief sets the absolute direction softly
    497496 * @param absDir absolute coordinates
    498497 */
     
    553552      {
    554553        // Inserting the Element at the right Layer depth.
    555         list<Element2D*>::iterator elem;
     554        std::list<Element2D*>::iterator elem;
    556555        for (elem = this->children.begin(); elem != this->children.end(); elem++)
    557556        {
     
    628627
    629628/**
    630  * remove this Element from the tree and adds all children to NullElement2D
     629 * @brief remove this Element from the tree and adds all children to NullElement2D
    631630 *
    632631 * afterwards this Node is free, and can be reattached, or deleted freely.
     
    634633void Element2D::remove2D()
    635634{
    636   list<Element2D*>::iterator child = this->children.begin();
    637   list<Element2D*>::iterator reparenter;
     635  std::list<Element2D*>::iterator child = this->children.begin();
     636  std::list<Element2D*>::iterator reparenter;
    638637  while (child != this->children.end())
    639638  {
     
    671670
    672671/**
    673  * does the reparenting in a very smooth way
     672 * @brief does the reparenting in a very smooth way
    674673 * @param parentNode the new Node to connect this node to.
    675674 * @param bias the speed to iterate to this new Positions
     
    928927  if(!this->children.empty() || this->parentMode & E2D_UPDATE_CHILDREN_IF_INACTIVE)
    929928  {
    930     list<Element2D*>::iterator child;
     929    std::list<Element2D*>::iterator child;
    931930    for (child = this->children.begin(); child != this->children.end(); child++)
    932931    {
     
    949948
    950949/**
    951  * displays some information about this pNode
     950 * @brief displays some information about this pNode
    952951 * @param depth The deph into which to debug the children of this Element2D to.
    953952 * (0: all children will be debugged, 1: only this Element2D, 2: this and direct children...)
     
    975974  if (depth >= 2 || depth == 0)
    976975  {
    977     list<Element2D*>::const_iterator child;
     976    std::list<Element2D*>::const_iterator child;
    978977    for (child = this->children.begin(); child != this->children.end(); child++)
    979978    {
     
    987986
    988987/**
    989  * ticks the 2d-Element
     988 * @brief ticks the 2d-Element
    990989 * @param dt the time elapsed since the last tick
    991990 *
     
    1000999  if (this->children.size() > 0)
    10011000  {
    1002     list<Element2D*>::iterator child;
     1001    std::list<Element2D*>::iterator child;
    10031002    for (child = this->children.begin(); child != this->children.end(); child++)
    10041003      (*child)->tick2D(dt);
     
    10071006
    10081007/**
    1009  * draws all the Elements from this element2D downwards
     1008 * @brief draws all the Elements from this element2D downwards
    10101009 * @param layer the maximal Layer to draw. @see E2D_LAYER
    10111010 */
    1012 void Element2D::draw2D(short layer) const
     1011void Element2D::draw2D(E2D_LAYER from, E2D_LAYER to) const
    10131012{
    10141013  if (this->bVisible)
     
    10161015  if (this->children.size() > 0)
    10171016  {
    1018     list<Element2D*>::const_iterator child;
     1017    std::list<Element2D*>::const_iterator child;
    10191018    for (child = this->children.begin(); child != this->children.end(); child++)
    1020       if (likely(layer >= this->layer))
    1021         (*child)->draw2D(layer);
     1019      if (likely( (*child)->layer >= from && (*child)->layer <= to))
     1020        (*child)->draw2D(from, to);
    10221021  }
    10231022}
     
    10571056  {
    10581057    Vector childColor =  Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0));
    1059     list<Element2D*>::const_iterator child;
     1058    std::list<Element2D*>::const_iterator child;
    10601059    for (child = this->children.begin(); child != this->children.end(); child++)
    10611060    {
Note: See TracChangeset for help on using the changeset viewer.