| 553 | //----------------------------------------------------------------------------- |
| 554 | |
| 555 | void GuiControl::renderChildControls(Point2I offset, const RectI &updateRect) |
| 556 | { |
| 557 | // Save the current clip rect |
| 558 | // so we can restore it at the end of this method. |
| 559 | RectI savedClipRect = GFX->getClipRect(); |
| 560 | |
| 561 | // offset is the upper-left corner of this control in screen coordinates |
| 562 | // updateRect is the intersection rectangle in screen coords of the control |
| 563 | // hierarchy. This can be set as the clip rectangle in most cases. |
| 564 | RectI clipRect = updateRect; |
| 565 | |
| 566 | iterator i; |
| 567 | for(i = begin(); i != end(); i++) |
| 568 | { |
| 569 | GuiControl *ctrl = static_cast<GuiControl *>(*i); |
| 570 | if (ctrl->mVisible) |
| 571 | { |
| 572 | Point2I childPosition = offset + ctrl->getPosition(); |
| 573 | RectI childClip(childPosition, ctrl->getExtent() + Point2I(1,1)); |
| 574 | |
| 575 | if (childClip.intersect(clipRect)) |
| 576 | { |
| 577 | GFX->setClipRect( childClip ); |
| 578 | GFX->setStateBlock(mDefaultGuiSB); |
| 579 | ctrl->onRender(childPosition, childClip); |
| 580 | } |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | // Restore the clip rect to what it was at the start |
| 585 | // of this method. |
| 586 | GFX->setClipRect( savedClipRect ); |
| 587 | } |
| 588 | |
| 589 | //----------------------------------------------------------------------------- |
| 590 |
nothing calls this directly
no test coverage detected