diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-29 21:22:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-29 21:22:33 +0300 |
commit | f94a6551b8d140e272ac1c46bce1ff0e5df34986 (patch) | |
tree | 35c764dfec7b76f926c30cd186b6fe36968b6529 /src/gui/widgets | |
parent | 0336b91f51cdf14e022f74d16c15892b63b658eb (diff) | |
download | manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.gz manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.bz2 manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.xz manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.zip |
improve draw image calls.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/button.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/checkbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/desktop.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/emotepage.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/extendedlistbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/icon.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/shoplistbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/shortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/slider.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/tab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 6 |
20 files changed, 34 insertions, 34 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index cc9b1a262..0c87df057 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -137,7 +137,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) } else { - DRAW_IMAGE(graphics, icon, mImagePadding, y + mPadding); + graphics->drawImage2(icon, mImagePadding, y + mPadding); } } } diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index d3e2efc67..5394054fe 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -508,7 +508,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) } else if (part.mImage) { - DRAW_IMAGE(graphics2, part.mImage, part.mX, part.mY); + graphics2->drawImage2(part.mImage, part.mX, part.mY); } } diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index c8ac617c0..b7cba68af 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -508,11 +508,11 @@ void Button::draw(gcn::Graphics *graphics) { if (isPressed()) { - DRAW_IMAGE(g2, mImages[mode], imageX + 1, imageY + 1); + g2->drawImage2(mImages[mode], imageX + 1, imageY + 1); } else { - DRAW_IMAGE(g2, mImages[mode], imageX, imageY); + g2->drawImage2(mImages[mode], imageX, imageY); } } } diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 0dfd45745..1497706a1 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -167,7 +167,7 @@ void CheckBox::drawBox(gcn::Graphics *const graphics) if (box) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( box, mImagePadding, (getHeight() - mImageSize) / 2); } } diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 1aed4a825..7d464b46d 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -124,7 +124,7 @@ void Desktop::draw(gcn::Graphics *graphics) if (imageHelper->useOpenGL() == RENDER_SOFTWARE) { - DRAW_IMAGE(g, mWallpaper, + g->drawImage2(mWallpaper, (width - wallpWidth) / 2, (height - wallpHeight) / 2); } diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 0cfcb2a6f..bb4ca313a 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -250,7 +250,7 @@ void DropDown::draw(gcn::Graphics* graphics) } else { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( image, mImagePadding, (mDimension.height - image->getHeight()) / 2 + mPadding); font->drawString(graphics, model->getElementAt(sel), @@ -303,7 +303,7 @@ void DropDown::drawButton(gcn::Graphics *graphics) Image *image = buttons[mDroppedDown][mPushed]; if (image) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), image, + static_cast<Graphics*>(graphics)->drawImage2(image, mDimension.width - image->getWidth() - mImagePadding, (height - image->getHeight()) / 2); } diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 9775b0fb0..1662bdbb4 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -144,7 +144,7 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics) caption = "Eq."; image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); if (item->isEquipped()) g->setColorAll(mEquipedColor, mEquipedColor2); else diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp index 3c7d1a842..f80f80874 100644 --- a/src/gui/widgets/emotepage.cpp +++ b/src/gui/widgets/emotepage.cpp @@ -103,7 +103,7 @@ void EmotePage::draw(gcn::Graphics *graphics) const Image *const image = *it; if (image) { - DRAW_IMAGE(g, image, x, y); + g->drawImage2(image, x, y); x += emoteWidth; if (x + emoteWidth > width) { diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index da9c4521e..781f35e79 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -146,7 +146,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - DRAW_IMAGE(g, image, mImagePadding, item.y + (height + g->drawImage2(image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } } @@ -180,7 +180,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - DRAW_IMAGE(g, image, mImagePadding, item.y + (height + g->drawImage2(image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } } diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp index e4985d68f..95e287ace 100644 --- a/src/gui/widgets/icon.cpp +++ b/src/gui/widgets/icon.cpp @@ -73,7 +73,7 @@ void Icon::draw(gcn::Graphics *g) if (mImage) { Graphics *const graphics = static_cast<Graphics*>(g); - DRAW_IMAGE(graphics, mImage, + graphics->drawImage2(mImage, (mDimension.width - mImage->mBounds.w) / 2, (mDimension.height - mImage->mBounds.h) / 2); } diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 8ba9707a4..5e5caf234 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -278,15 +278,15 @@ void ItemContainer::draw(gcn::Graphics *graphics) if (mShowMatrix[itemIndex] == mSelectedIndex) { if (mSelImg) - DRAW_IMAGE(g, mSelImg, itemX, itemY); + g->drawImage2(mSelImg, itemX, itemY); } image->setAlpha(1.0F); // ensure the image if fully drawn... - DRAW_IMAGE(g, image, itemX + mPaddingItemX, + g->drawImage2(image, itemX + mPaddingItemX, itemY + mPaddingItemY); if (mProtectedImg && PlayerInfo::isItemProtected( item->getId())) { - DRAW_IMAGE(g, mProtectedImg, + g->drawImage2(mProtectedImg, itemX + mPaddingItemX, itemY + mPaddingItemY); } } diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 7271f3943..f969e34d9 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -175,7 +175,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) caption = "Eq."; image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); if (item->isEquipped()) g->setColorAll(mEquipedColor, mEquipedColor2); else @@ -199,7 +199,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); } } @@ -218,7 +218,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); } font->drawString(g, skill->data->shortName, itemX + 2, diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 6ef7439b4..3ae2e73aa 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -149,7 +149,7 @@ void RadioButton::drawBox(gcn::Graphics* graphics) if (box) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( box, mImagePadding, (getHeight() - mImageSize) / 2); } } diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 3a69ea0c0..41204415d 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -429,7 +429,7 @@ void ScrollArea::drawButton(gcn::Graphics *const graphics, if (buttons[dir][state]) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( buttons[dir][state], dim.x, dim.y); } } diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 5bf56c842..90f4e3648 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -157,7 +157,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) if (icon) { icon->setAlpha(1.0F); - DRAW_IMAGE(graphics, icon, mPadding, y + mPadding); + graphics->drawImage2(icon, mPadding, y + mPadding); } } if (mSelected == i) diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index c4a6fe249..17a6c4edf 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -109,7 +109,7 @@ void ShortcutContainer::drawBackground(Graphics *g) { for (unsigned i = 0; i < mMaxItems; i ++) { - DRAW_IMAGE(g, mBackgroundImg, (i % mGridWidth) * mBoxWidth, + g->drawImage2(mBackgroundImg, (i % mGridWidth) * mBoxWidth, (i / mGridWidth) * mBoxHeight); } } diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index e68482821..b03ba7c2d 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -209,7 +209,7 @@ void Slider::draw(gcn::Graphics *graphics) { if (!mHasMouse) { - DRAW_IMAGE(g, buttons[0].grid[HSTART], x, y); + g->drawImage2(buttons[0].grid[HSTART], x, y); const int width = buttons[0].grid[HSTART]->getWidth(); w -= width + buttons[0].grid[HEND]->getWidth(); x += width; @@ -221,18 +221,18 @@ void Slider::draw(gcn::Graphics *graphics) } x += w; - DRAW_IMAGE(g, buttons[0].grid[HEND], x, y); + g->drawImage2(buttons[0].grid[HEND], x, y); const Image *const img = buttons[0].grid[HGRIP]; if (img) { - DRAW_IMAGE(g, img, getMarkerPosition(), + g->drawImage2(img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } else { - DRAW_IMAGE(g, buttons[1].grid[HSTART], x, y); + g->drawImage2(buttons[1].grid[HSTART], x, y); const int width = buttons[1].grid[HSTART]->getWidth(); w -= width; @@ -248,12 +248,12 @@ void Slider::draw(gcn::Graphics *graphics) x += w; if (buttons[1].grid[HEND]) - DRAW_IMAGE(g, buttons[1].grid[HEND], x, y); + g->drawImage2(buttons[1].grid[HEND], x, y); const Image *const img = buttons[1].grid[HGRIP]; if (img) { - DRAW_IMAGE(g, img, getMarkerPosition(), + g->drawImage2(img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 7d9ba6d0f..f18668b2b 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -135,7 +135,7 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); } } diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index 3fa27bbe8..de44d5b02 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -242,7 +242,7 @@ void Tab::draw(gcn::Graphics *graphics) if (skin1) { const int padding = skin1->getPadding(); - DRAW_IMAGE(g, mImage, padding, padding); + g->drawImage2(mImage, padding, padding); } } } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 963288a03..a0ef3038a 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -278,18 +278,18 @@ void Window::draw(gcn::Graphics *graphics) const Image *const button = mSkin->getCloseImage( mResizeHandles == CLOSE); if (button) - DRAW_IMAGE(g, button, mCloseRect.x, mCloseRect.y); + g->drawImage2(button, mCloseRect.x, mCloseRect.y); } // Draw Sticky Button if (mStickyButton) { const Image *const button = mSkin->getStickyImage(mSticky); if (button) - DRAW_IMAGE(g, button, mStickyRect.x, mStickyRect.y); + g->drawImage2(button, mStickyRect.x, mStickyRect.y); } if (mGrip) - DRAW_IMAGE(g, mGrip, mGripRect.x, mGripRect.y); + g->drawImage2(mGrip, mGripRect.x, mGripRect.y); } // Draw title |