diff options
Diffstat (limited to 'src/gui')
26 files changed, 58 insertions, 49 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 60924bfd4..2a0c1d641 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -468,7 +468,7 @@ void Gui::draw() { const int posX = mouseX - (image->mBounds.w / 2); const int posY = mouseY - (image->mBounds.h / 2); - g2->drawImage(image, posX, posY); + DRAW_IMAGE(g2, image, posX, posY); } if (mGuiFont) { @@ -486,7 +486,7 @@ void Gui::draw() if (mouseCursor) { mouseCursor->setAlpha(mMouseCursorAlpha); - g2->drawImage(mouseCursor, mouseX - 15, mouseY - 17); + DRAW_IMAGE(g2, mouseCursor, mouseX - 15, mouseY - 17); } } diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index b0596418d..74ae3ef88 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -483,7 +483,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics, if (image) { image->setAlpha(alpha); - g->drawImage(image, x, y); + DRAW_IMAGE(g, image, x, y); } } else @@ -505,7 +505,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics, const Image *const image = chunk2->img; if (image) - g->drawImage(image, x, y); + DRAW_IMAGE(g, image, x, y); } BLOCK_END("SDLFont::drawString") } diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 123f7f843..6726475d2 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -137,7 +137,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) } else { - graphics->drawImage(icon, mImagePadding, y + mPadding); + DRAW_IMAGE(graphics, icon, mImagePadding, y + mPadding); } } } diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 8d1550f43..0dafe8e24 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -506,7 +506,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) } else if (part.mImage) { - graphics2->drawImage(part.mImage, part.mX, part.mY); + DRAW_IMAGE(graphics2, part.mImage, part.mX, part.mY); } } diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index e1f95c334..91c531f6b 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -499,12 +499,17 @@ void Button::draw(gcn::Graphics *graphics) else { g2->drawImageRect(0, 0, width, height, skin->getBorder()); + if (mImages) { if (isPressed()) - g2->drawImage(mImages[mode], imageX + 1, imageY + 1); + { + DRAW_IMAGE(g2, mImages[mode], imageX + 1, imageY + 1); + } else - g2->drawImage(mImages[mode], imageX, imageY); + { + DRAW_IMAGE(g2, mImages[mode], imageX, imageY); + } } } diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index e21e50c53..c8710c573 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -165,7 +165,7 @@ void CheckBox::drawBox(gcn::Graphics *const graphics) if (box) { - static_cast<Graphics*>(graphics)->drawImage( + DRAW_IMAGE(static_cast<Graphics*>(graphics), box, mImagePadding, (getHeight() - mImageSize) / 2); } } diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index d2e132c56..1aed4a825 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) { - g->drawImage(mWallpaper, + DRAW_IMAGE(g, mWallpaper, (width - wallpWidth) / 2, (height - wallpHeight) / 2); } diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 7c41bbacc..07d48f13d 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -250,7 +250,7 @@ void DropDown::draw(gcn::Graphics* graphics) } else { - static_cast<Graphics*>(graphics)->drawImage( + DRAW_IMAGE(static_cast<Graphics*>(graphics), 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) { - static_cast<Graphics*>(graphics)->drawImage(image, + DRAW_IMAGE(static_cast<Graphics*>(graphics), 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 d8f2f1d68..9775b0fb0 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); - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, 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 5af84e88d..a68836a96 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) { - g->drawImage(image, x, y); + DRAW_IMAGE(g, image, x, y); x += emoteWidth; if (x + emoteWidth > width) { diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index 68b4df766..0363b73a0 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -132,7 +132,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - g->drawImage(image, mImagePadding, item.y + (height + DRAW_IMAGE(g, image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } } @@ -166,7 +166,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - g->drawImage(image, mImagePadding, item.y + (height + DRAW_IMAGE(g, image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } } diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp index 9232aea0d..e4985d68f 100644 --- a/src/gui/widgets/icon.cpp +++ b/src/gui/widgets/icon.cpp @@ -73,7 +73,8 @@ void Icon::draw(gcn::Graphics *g) if (mImage) { Graphics *const graphics = static_cast<Graphics*>(g); - graphics->drawImage(mImage, (mDimension.width - mImage->mBounds.w) / 2, + DRAW_IMAGE(graphics, mImage, + (mDimension.width - mImage->mBounds.w) / 2, (mDimension.height - mImage->mBounds.h) / 2); } BLOCK_END("Icon::draw") diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 8754210f8..9064ca8b5 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -280,16 +280,16 @@ void ItemContainer::draw(gcn::Graphics *graphics) if (mShowMatrix[itemIndex] == mSelectedIndex) { if (mSelImg) - g->drawImage(mSelImg, itemX, itemY); + DRAW_IMAGE(g, mSelImg, itemX, itemY); } image->setAlpha(1.0F); // ensure the image if fully drawn... - g->drawImage(image, itemX + mPaddingItemX, + DRAW_IMAGE(g, image, itemX + mPaddingItemX, itemY + mPaddingItemY); if (mProtectedImg && PlayerInfo::isItemProtected( item->getId())) { - g->drawImage(mProtectedImg, itemX + mPaddingItemX, - itemY + mPaddingItemY); + DRAW_IMAGE(g, mProtectedImg, + itemX + mPaddingItemX, itemY + mPaddingItemY); } } } diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 266c96241..7271f3943 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); - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, 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); - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, image, itemX, itemY); } } @@ -218,7 +218,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, 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 fe0195680..1dff6ae7c 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -148,7 +148,7 @@ void RadioButton::drawBox(gcn::Graphics* graphics) if (box) { - static_cast<Graphics*>(graphics)->drawImage( + DRAW_IMAGE(static_cast<Graphics*>(graphics), box, mImagePadding, (getHeight() - mImageSize) / 2); } } diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index e97dad715..a2e1ca4aa 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -428,8 +428,8 @@ void ScrollArea::drawButton(gcn::Graphics *const graphics, if (buttons[dir][state]) { - static_cast<Graphics*>(graphics)-> - drawImage(buttons[dir][state], dim.x, dim.y); + DRAW_IMAGE(static_cast<Graphics*>(graphics), + buttons[dir][state], dim.x, dim.y); } } diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 9918b7788..5bf56c842 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); - graphics->drawImage(icon, mPadding, y + mPadding); + DRAW_IMAGE(graphics, icon, mPadding, y + mPadding); } } if (mSelected == i) diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index 2fb5c4099..a68bc8b07 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 ++) { - g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth, + DRAW_IMAGE(g, mBackgroundImg, (i % mGridWidth) * mBoxWidth, (i / mGridWidth) * mBoxHeight); } } diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 20fc6b21b..47d4e2215 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -204,7 +204,7 @@ void Slider::draw(gcn::Graphics *graphics) { if (!mHasMouse) { - g->drawImage(buttons[0].grid[HSTART], x, y); + DRAW_IMAGE(g, buttons[0].grid[HSTART], x, y); const int width = buttons[0].grid[HSTART]->getWidth(); w -= width + buttons[0].grid[HEND]->getWidth(); x += width; @@ -216,18 +216,18 @@ void Slider::draw(gcn::Graphics *graphics) } x += w; - g->drawImage(buttons[0].grid[HEND], x, y); + DRAW_IMAGE(g, buttons[0].grid[HEND], x, y); const Image *const img = buttons[0].grid[HGRIP]; if (img) { - g->drawImage(img, getMarkerPosition(), + DRAW_IMAGE(g, img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } else { - g->drawImage(buttons[1].grid[HSTART], x, y); + DRAW_IMAGE(g, buttons[1].grid[HSTART], x, y); const int width = buttons[1].grid[HSTART]->getWidth(); w -= width; @@ -243,12 +243,12 @@ void Slider::draw(gcn::Graphics *graphics) x += w; if (buttons[1].grid[HEND]) - g->drawImage(buttons[1].grid[HEND], x, y); + DRAW_IMAGE(g, buttons[1].grid[HEND], x, y); const Image *const img = buttons[1].grid[HGRIP]; if (img) { - g->drawImage(img, getMarkerPosition(), + DRAW_IMAGE(g, img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 3a28bfabf..7d9ba6d0f 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); - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, image, itemX, itemY); } } diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index cdaa84d14..fd5d8ffc5 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -241,7 +241,7 @@ void Tab::draw(gcn::Graphics *graphics) if (skin1) { const int padding = skin1->getPadding(); - g->drawImage(mImage, padding, padding); + DRAW_IMAGE(g, mImage, padding, padding); } } } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 5148ec3f5..a95bc0877 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -272,18 +272,18 @@ void Window::draw(gcn::Graphics *graphics) const Image *const button = mSkin->getCloseImage( mResizeHandles == CLOSE); if (button) - g->drawImage(button, mCloseRect.x, mCloseRect.y); + DRAW_IMAGE(g, button, mCloseRect.x, mCloseRect.y); } // Draw Sticky Button if (mStickyButton) { const Image *const button = mSkin->getStickyImage(mSticky); if (button) - g->drawImage(button, mStickyRect.x, mStickyRect.y); + DRAW_IMAGE(g, button, mStickyRect.x, mStickyRect.y); } if (mGrip) - g->drawImage(mGrip, mGripRect.x, mGripRect.y); + DRAW_IMAGE(g, mGrip, mGripRect.x, mGripRect.y); } // Draw title diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 9f1ed11bf..c5df1b528 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -201,9 +201,13 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) if (!box) continue; if (i == mSelected) - g->drawImage(mSlotHighlightedBackground, box->x, box->y); + { + DRAW_IMAGE(g, mSlotHighlightedBackground, box->x, box->y); + } else - g->drawImage(mSlotBackground, box->x, box->y); + { + DRAW_IMAGE(g, mSlotBackground, box->x, box->y); + } } } @@ -229,7 +233,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) { image->setAlpha(1.0F); // Ensure the image is drawn // with maximum opacity - g->drawImage(image, box->x + mItemPadding, + DRAW_IMAGE(g, image, box->x + mItemPadding, box->y + mItemPadding); if (i == EQUIP_PROJECTILE_SLOT) { @@ -243,7 +247,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) } else if (box->image) { - g->drawImage(box->image, box->x + mItemPadding, + DRAW_IMAGE(g, box->image, box->x + mItemPadding, box->y + mItemPadding); } } diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 7aefa285b..6db0b5388 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -286,7 +286,7 @@ void Minimap::draw(gcn::Graphics *graphics) mMapOriginY = 0; } - graph->drawImage(mMapImage, mMapOriginX, mMapOriginY); + DRAW_IMAGE(graph, mMapImage, mMapOriginX, mMapOriginY); } const ActorSprites &actors = actorManager->getAll(); diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 704f3ce60..c242f5d85 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -348,7 +348,7 @@ void OutfitWindow::draw(gcn::Graphics *graphics) const Image *const image = item->getImage(); if (image) { - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, image, itemX, itemY); foundItem = true; } } @@ -359,7 +359,7 @@ void OutfitWindow::draw(gcn::Graphics *graphics) mItemColors[mCurrentOutfit][i]); if (image) { - g->drawImage(image, itemX, itemY); + DRAW_IMAGE(g, image, itemX, itemY); image->decRef(); } } @@ -367,7 +367,6 @@ void OutfitWindow::draw(gcn::Graphics *graphics) BLOCK_END("OutfitWindow::draw") } - void OutfitWindow::mouseDragged(gcn::MouseEvent &event) { if (event.getButton() == gcn::MouseEvent::LEFT) diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 74fb4faf5..b21f0c09b 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -134,7 +134,7 @@ class SkillListBox final : public ListBox const SkillData *const data = e->data; const int yPad = y + mPadding; const std::string &description = data->description; - graphics->drawImage(data->icon, mPadding, yPad); + DRAW_IMAGE(graphics, data->icon, mPadding, yPad); font->drawString(graphics, data->name, mTextPadding, yPad); if (!description.empty()) { |