diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-10-16 01:03:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-10-16 01:03:02 +0300 |
commit | e15da561988948de26c80105dc9762943009b9e7 (patch) | |
tree | 717dbdffe08daf6a1832ce79043697d3f7e62a23 | |
parent | 71cfaf012217cf3bbbc39207a12131b748535fcc (diff) | |
download | mv-e15da561988948de26c80105dc9762943009b9e7.tar.gz mv-e15da561988948de26c80105dc9762943009b9e7.tar.bz2 mv-e15da561988948de26c80105dc9762943009b9e7.tar.xz mv-e15da561988948de26c80105dc9762943009b9e7.zip |
Fix code style, ignore some warning in clang-tidy
41 files changed, 75 insertions, 75 deletions
diff --git a/.clang-tidy b/.clang-tidy index a373393d6..1d16bce1a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-llvm-header-guard,-cppcoreguidelines-special-member-functions,-readability-avoid-const-params-in-decls,-modernize-use-equals-default,-hicpp-use-override,-hicpp-special-member-functions,-readability-redundant-member-init,-hicpp-use-equals-default,-modernize-use-using,-modernize-use-override,-cert-err58-cpp,-modernize-use-default-member-init,-google-runtime-references,-modernize-pass-by-value,-misc-misplaced-const,-cppcoreguidelines-pro-type-const-cast,-readability-else-after-return,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-modernize-loop-convert,-modernize-use-auto,-readability-simplify-boolean-expr,-readability-inconsistent-declaration-parameter-name,-cert-msc30-c,-cert-msc50-cpp,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-union-access,-llvm-include-order,-google-runtime-int,-cppcoreguidelines-pro-type-member-init,-modernize-use-emplace,-hicpp-member-init,-cert-err34-c,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-no-malloc,-cert-dcl50-cpp,-clang-analyzer-core.CallAndMessage,-misc-macro-parentheses,-cppcoreguidelines-interfaces-global-init,-readability-redundant-string-cstr,-google-default-arguments,-cert-err52-cpp,-cert-env33-c,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-cplusplus.NewDelete,-modernize-raw-string-literal,-clang-analyzer-core.DivideZero,-misc-misplaced-widening-cast,-modernize-return-braced-init-list,-clang-analyzer-core.NullDereference,-google-readability-function-size,-readability-function-size,-clang-analyzer-security.insecureAPI.strcpy,-CWE-119,-performance-type-promotion-in-math-fn,-google-readability-todo,-clang-analyzer-deadcode.DeadStores,-hicpp-function-size,-misc-definitions-in-headers,-misc-incorrect-roundings,-google-runtime-member-string-references,-google-explicit-constructor,-readability-misleading-indentation,-cert-dcl58-cpp,-hicpp-use-equals-delete,-misc-string-literal-with-embedded-nul,-hicpp-explicit-conversions,-modernize-use-equals-delete,-google-readability-braces-around-statements,-readability-braces-around-statements,-readability-redundant-declaration,-fuchsia-statically-constructed-objects,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-abseil-string-find-startswith,-clang-analyzer-core.StackAddressEscape,-abseil-string-find-startswith,-hicpp-multiway-paths-covered,-fuchsia-multiple-inheritance,-cppcoreguidelines-narrowing-conversions,-bugprone-misplaced-widening-cast,-bugprone-string-literal-with-embedded-nul,-bugprone-incorrect-roundings,-bugprone-parent-virtual-call,-cert-msc32-c,-cppcoreguidelines-narrowing-conversions,-cert-msc51-cpp,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-avoid-c-arrays,-readability-magic-numbers,-cppcoreguidelines-macro-usage' +Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-llvm-header-guard,-cppcoreguidelines-special-member-functions,-readability-avoid-const-params-in-decls,-modernize-use-equals-default,-hicpp-use-override,-hicpp-special-member-functions,-readability-redundant-member-init,-hicpp-use-equals-default,-modernize-use-using,-modernize-use-override,-cert-err58-cpp,-modernize-use-default-member-init,-google-runtime-references,-modernize-pass-by-value,-misc-misplaced-const,-cppcoreguidelines-pro-type-const-cast,-readability-else-after-return,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-modernize-loop-convert,-modernize-use-auto,-readability-simplify-boolean-expr,-readability-inconsistent-declaration-parameter-name,-cert-msc30-c,-cert-msc50-cpp,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-union-access,-llvm-include-order,-google-runtime-int,-cppcoreguidelines-pro-type-member-init,-modernize-use-emplace,-hicpp-member-init,-cert-err34-c,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-no-malloc,-cert-dcl50-cpp,-clang-analyzer-core.CallAndMessage,-misc-macro-parentheses,-cppcoreguidelines-interfaces-global-init,-readability-redundant-string-cstr,-google-default-arguments,-cert-err52-cpp,-cert-env33-c,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-cplusplus.NewDelete,-modernize-raw-string-literal,-clang-analyzer-core.DivideZero,-misc-misplaced-widening-cast,-modernize-return-braced-init-list,-clang-analyzer-core.NullDereference,-google-readability-function-size,-readability-function-size,-clang-analyzer-security.insecureAPI.strcpy,-CWE-119,-performance-type-promotion-in-math-fn,-google-readability-todo,-clang-analyzer-deadcode.DeadStores,-hicpp-function-size,-misc-definitions-in-headers,-misc-incorrect-roundings,-google-runtime-member-string-references,-google-explicit-constructor,-readability-misleading-indentation,-cert-dcl58-cpp,-hicpp-use-equals-delete,-misc-string-literal-with-embedded-nul,-hicpp-explicit-conversions,-modernize-use-equals-delete,-google-readability-braces-around-statements,-readability-braces-around-statements,-readability-redundant-declaration,-fuchsia-statically-constructed-objects,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-abseil-string-find-startswith,-clang-analyzer-core.StackAddressEscape,-abseil-string-find-startswith,-hicpp-multiway-paths-covered,-fuchsia-multiple-inheritance,-cppcoreguidelines-narrowing-conversions,-bugprone-misplaced-widening-cast,-bugprone-string-literal-with-embedded-nul,-bugprone-incorrect-roundings,-bugprone-parent-virtual-call,-cert-msc32-c,-cppcoreguidelines-narrowing-conversions,-cert-msc51-cpp,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-avoid-c-arrays,-readability-magic-numbers,-cppcoreguidelines-macro-usage,-hicpp-avoid-c-arrays,-readability-const-return-type,-modernize-avoid-c-arrays' HeaderFilterRegex: '*' AnalyzeTemporaryDtors: false CheckOptions: diff --git a/src/game.cpp b/src/game.cpp index de070c7f9..e747bf6bb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -175,7 +175,7 @@ static void initEngines() particleEngine = new ParticleEngine; particleEngine->setMap(nullptr); - particleEngine->setupEngine(); + ParticleEngine::setupEngine(); BeingInfo::init(); if (gameHandler != nullptr) diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index dfe7c99af..88d3d26ef 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -47,7 +47,7 @@ SpellShortcutContainer::SpellShortcutContainer(Widget2 *const widget, mSpellClicked(false) { if (spellShortcut != nullptr) - mMaxItems = spellShortcut->getSpellsCount(); + mMaxItems = SpellShortcut::getSpellsCount(); else mMaxItems = 0; } diff --git a/src/gui/widgets/tabs/chat/emulateguildtab.cpp b/src/gui/widgets/tabs/chat/emulateguildtab.cpp index 88bff63c6..16b3e2c2e 100644 --- a/src/gui/widgets/tabs/chat/emulateguildtab.cpp +++ b/src/gui/widgets/tabs/chat/emulateguildtab.cpp @@ -82,7 +82,7 @@ void EmulateGuildTab::getAutoCompleteList(StringVect &names) const if (guildManager == nullptr) return; - guildManager->getNames(names); + GuildManager::getNames(names); } void EmulateGuildTab::getAutoCompleteCommands(StringVect &names) const diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 0f0970c51..f96cf976d 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -253,7 +253,7 @@ void ChatWindow::loadCommandsFile(const std::string &name) void ChatWindow::fillCommands() { loadCommandsFile("chatcommands.txt"); - inputManager.addChatCommands(mCommands); + InputManager::addChatCommands(mCommands); } void ChatWindow::loadGMCommands() @@ -1531,7 +1531,7 @@ std::string ChatWindow::autoComplete(const StringVect &names, } std::string ChatWindow::autoComplete(const std::string &partName, - const History *const words) const + const History *const words) { if (words == nullptr) return ""; diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 8e3a3cec0..f40690c3d 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -330,8 +330,8 @@ class ChatWindow final : public Window, std::string autoCompleteHistory(const std::string &partName) const; - std::string autoComplete(const std::string &partName, - const History *const words) const; + static std::string autoComplete(const std::string &partName, + const History *const words); static std::string autoComplete(const StringVect &names, std::string partName); diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index 9af91a754..94f3bb82d 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -276,7 +276,7 @@ void Mail2Recv::processCheckNameResult(Net::MessageIn &msg) } else { - mailWindow->createMail(mail->to); + MailWindow::createMail(mail->to); } break; case MailQueueType::ValidateTo: diff --git a/src/net/tmwa/guildmanager.cpp b/src/net/tmwa/guildmanager.cpp index c0834a6bd..a845bbb2e 100644 --- a/src/net/tmwa/guildmanager.cpp +++ b/src/net/tmwa/guildmanager.cpp @@ -129,7 +129,7 @@ void GuildManager::chat(const std::string &msg) mTab->chatLog(localPlayer->getName(), msg); } -void GuildManager::getNames(StringVect &names) const +void GuildManager::getNames(StringVect &names) { const Guild *const guild = createGuild(); if (guild != nullptr) @@ -240,7 +240,7 @@ void GuildManager::createTab(Guild *const guild) } } -Guild *GuildManager::createGuild() const +Guild *GuildManager::createGuild() { Guild *const guild = Guild::getGuild(1); if (guild == nullptr) diff --git a/src/net/tmwa/guildmanager.h b/src/net/tmwa/guildmanager.h index 1a089d342..7c5a8fd32 100644 --- a/src/net/tmwa/guildmanager.h +++ b/src/net/tmwa/guildmanager.h @@ -46,7 +46,7 @@ class GuildManager final static void send(const std::string &msg); - void getNames(StringVect &names) const; + static void getNames(StringVect &names); void requestGuildInfo(); @@ -65,7 +65,7 @@ class GuildManager final void createTab(Guild *const guild); - Guild *createGuild() const A_WARN_UNUSED; + static Guild *createGuild() A_WARN_UNUSED; static void clear(); diff --git a/src/progs/dyecmd/dyemain.cpp b/src/progs/dyecmd/dyemain.cpp index b4ff54af5..bc2a72cf9 100644 --- a/src/progs/dyecmd/dyemain.cpp +++ b/src/progs/dyecmd/dyemain.cpp @@ -87,7 +87,7 @@ int main(int argc, char **argv) Cpu::detect(); DyePalette::initFunctions(); - graphicsManager.createWindow(10, 10, 0, SDL_ANYFORMAT); + GraphicsManager::createWindow(10, 10, 0, SDL_ANYFORMAT); #ifdef USE_SDL2 imageHelper = new SurfaceImageHelper; diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 2993904ce..1a351d268 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -2004,9 +2004,9 @@ impHandler(seen) impHandler(dumpMemoryUsage) { if (event.tab != nullptr) - memoryManager.printAllMemory(event.tab); + MemoryManager::printAllMemory(event.tab); else - memoryManager.printAllMemory(localChatTab); + MemoryManager::printAllMemory(localChatTab); return true; } diff --git a/src/progs/manaplus/actions/chat.cpp b/src/progs/manaplus/actions/chat.cpp index ce63419cf..22d0656cb 100644 --- a/src/progs/manaplus/actions/chat.cpp +++ b/src/progs/manaplus/actions/chat.cpp @@ -779,7 +779,7 @@ impHandler(sendGuiKey) } if (sz == 2) { - const InputActionT actionId = inputManager.getActionByConfigField( + const InputActionT actionId = InputManager::getActionByConfigField( pars[1]); guiInput->simulateKey(keyValue, actionId); } diff --git a/src/progs/manaplus/actions/commands.cpp b/src/progs/manaplus/actions/commands.cpp index ba4ae0d61..dd58c221b 100644 --- a/src/progs/manaplus/actions/commands.cpp +++ b/src/progs/manaplus/actions/commands.cpp @@ -1670,7 +1670,7 @@ impHandler(mailTo) } else { - mailWindow->createMail(args); + MailWindow::createMail(args); } return true; } diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 7bbb75822..cd88c25dd 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -283,7 +283,7 @@ bool Graphics::setOpenGLMode() restrict2 { #ifdef USE_OPENGL SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if ((mWindow = graphicsManager.createWindow( + if ((mWindow = GraphicsManager::createWindow( mActualWidth, mActualHeight, mBpp, getOpenGLFlags())) == nullptr) { diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index bd94b2380..36c757005 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -752,7 +752,7 @@ bool SDLGraphics::setVideoMode(const int w, const int h, noFrame, allowHighDPI); - if (!(mWindow = graphicsManager.createWindow(w, h, bpp, + if (!(mWindow = GraphicsManager::createWindow(w, h, bpp, getSoftwareFlags()))) { mRect.w = 0; diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 38e1604b4..8eb0519f5 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -1477,7 +1477,7 @@ bool SDL2SoftwareGraphics::setVideoMode(const int w, const int h, noFrame, allowHighDPI); - if (!(mWindow = graphicsManager.createWindow(w, h, bpp, + if (!(mWindow = GraphicsManager::createWindow(w, h, bpp, getSoftwareFlags()))) { mRect.w = 0; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 118e154da..c165be7db 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -1489,7 +1489,7 @@ bool SDLGraphics::setVideoMode(const int w, const int h, noFrame, allowHighDPI); - if ((mWindow = graphicsManager.createWindow(w, h, bpp, + if ((mWindow = GraphicsManager::createWindow(w, h, bpp, getSoftwareFlags())) == nullptr) { mRect.w = 0; diff --git a/src/resources/image/image.cpp b/src/resources/image/image.cpp index 967fc17b8..171e035de 100644 --- a/src/resources/image/image.cpp +++ b/src/resources/image/image.cpp @@ -513,7 +513,7 @@ int Image::calcMemoryLocal() const if (mSDLSurface != nullptr) { sz += CAST_S32(mAlphaCache.size()) * - memoryManager.getSurfaceSize(mSDLSurface); + MemoryManager::getSurfaceSize(mSDLSurface); } return sz; } diff --git a/src/resources/memorycounter.cpp b/src/resources/memorycounter.cpp index 826dcf3e2..13b742c8c 100644 --- a/src/resources/memorycounter.cpp +++ b/src/resources/memorycounter.cpp @@ -37,7 +37,7 @@ int MemoryCounter::calcMemory(const int level) const { const int sumLocal = calcMemoryLocal(); const int sumChilds = calcMemoryChilds(level); - memoryManager.printMemory(getCounterName(), + MemoryManager::printMemory(getCounterName(), level, sumLocal, sumChilds); diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index 0764fe94f..74d079541 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -652,7 +652,7 @@ int calcMemoryLocal() int sz = 24; FOR_EACH (std::set<SDL_Surface*>::iterator, it, deletedSurfaces) { - sz += memoryManager.getSurfaceSize(*it); + sz += MemoryManager::getSurfaceSize(*it); } return sz; } @@ -681,7 +681,7 @@ int calcMemory(const int level) { const int sumLocal = calcMemoryLocal(); const int sumChilds = calcMemoryChilds(0); - memoryManager.printMemory("resource manager", + MemoryManager::printMemory("resource manager", level, sumLocal, sumChilds); diff --git a/src/unittests/gui/widgets/browserbox.cc b/src/unittests/gui/widgets/browserbox.cc index 009474031..737cf547c 100644 --- a/src/unittests/gui/widgets/browserbox.cc +++ b/src/unittests/gui/widgets/browserbox.cc @@ -65,11 +65,11 @@ TEST_CASE("BrowserBox tests", "browserbox") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/gui/widgets/staticbrowserbox.cc b/src/unittests/gui/widgets/staticbrowserbox.cc index 0c429e19c..4efd3f87c 100644 --- a/src/unittests/gui/widgets/staticbrowserbox.cc +++ b/src/unittests/gui/widgets/staticbrowserbox.cc @@ -65,11 +65,11 @@ TEST_CASE("StaticBrowserBox tests", "browserbox") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/gui/windowmanager.cc b/src/unittests/gui/windowmanager.cc index a504e6f41..166ef964f 100644 --- a/src/unittests/gui/windowmanager.cc +++ b/src/unittests/gui/windowmanager.cc @@ -175,11 +175,11 @@ TEST_CASE("Windows tests", "windowmanager") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; @@ -882,11 +882,11 @@ TEST_CASE("WindowManager", "create windows") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 config.setValue("fontSize", 16); diff --git a/src/unittests/integrity.cc b/src/unittests/integrity.cc index a77bd40f9..3d370b36d 100644 --- a/src/unittests/integrity.cc +++ b/src/unittests/integrity.cc @@ -132,13 +132,13 @@ TEST_CASE("integrity tests", "integrity") imageHelper = new SurfaceImageHelper; SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 imageHelper = new SDLImageHelper(); - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/render/mockgraphics.cc b/src/unittests/render/mockgraphics.cc index c33953186..d2ba71f0a 100644 --- a/src/unittests/render/mockgraphics.cc +++ b/src/unittests/render/mockgraphics.cc @@ -268,7 +268,7 @@ bool MockGraphics::setVideoMode(const int w, const int h, { setMainFlags(w, h, scale, bpp, fs, hwaccel, resize, noFrame, allowHighDPI); - if ((mWindow = graphicsManager.createWindow(w, h, bpp, + if ((mWindow = GraphicsManager::createWindow(w, h, bpp, getSoftwareFlags())) == nullptr) { mRect.w = 0; diff --git a/src/unittests/resources/dye/dye.cc b/src/unittests/resources/dye/dye.cc index 97eecc2cd..52613cd60 100644 --- a/src/unittests/resources/dye/dye.cc +++ b/src/unittests/resources/dye/dye.cc @@ -1973,13 +1973,13 @@ TEST_CASE("Dye real dye", "") imageHelper = new SurfaceImageHelper; SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 imageHelper = new SDLImageHelper; - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/resources/dye/dyepalette.cc b/src/unittests/resources/dye/dyepalette.cc index a2a17225c..6318977bc 100644 --- a/src/unittests/resources/dye/dyepalette.cc +++ b/src/unittests/resources/dye/dyepalette.cc @@ -77,11 +77,11 @@ TEST_CASE("DyePalette tests", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/resources/map/maplayer/drawfringenormal.cc b/src/unittests/resources/map/maplayer/drawfringenormal.cc index 65e20812f..6f68d77e7 100644 --- a/src/unittests/resources/map/maplayer/drawfringenormal.cc +++ b/src/unittests/resources/map/maplayer/drawfringenormal.cc @@ -67,11 +67,11 @@ TEST_CASE("MapLayer drawFringe normal", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/resources/map/maplayer/drawfringesimple.cc b/src/unittests/resources/map/maplayer/drawfringesimple.cc index 2865c8299..ad2c87434 100644 --- a/src/unittests/resources/map/maplayer/drawfringesimple.cc +++ b/src/unittests/resources/map/maplayer/drawfringesimple.cc @@ -64,11 +64,11 @@ TEST_CASE("MapLayer drawFringe simple", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/resources/map/maplayer/drawspeciallayer1.cc b/src/unittests/resources/map/maplayer/drawspeciallayer1.cc index 01adf0ee7..8e60592f7 100644 --- a/src/unittests/resources/map/maplayer/drawspeciallayer1.cc +++ b/src/unittests/resources/map/maplayer/drawspeciallayer1.cc @@ -60,11 +60,11 @@ TEST_CASE("MapLayer drawSpecialLayer (specialLayer)", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 Map *map = nullptr; diff --git a/src/unittests/resources/map/maplayer/drawspeciallayer2.cc b/src/unittests/resources/map/maplayer/drawspeciallayer2.cc index 9897f3ad3..b40ac745b 100644 --- a/src/unittests/resources/map/maplayer/drawspeciallayer2.cc +++ b/src/unittests/resources/map/maplayer/drawspeciallayer2.cc @@ -60,11 +60,11 @@ TEST_CASE("MapLayer drawSpecialLayer (tempLayer)", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 Map *map = nullptr; diff --git a/src/unittests/resources/map/speciallayer.cc b/src/unittests/resources/map/speciallayer.cc index 443d252b5..c3b1f78b8 100644 --- a/src/unittests/resources/map/speciallayer.cc +++ b/src/unittests/resources/map/speciallayer.cc @@ -65,11 +65,11 @@ TEST_CASE("SpecialLayer updateCache", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/resources/resourcemanager/resourcemanager.cc b/src/unittests/resources/resourcemanager/resourcemanager.cc index 0f4a7db65..39871e3c7 100644 --- a/src/unittests/resources/resourcemanager/resourcemanager.cc +++ b/src/unittests/resources/resourcemanager/resourcemanager.cc @@ -110,11 +110,11 @@ TEST_CASE("resourcemanager", "resourcemanager") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/resources/sdlimagehelper.cc b/src/unittests/resources/sdlimagehelper.cc index 8c858ce69..67aaa384b 100644 --- a/src/unittests/resources/sdlimagehelper.cc +++ b/src/unittests/resources/sdlimagehelper.cc @@ -89,11 +89,11 @@ TEST_CASE("sdlimagehelper combineSurface", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/resources/sprite/animatedsprite.cc b/src/unittests/resources/sprite/animatedsprite.cc index 34627ff07..1f5f6f9ef 100644 --- a/src/unittests/resources/sprite/animatedsprite.cc +++ b/src/unittests/resources/sprite/animatedsprite.cc @@ -78,11 +78,11 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/sdl.cc b/src/unittests/sdl.cc index 9869db35f..b9dc74299 100644 --- a/src/unittests/sdl.cc +++ b/src/unittests/sdl.cc @@ -79,13 +79,13 @@ TEST_CASE("sdl tests", "sdl") imageHelper = new SurfaceImageHelper; SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 imageHelper = new SDLImageHelper(); - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/utils/chatutils.cc b/src/unittests/utils/chatutils.cc index e3c1dba1a..5e06baaca 100644 --- a/src/unittests/utils/chatutils.cc +++ b/src/unittests/utils/chatutils.cc @@ -74,11 +74,11 @@ TEST_CASE("chatutils replaceVars", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/utils/itemxmlutils.cc b/src/unittests/utils/itemxmlutils.cc index 54c112bbc..8572d3ca5 100644 --- a/src/unittests/utils/itemxmlutils.cc +++ b/src/unittests/utils/itemxmlutils.cc @@ -72,11 +72,11 @@ TEST_CASE("itemxmlutils readItemStatsString 1", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; @@ -242,11 +242,11 @@ TEST_CASE("itemxmlutils readItemStatsVector 1", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; diff --git a/src/unittests/utils/translation/poparser.cc b/src/unittests/utils/translation/poparser.cc index cd46e4768..bf5abaca4 100644 --- a/src/unittests/utils/translation/poparser.cc +++ b/src/unittests/utils/translation/poparser.cc @@ -65,11 +65,11 @@ TEST_CASE("PoParser tests", "PoParser") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/utils/xml.cc b/src/unittests/utils/xml.cc index 022fd1c4a..fa4bfc789 100644 --- a/src/unittests/utils/xml.cc +++ b/src/unittests/utils/xml.cc @@ -75,11 +75,11 @@ TEST_CASE("xml doc", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 theme = new Theme; diff --git a/src/unittests/utils/xmlutils.cc b/src/unittests/utils/xmlutils.cc index 848f2ce49..482580af5 100644 --- a/src/unittests/utils/xmlutils.cc +++ b/src/unittests/utils/xmlutils.cc @@ -64,11 +64,11 @@ TEST_CASE("xmlutils readXmlIntVector 1", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; @@ -124,11 +124,11 @@ TEST_CASE("xmlutils readXmlStringMap 1", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; @@ -184,11 +184,11 @@ TEST_CASE("xmlutils readXmlIntMap 1", "") #ifdef USE_SDL2 SDLImageHelper::setRenderer(graphicsManager.createRenderer( - graphicsManager.createWindow(640, 480, 0, + GraphicsManager::createWindow(640, 480, 0, SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE)); #else // USE_SDL2 - graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); + GraphicsManager::createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE); #endif // USE_SDL2 userPalette = new UserPalette; |