Changeset 7840 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- May 24, 2006, 10:38:51 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/lense_flare.cc
r7810 r7840 156 156 157 157 ImagePlane* bb = new ImagePlane(NULL); 158 if (this->flares.empty()) 159 bb->setLayer(E2D_LAYER_BELOW_ALL); 158 160 bb->setTexture(textureName); 159 161 bb->setSize(50, 50); -
trunk/src/lib/graphics/graphics_engine.cc
r7727 r7840 569 569 } 570 570 571 void GraphicsEngine::drawBackgroundElements() const 572 { 573 Render2D::getInstance()->draw(E2D_LAYER_BELOW_ALL, E2D_LAYER_BELOW_ALL); 574 } 571 575 572 576 void GraphicsEngine::draw() const … … 583 587 GraphicsEngine::storeMatrices(); 584 588 Shader::suspendShader(); 585 586 Render2D::getInstance()->draw(E2D_LAYER_ALL); 589 Render2D::getInstance()->draw(E2D_LAYER_BOTTOM, E2D_LAYER_ABOVE_ALL); 587 590 Shader::restoreShader(); 588 591 } -
trunk/src/lib/graphics/graphics_engine.h
r7370 r7840 68 68 void update(float dt); 69 69 void tick(float dt); 70 71 void drawBackgroundElements() const; 70 72 void draw() const; 71 73 void displayFPS(bool display); -
trunk/src/lib/graphics/render2D/element_2d.cc
r7727 r7840 32 32 SHELL_COMMAND(debug, Element2D, debug2DSC); 33 33 34 using namespace std;35 34 36 35 /** … … 199 198 200 199 /** 201 * moves a Element to another layer200 * @brief moves a Element to another layer 202 201 * @param layer the Layer this is drawn on 203 202 */ … … 254 253 255 254 /** 256 * sets the relative coordinate of the Element2D to its parent255 * @brief sets the relative coordinate of the Element2D to its parent 257 256 * @param relCoord the relative coordinate to the parent 258 257 */ … … 269 268 270 269 /** 271 * sets the relative coordinate of the Element2D to its Parent270 * @brief sets the relative coordinate of the Element2D to its Parent 272 271 * @param x the x coordinate 273 272 * @param y the y coordinate … … 279 278 280 279 /** 281 * sets the Relative coordinate to the parent in Pixels280 * @brief sets the Relative coordinate to the parent in Pixels 282 281 * @param x the relCoord X 283 282 * @param y the relCoord Y … … 290 289 291 290 /** 292 * sets a new relative position smoothely291 * @brief sets a new relative position smoothely 293 292 * @param relCoordSoft the new Position to iterate to 294 293 * @param bias how fast to iterate to this position … … 304 303 305 304 /** 306 * sets a new relative position smoothely305 * @brief sets a new relative position smoothely 307 306 * @param x the new x-coordinate in Pixels of the Position to iterate to 308 307 * @param y the new y-coordinate in Pixels of the Position to iterate to … … 317 316 318 317 /** 319 * set relative coordinates smoothely318 * @brief set relative coordinates smoothely 320 319 * @param x x-relative coordinates to its parent 321 320 * @param y y-relative coordinates to its parent … … 420 419 421 420 /** 422 * shift coordinate ralative421 * @brief shift coordinate ralative 423 422 * @param shift shift vector 424 423 * … … 433 432 434 433 /** 435 * shifts in PixelSpace434 * @brief shifts in PixelSpace 436 435 * @param x the pixels to shift in X 437 436 * @param y the pixels to shift in Y … … 444 443 445 444 /** 446 * set relative direction445 * @brief set relative direction 447 446 * @param relDir to its parent 448 447 */ … … 460 459 461 460 /** 462 * sets the Relative Direction of this node to its parent in a Smoothed way461 * @brief sets the Relative Direction of this node to its parent in a Smoothed way 463 462 * @param relDirSoft the direction to iterate to smoothely. 464 463 * @param bias how fast to iterate to the new Direction … … 474 473 475 474 /** 476 * sets the absolute direction475 * @brief sets the absolute direction 477 476 * @param absDir absolute coordinates 478 477 */ … … 494 493 495 494 /** 496 * sets the absolute direction softly495 * @brief sets the absolute direction softly 497 496 * @param absDir absolute coordinates 498 497 */ … … 553 552 { 554 553 // Inserting the Element at the right Layer depth. 555 list<Element2D*>::iterator elem;554 std::list<Element2D*>::iterator elem; 556 555 for (elem = this->children.begin(); elem != this->children.end(); elem++) 557 556 { … … 628 627 629 628 /** 630 * remove this Element from the tree and adds all children to NullElement2D629 * @brief remove this Element from the tree and adds all children to NullElement2D 631 630 * 632 631 * afterwards this Node is free, and can be reattached, or deleted freely. … … 634 633 void Element2D::remove2D() 635 634 { 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; 638 637 while (child != this->children.end()) 639 638 { … … 671 670 672 671 /** 673 * does the reparenting in a very smooth way672 * @brief does the reparenting in a very smooth way 674 673 * @param parentNode the new Node to connect this node to. 675 674 * @param bias the speed to iterate to this new Positions … … 928 927 if(!this->children.empty() || this->parentMode & E2D_UPDATE_CHILDREN_IF_INACTIVE) 929 928 { 930 list<Element2D*>::iterator child;929 std::list<Element2D*>::iterator child; 931 930 for (child = this->children.begin(); child != this->children.end(); child++) 932 931 { … … 949 948 950 949 /** 951 * displays some information about this pNode950 * @brief displays some information about this pNode 952 951 * @param depth The deph into which to debug the children of this Element2D to. 953 952 * (0: all children will be debugged, 1: only this Element2D, 2: this and direct children...) … … 975 974 if (depth >= 2 || depth == 0) 976 975 { 977 list<Element2D*>::const_iterator child;976 std::list<Element2D*>::const_iterator child; 978 977 for (child = this->children.begin(); child != this->children.end(); child++) 979 978 { … … 987 986 988 987 /** 989 * ticks the 2d-Element988 * @brief ticks the 2d-Element 990 989 * @param dt the time elapsed since the last tick 991 990 * … … 1000 999 if (this->children.size() > 0) 1001 1000 { 1002 list<Element2D*>::iterator child;1001 std::list<Element2D*>::iterator child; 1003 1002 for (child = this->children.begin(); child != this->children.end(); child++) 1004 1003 (*child)->tick2D(dt); … … 1007 1006 1008 1007 /** 1009 * draws all the Elements from this element2D downwards1008 * @brief draws all the Elements from this element2D downwards 1010 1009 * @param layer the maximal Layer to draw. @see E2D_LAYER 1011 1010 */ 1012 void Element2D::draw2D( short layer) const1011 void Element2D::draw2D(E2D_LAYER from, E2D_LAYER to) const 1013 1012 { 1014 1013 if (this->bVisible) … … 1016 1015 if (this->children.size() > 0) 1017 1016 { 1018 list<Element2D*>::const_iterator child;1017 std::list<Element2D*>::const_iterator child; 1019 1018 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); 1022 1021 } 1023 1022 } … … 1057 1056 { 1058 1057 Vector childColor = Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0)); 1059 list<Element2D*>::const_iterator child;1058 std::list<Element2D*>::const_iterator child; 1060 1059 for (child = this->children.begin(); child != this->children.end(); child++) 1061 1060 { -
trunk/src/lib/graphics/render2D/element_2d.h
r7332 r7840 136 136 virtual void draw() const {}; 137 137 void tick2D(float dt); 138 void draw2D( short layer) const;138 void draw2D(E2D_LAYER from, E2D_LAYER to) const; 139 139 140 140 // LIKE PNODE -
trunk/src/lib/graphics/render2D/render_2d.cc
r7457 r7840 25 25 26 26 /** 27 * standard constructor27 * @brief standard constructor 28 28 */ 29 29 Render2D::Render2D () … … 36 36 37 37 /** 38 * the singleton reference to this class38 * @brief the singleton reference to this class 39 39 */ 40 40 Render2D* Render2D::singletonRef = NULL; 41 41 42 42 /** 43 * standard deconstructor43 * @brief standard deconstructor 44 44 */ 45 45 Render2D::~Render2D () … … 51 51 52 52 /** 53 * updates all the 2d-elements53 * @brief updates all the 2d-elements 54 54 * @param dt the timestep since last dt 55 55 */ … … 61 61 62 62 /** 63 * ticks all the 2d-elements63 * @brief ticks all the 2d-elements 64 64 * @param dt the timestep since last dt 65 65 */ … … 70 70 71 71 /** 72 * renders all the Elements of the Render2D-engine's layer72 * @brief renders all the Elements of the Render2D-engine's layer 73 73 * @param layer the Layer to draw (if E2D_LAYER_ALL then all layers will be drawn) 74 74 */ 75 void Render2D::draw( short layer) const75 void Render2D::draw(E2D_LAYER from, E2D_LAYER to) const 76 76 { 77 77 GraphicsEngine::enter2DMode(); 78 Element2D::getNullElement()->draw2D(E2D_LAYER_ALL); 78 79 Element2D::getNullElement()->draw2D(from, to); 79 80 if (this->showNodes) 80 81 Element2D::getNullElement()->debugDraw2D(0); 82 81 83 GraphicsEngine::leave2DMode(); 82 84 } -
trunk/src/lib/graphics/render2D/render_2d.h
r5776 r7840 24 24 void update(float dt); 25 25 void tick(float dt); 26 void draw( short layer) const;26 void draw(E2D_LAYER from, E2D_LAYER to) const; 27 27 28 28 private:
Note: See TracChangeset
for help on using the changeset viewer.