summaryrefslogtreecommitdiff
path: root/src/guichan
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-23 20:30:06 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-23 20:30:06 +0300
commit0e9c8d981843947d2210bf3782ddacf01ae8fff9 (patch)
tree47648d30f895f6d776cd763d01d76f6976342096 /src/guichan
parent801822c36bfc0c51739455d30b997a1b3e688870 (diff)
downloadmanaverse-0e9c8d981843947d2210bf3782ddacf01ae8fff9.tar.gz
manaverse-0e9c8d981843947d2210bf3782ddacf01ae8fff9.tar.bz2
manaverse-0e9c8d981843947d2210bf3782ddacf01ae8fff9.tar.xz
manaverse-0e9c8d981843947d2210bf3782ddacf01ae8fff9.zip
improve a bit draw speed in basiccontainer class.
Diffstat (limited to 'src/guichan')
-rw-r--r--src/guichan/basiccontainer.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/guichan/basiccontainer.cpp b/src/guichan/basiccontainer.cpp
index a89e55ea4..5defa924e 100644
--- a/src/guichan/basiccontainer.cpp
+++ b/src/guichan/basiccontainer.cpp
@@ -264,27 +264,30 @@ namespace gcn
for (WidgetListConstIterator iter = mWidgets.begin();
iter != mWidgets.end(); ++ iter)
{
- if ((*iter)->isVisible())
+ Widget *const widget = *iter;
+ if (widget->isVisible())
{
// If the widget has a frame,
// draw it before drawing the widget
- if ((*iter)->getFrameSize() > 0)
+ if (widget->getFrameSize() > 0)
{
- Rectangle rec = (*iter)->getDimension();
- rec.x -= (*iter)->getFrameSize();
- rec.y -= (*iter)->getFrameSize();
- rec.width += 2 * (*iter)->getFrameSize();
- rec.height += 2 * (*iter)->getFrameSize();
+ Rectangle rec = widget->getDimension();
+ const int frame = widget->getFrameSize();
+ const int frame2 = frame * 2;
+ rec.x -= frame;
+ rec.y -= frame;
+ rec.width += frame2;
+ rec.height += frame2;
graphics->pushClipArea(rec);
BLOCK_START("BasicContainer::drawChildren 1")
- (*iter)->drawFrame(graphics);
+ widget->drawFrame(graphics);
BLOCK_END("BasicContainer::drawChildren 1")
graphics->popClipArea();
}
- graphics->pushClipArea((*iter)->getDimension());
+ graphics->pushClipArea(widget->getDimension());
BLOCK_START("BasicContainer::drawChildren 2")
- (*iter)->draw(graphics);
+ widget->draw(graphics);
BLOCK_END("BasicContainer::drawChildren 2")
graphics->popClipArea();
}