From fdfd38278cba5fa37d203d0d29b4981e400a529a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 28 Apr 2016 20:18:27 +0300 Subject: Fix overload virtual warning with SDL2. --- src/being/compoundsprite.cpp | 4 ++-- src/gui/windows/minimap.cpp | 2 +- src/resources/atlas/atlasmanager.cpp | 5 +++-- src/resources/image.cpp | 2 +- src/resources/imagehelper.cpp | 4 ++-- src/resources/imagehelper.h | 5 +++-- src/resources/openglimagehelper.cpp | 4 ++-- src/resources/openglimagehelper.h | 4 ++-- src/resources/safeopenglimagehelper.cpp | 4 ++-- src/resources/safeopenglimagehelper.h | 2 +- src/resources/sdl2imagehelper.cpp | 2 +- src/resources/sdl2imagehelper.h | 4 ++-- src/resources/sdl2softwareimagehelper.cpp | 2 +- src/resources/sdl2softwareimagehelper.h | 3 ++- src/resources/sdlimagehelper.cpp | 4 ++-- src/resources/sdlimagehelper.h | 3 ++- src/resources/surfaceimagehelper.cpp | 2 +- src/resources/surfaceimagehelper.h | 4 ++-- src/test/testlauncher.cpp | 2 +- 19 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index af2e60d55..ef97b973d 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -375,12 +375,12 @@ void CompoundSprite::redraw() const delete mImage; delete mAlphaImage; - mImage = imageHelper->load(surface); + mImage = imageHelper->loadSurface(surface); MSDL_FreeSurface(surface); if (ImageHelper::mEnableAlpha) { - mAlphaImage = imageHelper->load(surfaceA); + mAlphaImage = imageHelper->loadSurface(surfaceA); MSDL_FreeSurface(surfaceA); } else diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 291cb7a7a..c7eeb6250 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -162,7 +162,7 @@ void Minimap::setMap(const Map *const map) SDL_UnlockSurface(surface); - mMapImage = imageHelper->load(surface); + mMapImage = imageHelper->loadSurface(surface); mMapImage->setAlpha(settings.guiAlpha); mCustomMapImage = true; MSDL_FreeSurface(surface); diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp index 8b4eb4187..03d0b40fd 100644 --- a/src/resources/atlas/atlasmanager.cpp +++ b/src/resources/atlas/atlasmanager.cpp @@ -257,7 +257,7 @@ SDL_Surface *AtlasManager::createSDLAtlas(TextureAtlas *const atlas) } BLOCK_END("AtlasManager::createSDLAtlas create surface") - Image *image = imageHelper->load(surface); + Image *image = imageHelper->loadSurface(surface); // drawing SDL images to surface FOR_EACH (std::vector::iterator, it, atlas->items) @@ -282,7 +282,8 @@ void AtlasManager::convertAtlas(TextureAtlas *const atlas) if (oldImage->mSDLSurface) { - atlas->atlasImage = imageHelper->load(atlas->atlasImage->mSDLSurface); + atlas->atlasImage = imageHelper->loadSurface( + atlas->atlasImage->mSDLSurface); oldImage->decRef(); } diff --git a/src/resources/image.cpp b/src/resources/image.cpp index aaa779360..a537ebc75 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -428,7 +428,7 @@ Image* Image::SDLgetScaledImage(const int width, const int height) const // and about freeing the given SDL_surface*. if (scaledSurface) { - scaledImage = imageHelper->load(scaledSurface); + scaledImage = imageHelper->loadSurface(scaledSurface); MSDL_FreeSurface(scaledSurface); } } diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index af573709b..1067058b2 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -48,7 +48,7 @@ Image *ImageHelper::load(SDL_RWops *const rw) return nullptr; } - Image *const image = load(tmpImage); + Image *const image = loadSurface(tmpImage); MSDL_FreeSurface(tmpImage); return image; @@ -116,7 +116,7 @@ Image *ImageHelper::load(SDL_RWops *const rw, Dye const &dye) } } - Image *const image = load(surf); + Image *const image = loadSurface(surf); MSDL_FreeSurface(surf); BLOCK_END("ImageHelper::load") return image; diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h index 897e01458..f869c0f93 100644 --- a/src/resources/imagehelper.h +++ b/src/resources/imagehelper.h @@ -59,16 +59,17 @@ class ImageHelper notfinal virtual Image *load(SDL_RWops *const rw, Dye const &dye) A_WARN_UNUSED; #ifdef __GNUC__ - virtual Image *load(SDL_Surface *const) A_WARN_UNUSED = 0; + virtual Image *loadSurface(SDL_Surface *const) A_WARN_UNUSED = 0; virtual Image *createTextSurface(SDL_Surface *const tmpImage, const int width, const int height, float alpha) A_WARN_UNUSED = 0; #else - virtual Image *load(SDL_Surface *) A_WARN_UNUSED + virtual Image *loadSurface(SDL_Surface *const) A_WARN_UNUSED { return nullptr; } virtual Image *createTextSurface(SDL_Surface *const tmpImage, + const int width, const int height, const float alpha) const A_WARN_UNUSED { return nullptr; } #endif diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index 3820efdb8..111dbe58e 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -103,12 +103,12 @@ Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye) } } - Image *const image = load(surf); + Image *const image = loadSurface(surf); MSDL_FreeSurface(surf); return image; } -Image *OpenGLImageHelper::load(SDL_Surface *const tmpImage) +Image *OpenGLImageHelper::loadSurface(SDL_Surface *const tmpImage) { return glLoad(tmpImage); } diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h index 0c7e49c8f..889b76abf 100644 --- a/src/resources/openglimagehelper.h +++ b/src/resources/openglimagehelper.h @@ -83,8 +83,8 @@ class OpenGLImageHelper final : public ImageHelper /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) - override final A_WARN_UNUSED; + Image *loadSurface(SDL_Surface *const tmpImage) override final + A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, const int width, const int height, diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp index dd5a5649f..41b2c5d89 100644 --- a/src/resources/safeopenglimagehelper.cpp +++ b/src/resources/safeopenglimagehelper.cpp @@ -101,12 +101,12 @@ Image *SafeOpenGLImageHelper::load(SDL_RWops *const rw, } } - Image *const image = load(surf); + Image *const image = loadSurface(surf); MSDL_FreeSurface(surf); return image; } -Image *SafeOpenGLImageHelper::load(SDL_Surface *const tmpImage) +Image *SafeOpenGLImageHelper::loadSurface(SDL_Surface *const tmpImage) { return glLoad(tmpImage); } diff --git a/src/resources/safeopenglimagehelper.h b/src/resources/safeopenglimagehelper.h index 9b65f5262..2a26c2400 100644 --- a/src/resources/safeopenglimagehelper.h +++ b/src/resources/safeopenglimagehelper.h @@ -83,7 +83,7 @@ class SafeOpenGLImageHelper final : public ImageHelper /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) + Image *loadSurface(SDL_Surface *const tmpImage) override final A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, diff --git a/src/resources/sdl2imagehelper.cpp b/src/resources/sdl2imagehelper.cpp index 2b7af1dd8..9cca68e21 100644 --- a/src/resources/sdl2imagehelper.cpp +++ b/src/resources/sdl2imagehelper.cpp @@ -45,7 +45,7 @@ bool SDLImageHelper::mEnableAlphaCache = false; SDL_Renderer *SDLImageHelper::mRenderer = nullptr; #endif -Image *SDLImageHelper::load(SDL_Surface *const tmpImage) +Image *SDLImageHelper::loadSurface(SDL_Surface *const tmpImage) { return _SDLload(tmpImage); } diff --git a/src/resources/sdl2imagehelper.h b/src/resources/sdl2imagehelper.h index c1065e957..dd88887f3 100644 --- a/src/resources/sdl2imagehelper.h +++ b/src/resources/sdl2imagehelper.h @@ -54,8 +54,8 @@ class SDLImageHelper final : public ImageHelper /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) - override final A_WARN_UNUSED; + Image *loadSurface(SDL_Surface *const tmpImage) override final + A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, const int width, const int height, diff --git a/src/resources/sdl2softwareimagehelper.cpp b/src/resources/sdl2softwareimagehelper.cpp index 056ef226e..5b9ffce14 100644 --- a/src/resources/sdl2softwareimagehelper.cpp +++ b/src/resources/sdl2softwareimagehelper.cpp @@ -42,7 +42,7 @@ bool SDL2SoftwareImageHelper::mEnableAlphaCache = false; SDL_PixelFormat *SDL2SoftwareImageHelper::mFormat = nullptr; -Image *SDL2SoftwareImageHelper::load(SDL_Surface *const tmpImage) +Image *SDL2SoftwareImageHelper::loadSurface(SDL_Surface *const tmpImage) { return _SDLload(tmpImage); } diff --git a/src/resources/sdl2softwareimagehelper.h b/src/resources/sdl2softwareimagehelper.h index d8a9d218e..a62937bf7 100644 --- a/src/resources/sdl2softwareimagehelper.h +++ b/src/resources/sdl2softwareimagehelper.h @@ -54,7 +54,8 @@ class SDL2SoftwareImageHelper final : public ImageHelper /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) override final A_WARN_UNUSED; + Image *loadSurface(SDL_Surface *const tmpImage) override final + A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, const int width, const int height, diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index e61391d14..ad046221f 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -102,12 +102,12 @@ Image *SDLImageHelper::load(SDL_RWops *const rw, Dye const &dye) } } - Image *const image = load(surf); + Image *const image = loadSurface(surf); MSDL_FreeSurface(surf); return image; } -Image *SDLImageHelper::load(SDL_Surface *const tmpImage) +Image *SDLImageHelper::loadSurface(SDL_Surface *const tmpImage) { return _SDLload(tmpImage); } diff --git a/src/resources/sdlimagehelper.h b/src/resources/sdlimagehelper.h index 731e1a14e..4e1f37a7b 100644 --- a/src/resources/sdlimagehelper.h +++ b/src/resources/sdlimagehelper.h @@ -67,7 +67,8 @@ class SDLImageHelper final : public ImageHelper /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) override final A_WARN_UNUSED; + Image *loadSurface(SDL_Surface *const tmpImage) override final + A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, const int width, const int height, diff --git a/src/resources/surfaceimagehelper.cpp b/src/resources/surfaceimagehelper.cpp index 7c3571db4..69e011219 100644 --- a/src/resources/surfaceimagehelper.cpp +++ b/src/resources/surfaceimagehelper.cpp @@ -41,7 +41,7 @@ bool SurfaceImageHelper::mEnableAlphaCache = false; -Image *SurfaceImageHelper::load(SDL_Surface *const tmpImage) +Image *SurfaceImageHelper::loadSurface(SDL_Surface *const tmpImage) { return _SDLload(tmpImage); } diff --git a/src/resources/surfaceimagehelper.h b/src/resources/surfaceimagehelper.h index c028748e7..9b3692946 100644 --- a/src/resources/surfaceimagehelper.h +++ b/src/resources/surfaceimagehelper.h @@ -56,8 +56,8 @@ class SurfaceImageHelper final : public ImageHelper /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) - override final A_WARN_UNUSED; + Image *loadSurface(SDL_Surface *const tmpImage) override final + A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, const int width, const int height, diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index 2210e3c33..7c4e0c53a 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -326,7 +326,7 @@ int TestLauncher::testTextures() pixels[f] = bytes1[f]; graphicsManager.getLastError(); graphicsManager.resetCachedError(); - Image *const image = imageHelper->load(surface); + Image *const image = imageHelper->loadSurface(surface); SDL_FreeSurface(surface); if (!image) break; -- cgit v1.2.3-60-g2f50