Changeset 5084 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Aug 19, 2005, 2:37:18 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r5079 r5084 406 406 407 407 /** 408 * updates everything that is to be updated in the GraphicsEngine 409 */ 410 void GraphicsEngine::update(float dt) 411 { 412 // NullElement2D::getInstance()->update2D(dt); 413 NullElement2D::getInstance()->debug(0); 414 415 } 416 417 418 /** 408 419 * ticks the Text 409 420 * @param dt the time passed -
trunk/src/lib/graphics/graphics_engine.h
r5039 r5084 62 62 static GLint viewPort[4]; 63 63 64 void update(float dt); 64 65 void tick(float dt); 65 66 void draw() const; -
trunk/src/lib/graphics/render2D/element_2d.cc
r5083 r5084 33 33 * @todo this constructor is not jet implemented - do it 34 34 */ 35 Element2D::Element2D ( )36 { 37 this->init( );35 Element2D::Element2D (Element2D* parent) 36 { 37 this->init(parent); 38 38 } 39 39 … … 51 51 * initializes a Element2D 52 52 */ 53 void Element2D::init( )53 void Element2D::init(Element2D* parent) 54 54 { 55 55 this->setClassID(CL_ELEMENT_2D, "Element2D"); … … 60 60 this->setAlignment(E2D_ALIGN_NONE); 61 61 this->layer = E2D_TOP; 62 62 63 this->setParentMode2D(E2D_PARENT_ALL); 63 64 this->children = new tList<Element2D>; 64 65 this->bRelCoorChanged = true; 65 66 this->bRelDirChanged = true; 67 if (parent == NULL) 68 this->parent = NULL; 69 // else 70 // this->setParent2D(parent); 66 71 67 72 Render2D::getInstance()->registerElement2D(this); … … 148 153 * this sets the position of the Element on the screen. 149 154 * Use this in the your tick function, if you want the element to be automatically positioned. 155 * 156 * @todo must be in update 150 157 */ 151 158 void Element2D::positioning() … … 279 286 if( likely(child->parent != NULL)) 280 287 { 281 PRINTF(4)(" PNode::addChild() - reparenting node: removing it and adding it again\n");288 PRINTF(4)("Element2D::addChild() - reparenting node: removing it and adding it again\n"); 282 289 child->parent->children->remove(child); 283 290 } … … 414 421 this->lastAbsCoordinate = this->absCoordinate; 415 422 416 PRINTF(5)(" PNode::update - %s - (%f, %f, %f)\n", this->getName(), this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);423 PRINTF(5)("Element2D::update - %s - (%f, %f, %f)\n", this->getName(), this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 417 424 418 425 … … 434 441 /* update the current absCoordinate */ 435 442 this->prevRelCoordinate = this->relCoordinate; 436 //this->absCoordinate = this->parent->getAbsCoor2D();437 443 this->absCoordinate.x = this->parent->getAbsCoor2D().x + (this->relCoordinate.x*cos(this->parent->getAbsDir2D()) - this->relCoordinate.y * sin(this->parent->getAbsDir2D())); 438 444 this->absCoordinate.y = this->parent->getAbsCoor2D().y + (this->relCoordinate.x*sin(this->parent->getAbsDir2D()) + this->relCoordinate.y * cos(this->parent->getAbsDir2D())); … … 443 449 else 444 450 { 445 PRINTF( 4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);451 PRINTF(5)("Element2D::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 446 452 if (this->bRelCoorChanged) 447 453 this->absCoordinate = this->relCoordinate; -
trunk/src/lib/graphics/render2D/element_2d.h
r5083 r5084 2 2 * @file element_2d.h 3 3 * Definition of the 2D elements rendered on top through the GraphicsEngine 4 * 4 5 * @todo reimplement it, so it looks just like PNode. 5 6 */ … … 62 63 63 64 public: 64 Element2D( );65 Element2D(Element2D* parent = NULL); 65 66 virtual ~Element2D(); 66 67 67 void init( );68 void init(Element2D* parent = NULL); 68 69 void loadParams(const TiXmlElement* root); 69 70 … … 156 157 157 158 private: 158 void init(Element2D* parent);159 159 /** tells the child that the parent's Coordinate has changed */ 160 160 inline void parentCoorChanged () { this->bRelCoorChanged = true; } … … 170 170 protected: 171 171 void positioning(); 172 //void Element2D(NullElement2D* nullElem); 172 173 173 174 protected: … … 184 185 185 186 186 187 188 189 187 private: 190 188 bool bRelCoorChanged; //!< If Relative Coordinate has changed since last time we checked
Note: See TracChangeset
for help on using the changeset viewer.