Changeset 5399 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- Oct 18, 2005, 7:18:26 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/render2D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.h
r5398 r5399 27 27 28 28 E2D_LAYER_COUNT = 4, //!< The count of Layers. 29 30 E2D_LAYER_EXTERN = -1, //!< In a Layers handeled externally. 29 31 30 32 E2D_LAYER_ALL = 5, -
trunk/src/lib/graphics/render2D/render_2d.cc
r5398 r5399 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 66 66 void Render2D::registerElement2D(Element2D* element2D) 67 67 { 68 if (likely(element2D != NULL) && element2D->getLayer() < E2D_LAYER_COUNT )68 if (likely(element2D != NULL) && element2D->getLayer() < E2D_LAYER_COUNT && element2D->getLayer() != E2D_LAYER_EXTERN) 69 69 this->element2DList[element2D->getLayer()]->add(element2D); 70 70 // DEBUG printf("::::%p, %d %d \n", element2D, element2D->getLayer(), this->element2DList[element2D->getLayer()]->getSize()); … … 80 80 void Render2D::unregisterElement2D(Element2D* element2D) 81 81 { 82 if (likely(element2D != NULL) && element2D->getLayer() < E2D_LAYER_COUNT )82 if (likely(element2D != NULL) && element2D->getLayer() < E2D_LAYER_COUNT && element2D->getLayer() != E2D_LAYER_EXTERN) 83 83 this->element2DList[element2D->getLayer()]->remove(element2D); 84 84 // DEBUG printf(":::%s layer: %d, %d\n", element2D->getClassName(), element2D->getLayer(), this->element2DList[element2D->getLayer()]->getSize()); … … 100 100 if (likely(element2D->getLayer() != to)) 101 101 { 102 this->element2DList[element2D->getLayer()]->remove(element2D); 103 this->element2DList[to]->add(element2D); 102 if (element2D->getLayer() != E2D_LAYER_EXTERN) 103 this->element2DList[element2D->getLayer()]->remove(element2D); 104 if (to != E2D_LAYER_EXTERN) 105 this->element2DList[to]->add(element2D); 104 106 } 105 107 } … … 136 138 if (layer != E2D_LAYER_ALL) 137 139 { 138 if (likely( this->element2DList[layer]->getSize() > 0))140 if (likely(layer != E2D_LAYER_EXTERN && this->element2DList[layer]->getSize() > 0)) 139 141 { 140 142 tIterator<Element2D>* iterator = this->element2DList[layer]->getIterator(); … … 169 171 GraphicsEngine::leave2DMode(); 170 172 } 173 174
Note: See TracChangeset
for help on using the changeset viewer.