diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-23 20:17:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-23 20:17:46 +0300 |
commit | eed93efa8aa8539b47f225b4abafe6d59bebe67d (patch) | |
tree | 222fa8dcc991d9603d94645ad66cedd488648042 | |
parent | bec451007ce9471004ec4a8357cea3cb7712de55 (diff) | |
download | manaverse-eed93efa8aa8539b47f225b4abafe6d59bebe67d.tar.gz manaverse-eed93efa8aa8539b47f225b4abafe6d59bebe67d.tar.bz2 manaverse-eed93efa8aa8539b47f225b4abafe6d59bebe67d.tar.xz manaverse-eed93efa8aa8539b47f225b4abafe6d59bebe67d.zip |
Rename drawImage2 methods into drawImage.
49 files changed, 93 insertions, 92 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 93f8c6009..97424fbfb 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -294,7 +294,7 @@ void AnimatedSprite::draw(Graphics *const graphics, if (image->getAlpha() != mAlpha) image->setAlpha(mAlpha); - graphics->drawImage2(image, + graphics->drawImage(image, posX + mFrame->offsetX, posY + mFrame->offsetY); } diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index 27e48caa7..ea4a2067f 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -123,12 +123,12 @@ void CompoundSprite::draw(Graphics *const graphics, if (mAlpha == 1.0F && mImage) { - graphics->drawImage2(mImage, posX + mOffsetX, posY + mOffsetY); + graphics->drawImage(mImage, posX + mOffsetX, posY + mOffsetY); } else if (mAlpha && mAlphaImage) { mAlphaImage->setAlpha(mAlpha); - graphics->drawImage2(mAlphaImage, + graphics->drawImage(mAlphaImage, posX + mOffsetX, posY + mOffsetY); } else diff --git a/src/gui/font.cpp b/src/gui/font.cpp index e1d793ce1..8c022f99d 100644 --- a/src/gui/font.cpp +++ b/src/gui/font.cpp @@ -522,7 +522,7 @@ void Font::drawString(Graphics *const graphics, if (image) { image->setAlpha(alpha); - g->drawImage2(image, x, y); + g->drawImage(image, x, y); } } else @@ -544,7 +544,7 @@ void Font::drawString(Graphics *const graphics, const Image *const image = chunk2->img; if (image) - g->drawImage2(image, x, y); + g->drawImage(image, x, y); } BLOCK_END("Font::drawString") } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 07aca0c81..5914e43d9 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -451,7 +451,7 @@ void Gui::draw() { const int posX = mouseX - (image->mBounds.w / 2); const int posY = mouseY - (image->mBounds.h / 2); - mGraphics->drawImage2(image, posX, posY); + mGraphics->drawImage(image, posX, posY); } if (mGuiFont) { @@ -469,7 +469,7 @@ void Gui::draw() if (mouseCursor) { mouseCursor->setAlpha(mMouseCursorAlpha); - mGraphics->drawImage2(mouseCursor, mouseX - 15, mouseY - 17); + mGraphics->drawImage(mouseCursor, mouseX - 15, mouseY - 17); } } diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index cf01517c6..46a78d99e 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -135,7 +135,7 @@ void AvatarListBox::draw(Graphics *graphics) } else { - graphics->drawImage2(icon, mImagePadding, y + mPadding); + graphics->drawImage(icon, mImagePadding, y + mPadding); } } } diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index cfc26da0e..c36a607f4 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -508,7 +508,7 @@ void BrowserBox::draw(Graphics *graphics) } else if (part.mImage) { - graphics->drawImage2(part.mImage, part.mX, part.mY); + graphics->drawImage(part.mImage, part.mX, part.mY); } } diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 90c1706b5..2642a67a3 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -507,9 +507,9 @@ void Button::draw(Graphics *graphics) if (mImages) { if (isPressed()) - graphics->drawImage2(mImages[mode], imageX + 1, imageY + 1); + graphics->drawImage(mImages[mode], imageX + 1, imageY + 1); else - graphics->drawImage2(mImages[mode], imageX, imageY); + graphics->drawImage(mImages[mode], imageX, imageY); } } diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 63e32a0f9..9fb63b2e8 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -167,7 +167,7 @@ void CheckBox::drawBox(Graphics *const graphics) if (box) { - graphics->drawImage2(box, + graphics->drawImage(box, mImagePadding, (getHeight() - mImageSize) / 2); } diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index a296fb49d..5dca7578c 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -123,7 +123,7 @@ void Desktop::draw(Graphics *graphics) if (imageHelper->useOpenGL() == RENDER_SOFTWARE) { - graphics->drawImage2(mWallpaper, + graphics->drawImage(mWallpaper, (width - wallpWidth) / 2, (height - wallpHeight) / 2); } diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 763cf47a5..982b2cf0d 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -251,7 +251,7 @@ void DropDown::draw(Graphics* graphics) } else { - graphics->drawImage2(image, + graphics->drawImage(image, mImagePadding, (mDimension.height - image->getHeight()) / 2 + mPadding); font->drawString(graphics, model->getElementAt(sel), @@ -305,7 +305,7 @@ void DropDown::drawButton(Graphics *graphics) Image *image = buttons[mDroppedDown][mPushed]; if (image) { - graphics->drawImage2(image, + graphics->drawImage(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 fcb0f8ea1..c8e4bc2d9 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -143,7 +143,7 @@ void DropShortcutContainer::draw(Graphics *graphics) caption = "Eq."; image->setAlpha(1.0F); - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); if (item->isEquipped()) graphics->setColorAll(mEquipedColor, mEquipedColor2); else diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp index 2aff81955..139082815 100644 --- a/src/gui/widgets/emotepage.cpp +++ b/src/gui/widgets/emotepage.cpp @@ -101,7 +101,7 @@ void EmotePage::draw(Graphics *graphics) const Image *const image = *it; if (image) { - graphics->drawImage2(image, x, y); + graphics->drawImage(image, x, y); x += emoteWidth; if (x + emoteWidth > width) { diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index 13fb70f28..15a52ee82 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -147,7 +147,7 @@ void ExtendedListBox::draw(Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - graphics->drawImage2(image, + graphics->drawImage(image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } @@ -182,7 +182,7 @@ void ExtendedListBox::draw(Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - graphics->drawImage2(image, + graphics->drawImage(image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp index 53be9ef91..9a86fc9bf 100644 --- a/src/gui/widgets/icon.cpp +++ b/src/gui/widgets/icon.cpp @@ -74,7 +74,7 @@ void Icon::draw(Graphics *graphics) BLOCK_START("Icon::draw") if (mImage) { - graphics->drawImage2(mImage, + graphics->drawImage(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 0ea3adef1..fe666e6f7 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -276,16 +276,16 @@ void ItemContainer::draw(Graphics *graphics) if (mShowMatrix[itemIndex] == mSelectedIndex) { if (mSelImg) - graphics->drawImage2(mSelImg, itemX, itemY); + graphics->drawImage(mSelImg, itemX, itemY); } image->setAlpha(1.0F); // ensure the image if fully drawn... - graphics->drawImage2(image, + graphics->drawImage(image, itemX + mPaddingItemX, itemY + mPaddingItemY); if (mProtectedImg && PlayerInfo::isItemProtected( item->getId())) { - graphics->drawImage2(mProtectedImg, + graphics->drawImage(mProtectedImg, itemX + mPaddingItemX, itemY + mPaddingItemY); } diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 83c8820ae..b9dc3bec8 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -174,7 +174,7 @@ void ItemShortcutContainer::draw(Graphics *graphics) caption = "Eq."; image->setAlpha(1.0F); - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); if (item->isEquipped()) { graphics->setColorAll(mEquipedColor, mEquipedColor2); @@ -203,7 +203,7 @@ void ItemShortcutContainer::draw(Graphics *graphics) if (image) { image->setAlpha(1.0F); - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); } } @@ -222,7 +222,7 @@ void ItemShortcutContainer::draw(Graphics *graphics) if (image) { image->setAlpha(1.0F); - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); } font->drawString(graphics, skill->data->shortName, itemX + 2, diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 7b5c5fa11..bb9ae46f9 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -150,7 +150,7 @@ void RadioButton::drawBox(Graphics* graphics) if (box) { - graphics->drawImage2(box, + graphics->drawImage(box, mImagePadding, (getHeight() - mImageSize) / 2); } diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 2ca851254..f28f45d78 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -409,7 +409,7 @@ void ScrollArea::drawButton(Graphics *const graphics, } if (buttons[dir][state]) - graphics->drawImage2(buttons[dir][state], dim.x, dim.y); + graphics->drawImage(buttons[dir][state], dim.x, dim.y); } void ScrollArea::calcButton(Graphics *const graphics, diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 36104241d..45d3022c8 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -154,7 +154,7 @@ void ShopListBox::draw(Graphics *graphics) if (icon) { icon->setAlpha(1.0F); - graphics->drawImage2(icon, mPadding, y + mPadding); + graphics->drawImage(icon, mPadding, y + mPadding); } } if (mSelected == i) diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index a7e166da3..b059098b5 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -110,7 +110,7 @@ void ShortcutContainer::drawBackground(Graphics *g) { for (unsigned i = 0; i < mMaxItems; i ++) { - g->drawImage2(mBackgroundImg, (i % mGridWidth) * mBoxWidth, + g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth, (i / mGridWidth) * mBoxHeight); } } diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index c785f4016..7a9b38050 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -222,7 +222,7 @@ void Slider::draw(Graphics *graphics) { if (!mHasMouse) { - graphics->drawImage2(buttons[0].grid[HSTART], x, y); + graphics->drawImage(buttons[0].grid[HSTART], x, y); const int width = buttons[0].grid[HSTART]->getWidth(); w -= width + buttons[0].grid[HEND]->getWidth(); x += width; @@ -234,18 +234,18 @@ void Slider::draw(Graphics *graphics) } x += w; - graphics->drawImage2(buttons[0].grid[HEND], x, y); + graphics->drawImage(buttons[0].grid[HEND], x, y); const Image *const img = buttons[0].grid[HGRIP]; if (img) { - graphics->drawImage2(img, getMarkerPosition(), + graphics->drawImage(img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } else { - graphics->drawImage2(buttons[1].grid[HSTART], x, y); + graphics->drawImage(buttons[1].grid[HSTART], x, y); const int width = buttons[1].grid[HSTART]->getWidth(); w -= width; @@ -261,12 +261,12 @@ void Slider::draw(Graphics *graphics) x += w; if (buttons[1].grid[HEND]) - graphics->drawImage2(buttons[1].grid[HEND], x, y); + graphics->drawImage(buttons[1].grid[HEND], x, y); const Image *const img = buttons[1].grid[HGRIP]; if (img) { - graphics->drawImage2(img, getMarkerPosition(), + graphics->drawImage(img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 239fc6797..f1d4d0cd1 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -133,7 +133,7 @@ void SpellShortcutContainer::draw(Graphics *graphics) if (image) { image->setAlpha(1.0F); - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); } } diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index 2d91129f2..96ae76787 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -291,7 +291,7 @@ void Tab::draw(Graphics *graphics) if (skin1) { const int padding = skin1->getPadding(); - graphics->drawImage2(mImage, padding, padding); + graphics->drawImage(mImage, padding, padding); } } } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 3404bb573..9a43a305b 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -334,18 +334,18 @@ void Window::draw(Graphics *graphics) const Image *const button = mSkin->getCloseImage( mResizeHandles == CLOSE); if (button) - graphics->drawImage2(button, mCloseRect.x, mCloseRect.y); + graphics->drawImage(button, mCloseRect.x, mCloseRect.y); } // Draw Sticky Button if (mStickyButton) { const Image *const button = mSkin->getStickyImage(mSticky); if (button) - graphics->drawImage2(button, mStickyRect.x, mStickyRect.y); + graphics->drawImage(button, mStickyRect.x, mStickyRect.y); } if (mGrip) - graphics->drawImage2(mGrip, mGripRect.x, mGripRect.y); + graphics->drawImage(mGrip, mGripRect.x, mGripRect.y); } // Draw title diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index a50d0e9fa..ea7944f94 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -202,12 +202,12 @@ void EquipmentWindow::draw(Graphics *graphics) continue; if (i == mSelected) { - graphics->drawImage2(mSlotHighlightedBackground, + graphics->drawImage(mSlotHighlightedBackground, box->x, box->y); } else { - graphics->drawImage2(mSlotBackground, box->x, box->y); + graphics->drawImage(mSlotBackground, box->x, box->y); } } } @@ -234,7 +234,7 @@ void EquipmentWindow::draw(Graphics *graphics) { image->setAlpha(1.0F); // Ensure the image is drawn // with maximum opacity - graphics->drawImage2(image, box->x + mItemPadding, + graphics->drawImage(image, box->x + mItemPadding, box->y + mItemPadding); if (i == EQUIP_PROJECTILE_SLOT) { @@ -249,7 +249,7 @@ void EquipmentWindow::draw(Graphics *graphics) } else if (box->image) { - graphics->drawImage2(box->image, + graphics->drawImage(box->image, box->x + mItemPadding, box->y + mItemPadding); } diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index dd8a1d2b7..4c246aed4 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -284,7 +284,7 @@ void Minimap::draw(Graphics *graphics) mMapOriginY = 0; } - graphics->drawImage2(mMapImage, mMapOriginX, mMapOriginY); + graphics->drawImage(mMapImage, mMapOriginX, mMapOriginY); } const ActorSprites &actors = actorManager->getAll(); diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index acf681cf4..0f25b84a6 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -347,7 +347,7 @@ void OutfitWindow::draw(Graphics *graphics) const Image *const image = item->getImage(); if (image) { - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); foundItem = true; } } @@ -358,7 +358,7 @@ void OutfitWindow::draw(Graphics *graphics) mItemColors[mCurrentOutfit][i]); if (image) { - graphics->drawImage2(image, itemX, itemY); + graphics->drawImage(image, itemX, itemY); image->decRef(); } } diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index d39d7061b..1346c8e95 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -135,7 +135,7 @@ class SkillListBox final : public ListBox const SkillData *const data = e->data; const int yPad = y + mPadding; const std::string &description = data->description; - graphics->drawImage2(data->icon, mPadding, yPad); + graphics->drawImage(data->icon, mPadding, yPad); font->drawString(graphics, data->name, mTextPadding, yPad); if (!description.empty()) { diff --git a/src/imagesprite.cpp b/src/imagesprite.cpp index c40e49856..965c333bf 100644 --- a/src/imagesprite.cpp +++ b/src/imagesprite.cpp @@ -56,5 +56,5 @@ void ImageSprite::draw(Graphics *const graphics, return; mImage->setAlpha(mAlpha); - graphics->drawImage2(mImage, posX, posY); + graphics->drawImage(mImage, posX, posY); } diff --git a/src/maplayer.cpp b/src/maplayer.cpp index 93434aca9..5779190a9 100644 --- a/src/maplayer.cpp +++ b/src/maplayer.cpp @@ -140,7 +140,7 @@ void MapLayer::draw(Graphics *const graphics, if (!c) { - graphics->drawImage2(img, px, py); + graphics->drawImage(img, px, py); } else { @@ -456,7 +456,7 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY, if (!c) { - graphics->drawImage2(img, px, py); + graphics->drawImage(img, px, py); } else { @@ -798,7 +798,7 @@ void MapItem::draw(Graphics *const graphics, const int x, const int y, { BLOCK_START("MapItem::draw") if (mImage) - graphics->drawImage2(mImage, x, y); + graphics->drawImage(mImage, x, y); switch (mType) { diff --git a/src/particle/imageparticle.cpp b/src/particle/imageparticle.cpp index e41c072b4..92f458e41 100644 --- a/src/particle/imageparticle.cpp +++ b/src/particle/imageparticle.cpp @@ -103,6 +103,6 @@ void ImageParticle::draw(Graphics *const graphics, } mImage->setAlpha(alphafactor); - graphics->drawImage2(mImage, screenX, screenY); + graphics->drawImage(mImage, screenX, screenY); return; } diff --git a/src/render/graphics.h b/src/render/graphics.h index 35e2a3ba3..14784a408 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -377,8 +377,8 @@ class Graphics * @return <code>true</code> if the image was blitted properly * <code>false</code> otherwise. */ - virtual bool drawImage2(const Image *const image, - int dstX, int dstY) = 0; + virtual bool drawImage(const Image *const image, + int dstX, int dstY) = 0; virtual void drawImageCached(const Image *const image, int srcX, int srcY) = 0; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index a2f7909ff..b306cf021 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -219,7 +219,7 @@ static inline void drawRescaledQuad(const Image *const image, } } -bool MobileOpenGLGraphics::drawImage2(const Image *const image, +bool MobileOpenGLGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -228,7 +228,7 @@ bool MobileOpenGLGraphics::drawImage2(const Image *const image, bool MobileOpenGLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) if (!image) return false; diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 67a18bde5..0a57c8341 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -286,7 +286,7 @@ static inline void drawRescaledQuad(const Image *const image, } } -bool NormalOpenGLGraphics::drawImage2(const Image *const image, +bool NormalOpenGLGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -295,7 +295,7 @@ bool NormalOpenGLGraphics::drawImage2(const Image *const image, bool NormalOpenGLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) if (!image) return false; diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 6018247f9..8dd4ca91f 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -139,7 +139,7 @@ static inline void drawRescaledQuad(const Image *const image A_UNUSED, } } -bool NullOpenGLGraphics::drawImage2(const Image *const image, +bool NullOpenGLGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -148,7 +148,7 @@ bool NullOpenGLGraphics::drawImage2(const Image *const image, bool NullOpenGLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) if (!image) return false; diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp index a582d9043..d3fcebf81 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -130,8 +130,8 @@ void updateTextureFormat(); - bool drawImage2(const Image *const image, - int dstX, int dstY) override final; + bool drawImage(const Image *const image, + int dstX, int dstY) override final; void drawImageCached(const Image *const image, int x, int y) override final; diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index c1c266464..342495a47 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -142,7 +142,7 @@ static inline void drawRescaledQuad(const Image *const image, } } -bool SafeOpenGLGraphics::drawImage2(const Image *const image, +bool SafeOpenGLGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -151,7 +151,7 @@ bool SafeOpenGLGraphics::drawImage2(const Image *const image, bool SafeOpenGLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) if (!image) return false; diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 053049cef..ac7d8debc 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -157,7 +157,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, &srcRect, &dstRect) < 0); } -bool SDLGraphics::drawImage2(const Image *const image, +bool SDLGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -166,7 +166,7 @@ bool SDLGraphics::drawImage2(const Image *const image, bool SDLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. if (!mWindow || !image || !image->mTexture) return false; diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index cce15e270..6631e53f4 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -182,8 +182,8 @@ class SDLGraphics final : public Graphics void setRendererFlags(const uint32_t flags) { mRendererFlags = flags; } - bool drawImage2(const Image *const image, - int dstX, int dstY) override final; + bool drawImage(const Image *const image, + int dstX, int dstY) override final; void drawImageCached(const Image *const image, int x, int y) override final; diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 05b1fa2ef..016a9557e 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -109,7 +109,7 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, return returnValue; } -bool SDL2SoftwareGraphics::drawImage2(const Image *const image, +bool SDL2SoftwareGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -118,7 +118,7 @@ bool SDL2SoftwareGraphics::drawImage2(const Image *const image, bool SDL2SoftwareGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. if (!mSurface || !image || !image->mSDLSurface) return false; diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 270536e11..1211de5eb 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -141,8 +141,8 @@ class SDL2SoftwareGraphics final : public Graphics bool resizeScreen(const int width, const int height) override final; - bool drawImage2(const Image *const image, - int dstX, int dstY) override final; + bool drawImage(const Image *const image, + int dstX, int dstY) override final; void drawImageCached(const Image *const image, int x, int y) override final; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 9694eb0fb..05c57a952 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -103,7 +103,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, return returnValue; } -bool SDLGraphics::drawImage2(const Image *const image, +bool SDLGraphics::drawImage(const Image *const image, int dstX, int dstY) { return drawImageInline(image, dstX, dstY); @@ -112,7 +112,7 @@ bool SDLGraphics::drawImage2(const Image *const image, bool SDLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. if (!mWindow || !image || !image->mSDLSurface) return false; diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index f5ca099de..c8565f4be 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -136,8 +136,8 @@ class SDLGraphics final : public Graphics const bool resize, const bool noFrame) override final; - bool drawImage2(const Image *const image, - int dstX, int dstY) override final; + bool drawImage(const Image *const image, + int dstX, int dstY) override final; void drawImageCached(const Image *const image, int x, int y) override final; diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index 8834bb171..d9cb03136 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -42,10 +42,10 @@ SurfaceGraphics::~SurfaceGraphics() { } -bool SurfaceGraphics::drawImage2(const Image *const image, +bool SurfaceGraphics::drawImage(const Image *const image, int dstX, int dstY) { - FUNC_BLOCK("Graphics::drawImage2", 1) + FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. if (!mTarget || !image || !image->mSDLSurface) return false; diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index cadd19876..89de995ee 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -179,8 +179,8 @@ class SurfaceGraphics final : public Graphics const bool noFrame A_UNUSED) override final { return false; } - bool drawImage2(const Image *const image, - int dstX, int dstY) override final; + bool drawImage(const Image *const image, + int dstX, int dstY) override final; void drawImageCached(const Image *const image, int x, int y) override final; diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp index 71a6382dc..870de40a9 100644 --- a/src/resources/atlasmanager.cpp +++ b/src/resources/atlasmanager.cpp @@ -250,7 +250,7 @@ SDL_Surface *AtlasManager::createSDLAtlas(TextureAtlas *const atlas) #else SDL_SetAlpha(image->mSDLSurface, 0, SDL_ALPHA_OPAQUE); #endif - graphics->drawImage2(image, item->x, item->y); + graphics->drawImage(image, item->x, item->y); } } } diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 1409146df..075c98c06 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -78,8 +78,9 @@ void SimpleAnimation::draw(Graphics *const graphics, if (!mCurrentFrame || !mCurrentFrame->image) return; - graphics->drawImage2(mCurrentFrame->image, - posX + mCurrentFrame->offsetX, posY + mCurrentFrame->offsetY); + graphics->drawImage(mCurrentFrame->image, + posX + mCurrentFrame->offsetX, + posY + mCurrentFrame->offsetY); } void SimpleAnimation::reset() diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index a0e4f98dc..584bdb5cb 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -94,7 +94,7 @@ int TestLauncher::testBackend() const for (int f = 0; f < cnt; f ++) { - mainGraphics->drawImage2(img, cnt * 7, cnt * 5); + mainGraphics->drawImage(img, cnt * 7, cnt * 5); mainGraphics->updateScreen(); } @@ -152,11 +152,11 @@ int TestLauncher::testFps() { for (int y = 0; y < 600; y += 50) { - mainGraphics->drawImage2(img[idx], x, y); + mainGraphics->drawImage(img[idx], x, y); idx ++; if (idx > sz) idx = 0; - mainGraphics->drawImage2(img[idx], x, y); + mainGraphics->drawImage(img[idx], x, y); idx ++; if (idx > sz) idx = 0; @@ -211,9 +211,9 @@ int TestLauncher::testInternal() { for (int y = 0; y < 600; y += 25) { - mainGraphics->drawImage2(img[idx], x, y); - mainGraphics->drawImage2(img[idx], x + 1, y); - mainGraphics->drawImage2(img[idx], x, y + 5); + mainGraphics->drawImage(img[idx], x, y); + mainGraphics->drawImage(img[idx], x + 1, y); + mainGraphics->drawImage(img[idx], x, y + 5); idx ++; if (idx > 3) diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index f560b8817..bb222c3e8 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -232,7 +232,7 @@ void TouchManager::draw() const Image *const icon = item->icon; if (icon) { - mainGraphics->drawImage2(icon, + mainGraphics->drawImage(icon, item->x + (item->width - icon->mBounds.w) / 2, item->y + (item->height - icon->mBounds.h) / 2); } |