Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8360 in orxonox.OLD


Ignore:
Timestamp:
Jun 14, 2006, 9:46:00 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: more performant Element2D'drawer

Location:
trunk/src/lib/graphics/render2D
Files:
2 edited

Legend:

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

    r8316 r8360  
    3434
    3535#include "shell_command.h"
    36 SHELL_COMMAND(debug, Element2D, debug2DSC);
     36SHELL_COMMAND(debug, Element2D, debug2D);
    3737
    3838
     
    10721072/**
    10731073 * @brief draws all the Elements from this element2D downwards
    1074  * @param layer the maximal Layer to draw. @see E2D_LAYER
     1074 * @param from the minimal Layer to draw. @see E2D_LAYER
     1075 * @param to the maximal Layer to draw. @see E2D_LAYER
     1076 *
    10751077 */
    10761078void Element2D::draw2D(E2D_LAYER from, E2D_LAYER to) const
    10771079{
    10781080  if (this->isVisible())
     1081  {
    10791082    this->draw();
    1080   if (this->children.size() > 0)
     1083    this->drawChildren(from, to);
     1084  }
     1085  else if ((parentMode & E2D_HIDE_CHILDREN_IF_HIDDEN) == 0)
     1086    this->drawChildren(from, to);
     1087}
     1088
     1089/**
     1090 * @brief Draws the Children of the Element2D node.
     1091 * @param param the minimal Layer to draw. @see E2D_LAYER
     1092 * @param to the maximal Layer to draw. @see E2D_LAYER
     1093 */
     1094void Element2D::drawChildren(E2D_LAYER from, E2D_LAYER to) const
     1095{
     1096  if (likely(this->children.size() > 0))
    10811097  {
    10821098    std::list<Element2D*>::const_iterator child;
     
    10861102  }
    10871103}
     1104
    10881105
    10891106/**
  • trunk/src/lib/graphics/render2D/element_2d.h

    r8035 r8360  
    6969  // VISIBILITY/ACTIVITY
    7070  E2D_HIDE_CHILDREN_IF_HIDDEN        = 0x1000,    //!< Prohibits the Children from being drawn if this node isn't visible. (used for Draw))
    71   E2D_HIDE_IF_PARENT_HIDDEN          = 0x2000,    //!< Prohibits the node from being drawn if the Parent is invisible.
     71  //E2D_HIDE_IF_PARENT_HIDDEN          = 0x2000,    //!< Prohibits the node from being drawn if the Parent is invisible.
    7272  E2D_UPDATE_CHILDREN_IF_INACTIVE    = 0x4000,    //!< Updates the Children of this Node even if the Parent is Inactive (note if this's parent is inactive children won't be updated.)
    7373  E2D_STATIC_NODE                    = 0x8000,    //!< Used for nodes that do not have any moving children, and that do not move.
     
    139139    void tick2D(float dt);
    140140    void draw2D(E2D_LAYER from, E2D_LAYER to) const;
     141    void drawChildren(E2D_LAYER from, E2D_LAYER to) const;
    141142
    142143    // LIKE PNODE
     
    216217
    217218    void debug2D (unsigned int depth = 1, unsigned int level = 0) const;
    218     void debug2DSC (unsigned int depth = 1, unsigned int level = 0) { this->debug2D(depth, level); }; // Wrapping Function for ShellCommand.
    219219    void debugDraw2D(unsigned int depth = 1, float size = 1.0, Vector color = Vector(1,0,0), unsigned int level = 0) const;
    220220
Note: See TracChangeset for help on using the changeset viewer.