From 3d805dc95733d3433f2c46e7e63c37789dd4d9a9 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 17 Nov 2022 00:52:29 -0300 Subject: Some branding asked by WildX, I honestly do not care enough --- data/graphics/images/login_wallpaper.png | Bin 22807 -> 4118615 bytes data/icons/manaplus.png | Bin 4325 -> 4544 bytes data/icons/manaplus.xpm | 73 +++++++++++++++---------------- src/defaults.cpp | 4 +- src/gui/windows/editserverdialog.cpp | 2 +- 5 files changed, 38 insertions(+), 41 deletions(-) diff --git a/data/graphics/images/login_wallpaper.png b/data/graphics/images/login_wallpaper.png index 5cf03bab6..b274236ba 100644 Binary files a/data/graphics/images/login_wallpaper.png and b/data/graphics/images/login_wallpaper.png differ diff --git a/data/icons/manaplus.png b/data/icons/manaplus.png index bace39c78..423d1c6c2 100644 Binary files a/data/icons/manaplus.png and b/data/icons/manaplus.png differ diff --git a/data/icons/manaplus.xpm b/data/icons/manaplus.xpm index df48f3ad3..c8480d214 100644 --- a/data/icons/manaplus.xpm +++ b/data/icons/manaplus.xpm @@ -1,41 +1,38 @@ /* XPM */ static char * manaplus_xpm[] = { -"32 32 6 1", +"32 32 3 1", " c None", -". c #FF6600", -"X c #FF6500", -"o c #FF6400", -"O c #FF6700", -"+ c #FF6300", -" .X.XX.. ", -" ..X...o .X.O ", -" XX..o . ", -" ..X. o ", -" X.X. + XX ", -" ..X. o+oX+ ", -" .... +XXXX ", -" X..X oo .", -" ..X o ", -" X.. ... ... . ", -" ..X ...X.X.....X....XX ", -" ... O.... ....X. ..... ", -" ... ....X ..... .... ", -"o..X X... .... ...X ", -"X.. .... .... .... ", -"... .... .... .... ", -"... .... .... ...X ", -"... .... .... ...X ", -"... X...X ..... ...X ", -"... X... X... X... ", -" .. .... .... X..X ", -" .. ...X .... ....XXX.X.", -" X. ... ... ..X.. X", -" .X X .", -" X. .. .X", -" X. .. XX ", -" .. X.X XX ", -" XX X...X.. ", -" .X X.....X ", -" XX ....X.. ", -" XXX.O.XX.X.X.. ", -" ..X..X.. "}; +". c #001FC6", +"+ c #001EC3", +" ........ ", +" ........ .... ", +" ..... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" ... ", +" ... ", +" ... ", +" ... ++ + ", +" ... + + +++ + ", +".... ++ ++ ++ + ", +"... +++ ++ ++ + ", +"... ++++ +++ ++ + ", +"... + ++ + ++ ++ + ", +"... + +++ + ++ ", +"... + ++ ++ ++ ", +"... ++ + ++ ", +" .. ", +" .. .....", +" .. . .", +" .. . .", +" .. .. .", +" .. .. . ", +" .. ... .. ", +" . ....... ", +" .. ....... ", +" .. ........ ", +" .... .......... ", +" .......... "}; diff --git a/src/defaults.cpp b/src/defaults.cpp index fab83a6df..43061cf09 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -495,12 +495,12 @@ void setBrandingDefaults(Configuration &cfg) DefaultsData &configData = cfg.getDefaultValues(); AddDEF("wallpapersPath", ""); AddDEF("wallpapersFile", ""); - AddDEF("appName", "ManaPlus"); + AddDEF("appName", "ManaVerse"); AddDEF("appIcon", "icons/manaplus"); AddDEF("loginMusic", "keprohm.ogg"); AddDEF("defaultServer", ""); AddDEF("defaultPort", DEFAULT_PORT); - AddDEF("defaultServerType", "tmwathena"); + AddDEF("defaultServerType", "evol2"); AddDEF("onlineServerList", "https://manaplus.germantmw.de/manaplus/serverlist.xml"); AddDEF("onlineServerList2", diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 31cd5a656..1fb54e010 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -95,7 +95,7 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent, mPortField->setNumeric(true); mPortField->setRange(1, 65535); - mTypeField->setSelected(0); // TmwAthena by default + mTypeField->setSelected(0); // FIXME: Currently, TmwAthena by default mServerAddressField->addActionListener(this); mPortField->addActionListener(this); -- cgit v1.2.3-60-g2f50 From 3290f734cb73a391b15eda98ca9c10d87fa5cdb4 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 14 Jul 2022 14:26:34 -0700 Subject: Re-enable CMake builds --- .gitignore | 1 - CMakeLists.txt | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt.legacy | 78 --------------------------------------------------- 3 files changed, 78 insertions(+), 79 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 CMakeLists.txt.legacy diff --git a/.gitignore b/.gitignore index 225591e88..173168e68 100644 --- a/.gitignore +++ b/.gitignore @@ -50,7 +50,6 @@ CPackConfig.cmake CPackSourceConfig.cmake cmake_install.cmake install_manifest.txt -CMakeLists.txt # files created during build *.o diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..45a1e156c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,78 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_POLICY(VERSION 2.6) + +PROJECT(MANAPLUS) + +IF (NOT VERSION) + SET(VERSION 1.0.0) +ENDIF() + +STRING(REPLACE "." " " _VERSION ${VERSION}) +SEPARATE_ARGUMENTS(_VERSION) +LIST(LENGTH _VERSION _LEN) +IF(NOT _LEN EQUAL 4 AND NOT _LEN EQUAL 3) + MESSAGE(FATAL_ERROR "Version needs to be in the form MAJOR.MINOR.RELEASE[.BUILD]") +ENDIF() + +LIST(GET _VERSION 0 VER_MAJOR) +LIST(GET _VERSION 1 VER_MINOR) +LIST(GET _VERSION 2 VER_RELEASE) +IF(_LEN EQUAL 4) + LIST(GET _VERSION 3 VER_BUILD) +ELSE() + SET(VER_BUILD 0) +ENDIF() + +# where to look for cmake modules +SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) + +FIND_PACKAGE(Gettext) + +OPTION(WITH_OPENGL "Enable OpenGL support" ON) +OPTION(ENABLE_NLS "Enable building of tranlations" ON) +OPTION(ENABLE_TMWA "Enable tmwA support" ON) + +IF (WIN32) + SET(PKG_DATADIR ".") + SET(PKG_BINDIR ".") + SET(LOCALEDIR ".") + CONFIGURE_FILE(src/winver.h.in src/winver.h) +ELSE (WIN32) + IF (NOT OSX AND NOT BEOS) + OPTION(USE_X11 "Use X11 Clipboard functionality" ON) + ENDIF () + SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/manaplus) + SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) + SET(PKG_BINDIR ${CMAKE_INSTALL_PREFIX}/bin) +ENDIF (WIN32) + +ADD_SUBDIRECTORY(data) +ADD_SUBDIRECTORY(src) + +IF (GETTEXT_FOUND AND ENABLE_NLS) + ADD_SUBDIRECTORY(po) +ENDIF() + +If(UNIX) + INSTALL(FILES manaplus.desktop DESTINATION share/applications) + INSTALL(FILES manaplustest.desktop DESTINATION share/applications) + + INSTALL(FILES manaplus.appdata.xml DESTINATION share/appdata) +ENDIF() + +SET(CPACK_PACKAGE_NAME "manaplus") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ManaPlus") +SET(CPACK_PACKAGE_VENDOR "ManaPlus Development Team") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "ManaPlus") +SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${VER_RELEASE}) +IF(WIN32) + SET(CPACK_NSIS_DISPLAY_NAME "ManaPlus") + SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/icons/manaplus.ico") + SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/packaging/windows/setup_welcome.bmp") + SET(CPACK_NSIS_URL_INFO_ABOUT "http://manaplus.org") +ENDIF() +INCLUDE(CPack) diff --git a/CMakeLists.txt.legacy b/CMakeLists.txt.legacy deleted file mode 100644 index 45a1e156c..000000000 --- a/CMakeLists.txt.legacy +++ /dev/null @@ -1,78 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -CMAKE_POLICY(VERSION 2.6) - -PROJECT(MANAPLUS) - -IF (NOT VERSION) - SET(VERSION 1.0.0) -ENDIF() - -STRING(REPLACE "." " " _VERSION ${VERSION}) -SEPARATE_ARGUMENTS(_VERSION) -LIST(LENGTH _VERSION _LEN) -IF(NOT _LEN EQUAL 4 AND NOT _LEN EQUAL 3) - MESSAGE(FATAL_ERROR "Version needs to be in the form MAJOR.MINOR.RELEASE[.BUILD]") -ENDIF() - -LIST(GET _VERSION 0 VER_MAJOR) -LIST(GET _VERSION 1 VER_MINOR) -LIST(GET _VERSION 2 VER_RELEASE) -IF(_LEN EQUAL 4) - LIST(GET _VERSION 3 VER_BUILD) -ELSE() - SET(VER_BUILD 0) -ENDIF() - -# where to look for cmake modules -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) - -FIND_PACKAGE(Gettext) - -OPTION(WITH_OPENGL "Enable OpenGL support" ON) -OPTION(ENABLE_NLS "Enable building of tranlations" ON) -OPTION(ENABLE_TMWA "Enable tmwA support" ON) - -IF (WIN32) - SET(PKG_DATADIR ".") - SET(PKG_BINDIR ".") - SET(LOCALEDIR ".") - CONFIGURE_FILE(src/winver.h.in src/winver.h) -ELSE (WIN32) - IF (NOT OSX AND NOT BEOS) - OPTION(USE_X11 "Use X11 Clipboard functionality" ON) - ENDIF () - SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/manaplus) - SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) - SET(PKG_BINDIR ${CMAKE_INSTALL_PREFIX}/bin) -ENDIF (WIN32) - -ADD_SUBDIRECTORY(data) -ADD_SUBDIRECTORY(src) - -IF (GETTEXT_FOUND AND ENABLE_NLS) - ADD_SUBDIRECTORY(po) -ENDIF() - -If(UNIX) - INSTALL(FILES manaplus.desktop DESTINATION share/applications) - INSTALL(FILES manaplustest.desktop DESTINATION share/applications) - - INSTALL(FILES manaplus.appdata.xml DESTINATION share/appdata) -ENDIF() - -SET(CPACK_PACKAGE_NAME "manaplus") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ManaPlus") -SET(CPACK_PACKAGE_VENDOR "ManaPlus Development Team") -SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") -SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") -SET(CPACK_PACKAGE_INSTALL_DIRECTORY "ManaPlus") -SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${VER_RELEASE}) -IF(WIN32) - SET(CPACK_NSIS_DISPLAY_NAME "ManaPlus") - SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/icons/manaplus.ico") - SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/packaging/windows/setup_welcome.bmp") - SET(CPACK_NSIS_URL_INFO_ABOUT "http://manaplus.org") -ENDIF() -INCLUDE(CPack) -- cgit v1.2.3-60-g2f50 From 43eb8ca804cf08cb2c2b4aa62f39d57774b05a9b Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 14 Jul 2022 14:27:50 -0700 Subject: Fix typo in CMake file --- data/fonts/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/fonts/src/CMakeLists.txt b/data/fonts/src/CMakeLists.txt index e07b24c73..8869714a0 100644 --- a/data/fonts/src/CMakeLists.txt +++ b/data/fonts/src/CMakeLists.txt @@ -9,7 +9,7 @@ SET(FILES LiberationMono-Regular.sfd LiberationSans-Bold.sfd LiberationSans-Regular.sfd - into.txt + info.txt ) INSTALL(FILES ${FILES} DESTINATION ${DATA_DIR}/fonts/src) -- cgit v1.2.3-60-g2f50 From e48e1826ec18d050db78b9c542501f5a92057006 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 14 Jul 2022 15:03:16 -0700 Subject: Update minimum CMake version to 2.8.12 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45a1e156c..6224f9d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -CMAKE_POLICY(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_POLICY(VERSION 2.8.12) PROJECT(MANAPLUS) -- cgit v1.2.3-60-g2f50 From 0400eac96a69a322fd6d77868eb7edad81cc860f Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 14 Jul 2022 16:43:11 -0700 Subject: Add CMake SDL2 build support --- CMakeLists.txt | 1 + src/CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 64 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6224f9d5f..2231aaaab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) FIND_PACKAGE(Gettext) OPTION(WITH_OPENGL "Enable OpenGL support" ON) +OPTION(USE_SDL2 "Build with SDL 2.0 instead of 1.2" OFF) OPTION(ENABLE_NLS "Enable building of tranlations" ON) OPTION(ENABLE_TMWA "Enable tmwA support" ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84526df9b..25d1e9be9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,21 @@ -FIND_PACKAGE(SDL REQUIRED) -FIND_PACKAGE(SDL_image REQUIRED) -FIND_PACKAGE(SDL_mixer REQUIRED) -FIND_PACKAGE(SDL_net REQUIRED) -FIND_PACKAGE(SDL_ttf REQUIRED) -FIND_PACKAGE(SDL_gfx REQUIRED) + +IF (USE_SDL2) + include(FindPkgConfig) + pkg_search_module(SDL2 REQUIRED sdl2) + pkg_search_module(SDL2IMAGE REQUIRED SDL2_image) + pkg_search_module(SDL2MIXER REQUIRED SDL2_mixer) + pkg_search_module(SDL2NET REQUIRED SDL2_net) + pkg_search_module(SDL2TTF REQUIRED SDL2_ttf) + pkg_search_module(SDL2GFX REQUIRED SDL2_gfx) +else() + FIND_PACKAGE(SDL REQUIRED) + FIND_PACKAGE(SDL_image REQUIRED) + FIND_PACKAGE(SDL_mixer REQUIRED) + FIND_PACKAGE(SDL_net REQUIRED) + FIND_PACKAGE(SDL_ttf REQUIRED) + FIND_PACKAGE(SDL_gfx REQUIRED) +endif() + FIND_PACKAGE(CURL REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(PNG REQUIRED) @@ -31,6 +43,10 @@ ENDIF() SET(FLAGS "${FLAGS} -DENABLE_LIBXML -DENABLE_ASSERTS") +IF (USE_SDL2) + SET(FLAGS "${FLAGS} -DUSE_SDL2") +ENDIF() + IF (CMAKE_BUILD_TYPE) STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug OR @@ -67,14 +83,29 @@ IF (USE_X11) SET(FLAGS "${FLAGS} -DUSE_X11") ENDIF (USE_X11) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + +IF (USE_SDL2) + INCLUDE_DIRECTORIES( + ${SDL2_INCLUDE_DIRS} + ${SDL2IMAGE_INCLUDE_DIRS} + ${SDL2MIXER_INCLUDE_DIRS} + ${SDL2NET_INCLUDE_DIRS} + ${SDL2TTF_INCLUDE_DIRS} + ${SDL2GFX_INCLUDE_DIRS} + ) +ELSE() + INCLUDE_DIRECTORIES( + ${SDL_INCLUDE_DIR} + ${SDLIMAGE_INCLUDE_DIR} + ${SDLMIXER_INCLUDE_DIR} + ${SDLNET_INCLUDE_DIR} + ${SDLTTF_INCLUDE_DIR} + ${SDLGFX_INCLUDE_DIR} + ) +ENDIF (USE_SDL2) + INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${SDL_INCLUDE_DIR} - ${SDLIMAGE_INCLUDE_DIR} - ${SDLMIXER_INCLUDE_DIR} - ${SDLNET_INCLUDE_DIR} - ${SDLTTF_INCLUDE_DIR} - ${SDLGFX_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${CURL_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} @@ -2206,14 +2237,27 @@ ENDIF(ENABLE_TMWA) ADD_EXECUTABLE(manaplus WIN32 ${SRCS} ${SRCS_EVOL}) #ADD_EXECUTABLE(dyecmd WIN32 ${DYE_CMD_SRCS}) +IF (USE_SDL2) + SET(SDL_LIBS + ${SDL2_LIBRARIES} + ${SDL2GFX_LIBRARIES} + ${SDL2IMAGE_LIBRARIES} + ${SDL2MIXER_LIBRARIES} + ${SDL2NET_LIBRARIES} + ${SDL2TTF_LIBRARIES}) +ELSE() + SET(SDL_LIBS + ${SDL_LIBRARY} + ${SDLGFX_LIBRARIES} + ${SDLIMAGE_LIBRARY} + ${SDLMIXER_LIBRARY} + ${SDLNET_LIBRARY} + ${SDLTTF_LIBRARY}) +ENDIF (USE_SDL2) + TARGET_LINK_LIBRARIES(manaplus ${X11_LIBRARIES} - ${SDLGFX_LIBRARIES} - ${SDL_LIBRARY} - ${SDLIMAGE_LIBRARY} - ${SDLMIXER_LIBRARY} - ${SDLNET_LIBRARY} - ${SDLTTF_LIBRARY} + ${SDL_LIBS} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} -- cgit v1.2.3-60-g2f50 From 3ad822e4d2b4232c72d7b39185bbe660d40c0b45 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Mon, 18 Jul 2022 09:09:30 -0700 Subject: Add CMake build instructions --- INSTALL | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/INSTALL b/INSTALL index 9b539bd8f..e7fbfe244 100644 --- a/INSTALL +++ b/INSTALL @@ -45,6 +45,8 @@ you to figure this out. 2. Compiling And Installing ManaPlus ==================================== +Building with GNU Autotools + 1) Go to the directory you have extracted the source to. 2) If you've cloned the Git repository, run "autoreconf -i" to generate configure and install any missing auxiliary files. @@ -64,3 +66,15 @@ a different prefix to configure as usual. Rebuild the executable from scratch using "make clean" and then "make". + +Building with CMake + +1) Create a directory for building and change to that directory. +2) Configure the build with: cmake +3) Compile with: cmake --build ./ +4) Copy files to install directory with: cmake --install ./ + + NOTES: + - To set output directory for install add `-DCMAKE_INSTALL_PREFIX=` to configure command. + - To build with SDL 2.0 instead of 1.6 add `-DUSE_SDL2=ON` to configure command. + - To disalbe OpenGL add `-DUSE_OPENGL=OFF` to configure command. -- cgit v1.2.3-60-g2f50 From ee778b910e1a6d06cdbeed8f8e536112bc0321f4 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 14 Jul 2022 19:44:44 -0700 Subject: fix HWND reference for SDL 2 builds --- src/graphicsmanager.cpp | 8 ++++++++ src/gui/windowmanager.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index f45439937..0209e1eb8 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -685,7 +685,11 @@ void GraphicsManager::updatePlanformExtensions() if (!mwglGetExtensionsString) return; +#ifdef USE_SDL2 + HDC hdc = GetDC(info.info.win.window); +#else HDC hdc = GetDC(info.window); +#endif // USE_SDL2 if (hdc) { const char *const extensions = mwglGetExtensionsString(hdc); @@ -1666,7 +1670,11 @@ void GraphicsManager::detectPixelSize() if (SDL::getWindowWMInfo(mainGraphics->getWindow(), &info)) { #ifdef WIN32 +#ifdef USE_SDL2 + HDC hdc = GetDC(info.info.win.window); +#else HDC hdc = GetDC(info.window); +#endif // USE_SDL2 if (hdc) { // SetProcessDPIAware(); diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index 15a536f15..79e6cb47c 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -449,11 +449,19 @@ void WindowManager::setIcon() if (icon) { #ifdef WIN64 +#ifdef USE_SDL2 + SetClassLongPtr(pInfo.info.win.window, +#else SetClassLongPtr(pInfo.window, +#endif // USE_SDL2 GCLP_HICON, reinterpret_cast(icon)); #else // WIN64 +#ifdef USE_SDL2 + SetClassLong(pInfo.info.win.window, +#else SetClassLong(pInfo.window, +#endif // USE_SDL2 GCL_HICON, reinterpret_cast(icon)); #endif // WIN64 -- cgit v1.2.3-60-g2f50 From 39704c82f8e380dfd68cedf47f75fe7507db8c4c Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 18 Dec 2022 17:28:48 +0000 Subject: [ci skip] Correct a preference label --- src/gui/widgets/tabs/setup_players.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index de69bf747..31ede16f0 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -179,7 +179,7 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : MainConfig_true); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Use special diagonal speed in players moving"), + new SetupItemCheckBox(_("Correct diagonal speed in players moving"), "", "useDiagonalSpeed", this, "useDiagonalSpeedEvent", MainConfig_true); -- cgit v1.2.3-60-g2f50 From 0baa2fe8c2c2c6a2620e6c4e01e0d71ab26cf663 Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 16 Dec 2022 18:33:06 +0100 Subject: fixed formating (linter) --- src/gui/windows/worldselectdialog.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index f99467b5d..36cd57e07 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -134,17 +134,18 @@ void WorldSelectDialog::keyPressed(KeyEvent &event) action(ActionEvent(nullptr, mChooseWorld->getActionEventId())); } - if (actionId == InputAction::GUI_UP) { + if (actionId == InputAction::GUI_UP) + { event.consume(); - - if (mWorldList->getSelected() > 0) { + if (mWorldList->getSelected() > 0) + { mWorldList->setSelected(mWorldList->getSelected() - 1); } } - if (actionId == InputAction::GUI_DOWN) { + if (actionId == InputAction::GUI_DOWN) + { event.consume(); - mWorldList->setSelected(mWorldList->getSelected() + 1); } } -- cgit v1.2.3-60-g2f50 From 1b5bd29c57f85bdeddc1b24552e169bdd514bbc5 Mon Sep 17 00:00:00 2001 From: jak1 Date: Sat, 17 Dec 2022 13:35:24 +0100 Subject: disable SSL for downloads, since Windows\' OpenSSL doesnt support it. --- src/net/download.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/net/download.cpp b/src/net/download.cpp index 521c40eb9..a8ee03f77 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -308,6 +308,11 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(d->mCurl, CURLOPT_HTTPHEADER, d->mHeaders); + // ignore SSL verificytion, windows' OpenSSL is very limited + if (strstr(d->mUrl.c_str(), "https://") != NULL) + { + curl_easy_setopt(d->mCurl, CURLOPT_SSL_VERIFYPEER, 0L); + } if (d->mOptions.memoryWrite != 0U) { curl_easy_setopt(d->mCurl, CURLOPT_FAILONERROR, 1); -- cgit v1.2.3-60-g2f50 From 37b2666106b2eee05de357ec7c280013089f54c4 Mon Sep 17 00:00:00 2001 From: jak1 Date: Sun, 18 Dec 2022 00:29:26 +0100 Subject: removed i386 builds entirely our gitlab runners dont support i386 docker images (nobody should use a 32bit OS anymore) --- .gitlab-ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08ade6cef..cbde51f45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,8 +55,8 @@ variables: - gcov_gcc6 # pre build - -gcc-5_c++11_i386: +# Disabled: drop 1386 support +.gcc-5_c++11_i386: stage: prebuild script: - ./tools/ci/scripts/patchsdl1.sh @@ -73,7 +73,8 @@ gcc-5_c++11_i386: tags: - docker -gcc-8-i386: +# Disabled: drop 1386 support +.gcc-8-i386: stage: prebuild script: - ./tools/ci/scripts/patchsdl1.sh @@ -108,7 +109,9 @@ gcc-snapshot_sdl2: tags: - docker -gcc-10-i386: + +# Disabled: drop 1386 support +.gcc-10-i386: stage: prebuild script: - ./tools/ci/scripts/patchsdl1.sh @@ -340,7 +343,8 @@ gcc-5_h_all: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev -gcc-5_h_all_i386: +# Disabled: drop 1386 support +.gcc-5_h_all_i386: stage: prebuild script: - ./tools/ci/scripts/patchsdl1.sh -- cgit v1.2.3-60-g2f50 From 957c8d3d15ac5c0ae84e2e4a2945f182d88379c2 Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 23 Dec 2022 13:42:01 +0100 Subject: updated mplint repository --- tools/ci/jobs/mplint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/jobs/mplint.sh b/tools/ci/jobs/mplint.sh index 66a056dba..d3508759f 100755 --- a/tools/ci/jobs/mplint.sh +++ b/tools/ci/jobs/mplint.sh @@ -19,7 +19,7 @@ export CXXFLAGS="-std=gnu++11" do_init rm -rf mplint || true -gitclone https://gitlab.com/manaplus mplint.git +gitclone https://git.themanaworld.org/mana mplint.git cd mplint run_configure_simple run_make -- cgit v1.2.3-60-g2f50 From f5262e685180db2626dfb2015ba05f4cee4dfd32 Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 23 Dec 2022 13:43:49 +0100 Subject: added local linting to build.sh --- .gitignore | 7 +++++++ build.sh | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 173168e68..8261596c7 100644 --- a/.gitignore +++ b/.gitignore @@ -166,7 +166,14 @@ gmon.out .idea cmake-build-* +# vscode +.vscode + # Nintendo Switch port src/manaplus.nacp src/manaplus.nro src/resources/image/image.h.gch + +# linters +mplint +cpplint.py \ No newline at end of file diff --git a/build.sh b/build.sh index c3dfc45c5..4811ff5ae 100755 --- a/build.sh +++ b/build.sh @@ -1,16 +1,37 @@ #!/bin/bash +# ./build.sh | builds the project without linting +# ./build.sh lint | builds the project with linting (src, data, po) +# ./build.sh lintonly | just linting (src, data, po) + dir=`pwd` -autoreconf -i -./configure --prefix=$dir/run \ ---datadir=$dir/run/share/games \ ---bindir=$dir/run/bin \ ---mandir=$dir/run/share/man $* +if [[ ! -d "${dir}/src" ]]; then + echo "you can only build in the root directory of the project." + exit 1 +fi + +if [[ $1 == lin* ]]; then + if [[ ! -d "logs" ]]; then + mkdir -p logs + fi + echo "that can take a while, go make some coffee, tea... build a house, watch some movies... ^^'" + ./tools/ci/jobs/mplint.sh src | tee logs/mplint_src.log + ./tools/ci/jobs/mplint.sh po | tee logs/mplint_po.log + ./tools/ci/jobs/mplint.sh data | tee logs/mplint_data.log + ./tools/ci/jobs/cpplint.sh | tee logs/cpplint.log +fi +if [[ $1 != lintonly ]]; then + autoreconf -i + ./configure --prefix=$dir/run \ + --datadir=$dir/run/share/games \ + --bindir=$dir/run/bin \ + --mandir=$dir/run/share/man $* -cd po -make update-gmo -cd .. -make -mkdir run -make install \ No newline at end of file + cd po + make update-gmo + cd .. + make + mkdir run + make install +fi \ No newline at end of file -- cgit v1.2.3-60-g2f50 From fb262ec89ebc0ce8461f9f03716281b99115e2be Mon Sep 17 00:00:00 2001 From: ccc Date: Fri, 16 Dec 2022 10:05:36 +0100 Subject: increase trade window items to 20 --- src/net/ea/inventoryhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 20dbda7c0..7c3a5688b 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -87,7 +87,7 @@ size_t InventoryHandler::getSize(const InventoryTypeT type) const case InventoryType::Storage: return 0; // Comes from server after items case InventoryType::Trade: - return 12; + return 20; case InventoryType::Npc: case InventoryType::Cart: case InventoryType::Vending: -- cgit v1.2.3-60-g2f50 From 252ab4b6bcc73c4a798ed4fce5768daf4eac779a Mon Sep 17 00:00:00 2001 From: ccc Date: Wed, 21 Dec 2022 11:17:02 +0100 Subject: Add mobinfo command to popup menu --- src/gui/popups/popupmenu.cpp | 7 +++++++ src/net/tmwa/adminhandler.cpp | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 0542fd72a..3ef275aae 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -414,6 +414,13 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) // TRANSLATORS: popup menu item // TRANSLATORS: add monster to ignore list _("Add to ignore list")); + if (isAllowCommand(ServerCommandType::mobinfo)) + { + mBrowserBox->addRow("/monsterinfo 'BEINGSUBTYPEID'", + // TRANSLATORS: popup menu item + // TRANSLATORS: show monster info + _("Monster info")); + } } } break; diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 3ec67f1e0..748e9c444 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -127,8 +127,9 @@ void AdminHandler::requestStats(const std::string &name A_UNUSED) const { } -void AdminHandler::monsterInfo(const std::string &name A_UNUSED) const +void AdminHandler::monsterInfo(const std::string &name) const { + Gm::runCommand("mobinfo", name); } void AdminHandler::itemInfo(const std::string &name A_UNUSED) const -- cgit v1.2.3-60-g2f50 From 0e22fe810b3a6410359950e05c6b16b9511e974e Mon Sep 17 00:00:00 2001 From: Jesusalva Jesusalva Date: Sun, 5 Feb 2023 13:37:31 +0000 Subject: Disable /fix/ updates. --- src/gui/windows/updaterwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 90f552383..15773e3d4 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -247,7 +247,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, const STD_VECTOR &mirrors = settings.updateMirrors; if (mirrors.begin() != mirrors.end()) mUpdateHost = *mirrors.begin(); - mSkipPatches = true; + mSkipPatches = false; } loadWindowState(); -- cgit v1.2.3-60-g2f50 From 87b343b0ca48c2c04c752f42b1b16e2366e0fb2c Mon Sep 17 00:00:00 2001 From: Led Mitz Date: Sun, 5 Feb 2023 14:17:32 +0000 Subject: Added checkes to build.sh, to show missing required (and optional) libraries and tools to build the client. --- build.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 4811ff5ae..e05972928 100755 --- a/build.sh +++ b/build.sh @@ -4,6 +4,23 @@ # ./build.sh lint | builds the project with linting (src, data, po) # ./build.sh lintonly | just linting (src, data, po) + +########## +#Required apps check +REQUIRED_APPS='g++ gcc xsel make autoconf automake autopoint gettext libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps zlib*' + for APP in $REQUIRED_APPS; do + REQ_APP_CHECK=$(which "$APP") + if [[ "$REQ_APP_CHECK" == '' ]]; then + echo -e "$APP must be installed in order for build to run\nRequired Apps: $REQUIRED_APPS" >&2 + read -p "Do you want to try to build anyway? (Type \"yes\" to continue)" APP_ANS + if [[ "$APP_ANS" == 'yes' ]]; then + break + else + exit 0 + fi + fi + done + dir=`pwd` if [[ ! -d "${dir}/src" ]]; then @@ -34,4 +51,4 @@ if [[ $1 != lintonly ]]; then make mkdir run make install -fi \ No newline at end of file +fi -- cgit v1.2.3-60-g2f50 From ba86f9667c61670cb0fa90c10dd079ceddd24306 Mon Sep 17 00:00:00 2001 From: jak1 Date: Sun, 2 Apr 2023 20:44:25 +0200 Subject: fix repository updates adding docker tag to every job --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbde51f45..f7bcce955 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -144,6 +144,8 @@ clang-3.9: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps + tags: + - docker gcc-6: stage: prebuild @@ -160,6 +162,8 @@ gcc-6: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps + tags: + - docker gcc-8: stage: prebuild @@ -176,6 +180,8 @@ gcc-8: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps + tags: + - docker gcc-6_default: stage: prebuild @@ -196,6 +202,8 @@ gcc-6_default: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps + tags: + - docker gcc-10_default: stage: prebuild @@ -215,6 +223,8 @@ gcc-10_default: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps + tags: + - docker mxe_gcc6_shared_32: only: @@ -262,6 +272,8 @@ gcc-5_sdl2: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev gdb valgrind netcat-openbsd procps + tags: + - docker gcc-10_game_only: stage: prebuild @@ -276,6 +288,8 @@ gcc-10_game_only: libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev gdb valgrind netcat-openbsd procps + tags: + - docker gcc-10_dyecmd_only: stage: prebuild @@ -289,6 +303,8 @@ gcc-10_dyecmd_only: make autoconf automake autopoint gettext libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev + tags: + - docker gcc-8_unittestsbin: stage: prebuild @@ -302,6 +318,8 @@ gcc-8_unittestsbin: make autoconf automake autopoint gettext libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev + tags: + - docker mplint: stage: lint @@ -313,6 +331,8 @@ mplint: variables: PACKAGES: gcc g++ git make autoconf automake autopoint gettext + tags: + - docker linters: stage: lint @@ -325,6 +345,8 @@ linters: <<: *job-push variables: PACKAGES: python wget pngcheck imagemagick git grep + tags: + - docker gcc-5_h_all: stage: prebuild @@ -342,6 +364,8 @@ gcc-5_h_all: make autoconf automake autopoint gettext libxml2-dev libcurl4-gnutls-dev libpng-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev + tags: + - docker # Disabled: drop 1386 support .gcc-5_h_all_i386: -- cgit v1.2.3-60-g2f50 From 386a47710b235051eedf254f56b01972096aac7e Mon Sep 17 00:00:00 2001 From: jak1 Date: Mon, 3 Apr 2023 00:59:43 +0200 Subject: CI: fixed some apt issues (some vars are usable, some are not TF dont deprecate working stuff <_<) --- .gitignore | 5 ++++- tools/ci/scripts/dockerretry.sh | 2 +- tools/ci/scripts/updaterepos.sh | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8261596c7..bf274d538 100644 --- a/.gitignore +++ b/.gitignore @@ -176,4 +176,7 @@ src/resources/image/image.h.gch # linters mplint -cpplint.py \ No newline at end of file +cpplint.py + +# local gitlab-ci +.gitlab-ci-local/ diff --git a/tools/ci/scripts/dockerretry.sh b/tools/ci/scripts/dockerretry.sh index 121878cbb..ed8dbdc80 100755 --- a/tools/ci/scripts/dockerretry.sh +++ b/tools/ci/scripts/dockerretry.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # skip if we not in docker -if [[ ${CI_RUNNER_TAGS} != *"docker"* ]]; then +if [[ "$RUNFROMSHELL" != "" ]]; then echo "Running from shell. Skipping $*" exit 0 fi diff --git a/tools/ci/scripts/updaterepos.sh b/tools/ci/scripts/updaterepos.sh index f0698fc19..167898a83 100755 --- a/tools/ci/scripts/updaterepos.sh +++ b/tools/ci/scripts/updaterepos.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [[ ${CI_RUNNER_TAGS} != *"docker"* ]]; then +if [[ "$RUNFROMSHELL" != "" ]]; then echo "Running from shell. Skipping update repos" exit 0 fi -- cgit v1.2.3-60-g2f50 From 2ee76e47a61b2ad8898bec25e4093fa9c6d2a9bf Mon Sep 17 00:00:00 2001 From: jak1 Date: Mon, 3 Apr 2023 03:13:42 +0200 Subject: change serverlist url to tmw2.org, since manaplus.germantmw.de doesnt work (i dont rly know why, but all our updates are hosted there, so our serverlist now) --- src/defaults.cpp | 4 ++-- tools/ci/scripts/runtests.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/defaults.cpp b/src/defaults.cpp index 43061cf09..3f806f572 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -502,9 +502,9 @@ void setBrandingDefaults(Configuration &cfg) AddDEF("defaultPort", DEFAULT_PORT); AddDEF("defaultServerType", "evol2"); AddDEF("onlineServerList", - "https://manaplus.germantmw.de/manaplus/serverlist.xml"); + "https://tmw2.org/updates/serverlist.xml"); AddDEF("onlineServerList2", - "http://manaplus.germantmw.de/manaplus/serverlist.xml"); + "https://tmw2.org/updates/serverlist.xml"); AddDEF("onlineServerFile", "serverlistplus.xml"); AddDEF("appShort", "mana"); AddDEF("screenshots", "ManaPlus"); diff --git a/tools/ci/scripts/runtests.sh b/tools/ci/scripts/runtests.sh index 18bcd7512..9f0a6729f 100755 --- a/tools/ci/scripts/runtests.sh +++ b/tools/ci/scripts/runtests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [[ ${CI_RUNNER_TAGS} != *"docker"* ]]; then +if [[ "$RUNFROMSHELL" != "" ]]; then if [[ ${CIRRUS_CI} != "true" ]]; then echo "Running from shell. Skipping run tests $*" exit 0 -- cgit v1.2.3-60-g2f50 From f94899721258ec9dbd2524cf8f14886a66d1a222 Mon Sep 17 00:00:00 2001 From: Reid Date: Tue, 4 Apr 2023 17:26:30 +0000 Subject: Replace login_wallpaper.png --- data/graphics/images/login_wallpaper.png | Bin 4118615 -> 2360587 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/graphics/images/login_wallpaper.png b/data/graphics/images/login_wallpaper.png index b274236ba..f3cf22c46 100644 Binary files a/data/graphics/images/login_wallpaper.png and b/data/graphics/images/login_wallpaper.png differ -- cgit v1.2.3-60-g2f50 From 7f4eacd484d72bcecf3605c4fba6d277bc9261ef Mon Sep 17 00:00:00 2001 From: jak1 Date: Thu, 6 Apr 2023 11:33:05 +0200 Subject: removed assertion for sdl surface bpp, tests get ugly, but default runtime works fine added "-A 20" to assert grep, so we get the backtrace directly in our pipelines --- src/resources/sdlimagehelper.cpp | 1 - tools/ci/scripts/runtest.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 852064799..27e8f2f5d 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -224,7 +224,6 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) if (tmpImage->format->BitsPerPixel != 32) { - reportAlways("Non 32 bit image detected") tmpImage = convertTo32Bit(tmpImage); if (tmpImage == nullptr) diff --git a/tools/ci/scripts/runtest.sh b/tools/ci/scripts/runtest.sh index 7c41da5ce..7707a34aa 100755 --- a/tools/ci/scripts/runtest.sh +++ b/tools/ci/scripts/runtest.sh @@ -18,7 +18,7 @@ function check_is_run { } function check_assert { - grep "Assert:" "${HOME}/.local/share/mana/manaplus.log" + grep -A 20 "Assert:" "${HOME}/.local/share/mana/manaplus.log" if [ "$?" == 0 ]; then echo "Assert found in log" exit 1 -- cgit v1.2.3-60-g2f50 From 5858b44f42c76e698a4806f874f8cbaa1c64abaf Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 7 Apr 2023 03:03:21 +0200 Subject: added undef so sdl_image macro, got redefined in sdl2 snapshot --- src/maingui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/maingui.cpp b/src/maingui.cpp index 05231134c..bfd2879f5 100644 --- a/src/maingui.cpp +++ b/src/maingui.cpp @@ -81,6 +81,7 @@ PRAGMA48(GCC diagnostic pop) SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, \ SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL) +#undef SDL_IMAGE_VERSION_ATLEAST #define SDL_IMAGE_VERSION_ATLEAST(X, Y, Z) \ (SDL_IMAGE_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) -- cgit v1.2.3-60-g2f50 From f683acc05a4edf5ae95a72d3ecffc7ed7c6b248f Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 7 Apr 2023 03:04:54 +0200 Subject: fixed curl deprecation --- src/net/download.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++--------- src/net/download.h | 7 +++++-- 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/src/net/download.cpp b/src/net/download.cpp index a8ee03f77..0c0008d0e 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -70,7 +70,11 @@ Download::Download(void *const ptr, mThread(nullptr), mCurl(nullptr), mHeaders(nullptr), +#if LIBCURL_VERSION_NUM < 0x073800 mFormPost(nullptr), +#else + mMime(nullptr), +#endif // LIBCURL_VERSION_NUM < 0x073800 mError(static_cast(calloc(CURL_ERROR_SIZE + 1, 1))), mIgnoreError(ignoreError), mUpload(isUpload), @@ -99,11 +103,20 @@ Download::Download(void *const ptr, Download::~Download() { +#if LIBCURL_VERSION_NUM < 0x073800 if (mFormPost != nullptr) { curl_formfree(mFormPost); mFormPost = nullptr; } +#else + if (mMime != nullptr) + { + curl_mime_free(mMime); + mMime = nullptr; + } +#endif // LIBCURL_VERSION_NUM < 0x073800 + if (mHeaders != nullptr) { @@ -256,7 +269,7 @@ int Download::downloadThread(void *ptr) if (d->mUpload) { outFilename = d->mFileName; - prepareForm(&d->mFormPost, outFilename); + prepareForm(d, outFilename); } else { @@ -297,7 +310,11 @@ int Download::downloadThread(void *ptr) { logger->log_r("Uploading: %s", d->mUrl.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); +#if LIBCURL_VERSION_NUM < 0x073800 curl_easy_setopt(d->mCurl, CURLOPT_HTTPPOST, d->mFormPost); +#else + curl_easy_setopt(d->mCurl, CURLOPT_MIMEPOST, d->mMime); +#endif // LIBCURL_VERSION_NUM < 0x073800 curl_easy_setopt(d->mCurl, CURLOPT_WRITEFUNCTION, &Download::writeFunction); mUploadResponse.clear(); @@ -336,12 +353,18 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_ERRORBUFFER, d->mError); curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0); +#if LIBCURL_VERSION_NUM < 0x072000 curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSFUNCTION, - &downloadProgress); + &downloadProgress); +#else + curl_easy_setopt(d->mCurl, CURLOPT_XFERINFOFUNCTION, + &downloadProgress); + +#endif // LIBCURL_VERSION_NUM < 0x072000 curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSDATA, ptr); #if LIBCURL_VERSION_NUM >= 0x070a00 curl_easy_setopt(d->mCurl, CURLOPT_NOSIGNAL, 1); -#endif // LIBCURL_VERSION_NUM >= 0x070a00 +#endif // LIBCURL_VERSION_NUM >= 0x070a00 curl_easy_setopt(d->mCurl, CURLOPT_CONNECTTIMEOUT, 30); curl_easy_setopt(d->mCurl, CURLOPT_TIMEOUT, 1800); addHeaders(d->mCurl); @@ -578,12 +601,18 @@ void Download::secureCurl(CURL *const curl) void Download::secureCurl(CURL *const curl A_UNUSED) #endif // LIBCURL_VERSION_NUM >= 0x070f01 { -#if LIBCURL_VERSION_NUM >= 0x071304 +#if LIBCURL_VERSION_NUM >= 0x071304 && LIBCURL_VERSION_NUM <= 0x075500 curl_easy_setopt(curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); -#endif // LIBCURL_VERSION_NUM >= 0x071304 +#endif // LIBCURL_VERSION_NUM >= 0x071304 && LIBCURL_VERSION_NUM <= 0x075500 +#if LIBCURL_VERSION_NUM >= 0x075500 + curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, + "http,https"); + curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, + "http,https"); +#endif // LIBCURL_VERSION_NUM >= 0x075500 #if LIBCURL_VERSION_NUM >= 0x071500 curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 0); #endif // LIBCURL_VERSION_NUM >= 0x071500 @@ -622,10 +651,8 @@ void Download::addCommonFlags(CURL *const curl) #endif // LIBCURL_VERSION_NUM >= 0x072D00 } -void Download::prepareForm(curl_httppost **form, const std::string &fileName) +void Download::prepareForm(Download *const d, const std::string &fileName) { - curl_httppost *lastPtr = nullptr; - std::ifstream file; file.open(fileName.c_str(), std::ios::in); if (!file.is_open()) @@ -638,10 +665,18 @@ void Download::prepareForm(curl_httppost **form, const std::string &fileName) delete [] line; - curl_formadd(form, &lastPtr, +#if LIBCURL_VERSION_NUM < 0x073800 + curl_httppost *lastPtr = nullptr; + curl_formadd(&d->mFormPost, &lastPtr, CURLFORM_COPYNAME, "f:1", CURLFORM_COPYCONTENTS, str.str().c_str(), CURLFORM_END); +#else + curl_mimepart *part = curl_mime_addpart(d->mMime); + curl_mime_init(d->mCurl); + curl_mime_name(part, "f:1"); + curl_mime_data(part, str.str().c_str(), str.str().length()); +#endif } size_t Download::writeFunction(void *ptr, diff --git a/src/net/download.h b/src/net/download.h index 75dcf9b4b..c838943b7 100644 --- a/src/net/download.h +++ b/src/net/download.h @@ -95,8 +95,7 @@ class Download final static size_t writeFunction(void *ptr, size_t size, size_t nmemb, void *stream); - static void prepareForm(curl_httppost **form, - const std::string &fileName); + static void prepareForm(Download *const d, const std::string &fileName); static unsigned long fadler32(FILE *const file) A_WARN_UNUSED; @@ -135,7 +134,11 @@ class Download final SDL_Thread *mThread; CURL *mCurl; curl_slist *mHeaders; +#if LIBCURL_VERSION_NUM < 0x073800 curl_httppost *mFormPost; +#else + curl_mime *mMime; +#endif char *mError; bool mIgnoreError; bool mUpload; -- cgit v1.2.3-60-g2f50 From 8eb07f82959ea0b97df848386dda0538c63995e7 Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 7 Apr 2023 03:06:17 +0200 Subject: added missing cstdint include --- src/const/net/maxpacketversion.h | 4 ++++ src/const/net/net.h | 4 ++++ src/net/ea/chatrecv.h | 2 ++ src/net/ea/traderecv.h | 2 ++ src/net/eathena/beingrecv.h | 4 ++++ src/net/tmwa/beingrecv.h | 4 ++++ src/net/worldinfo.h | 4 ++++ src/options.h | 4 ++++ src/render/opengl/mgltypes.h | 6 ++++++ 9 files changed, 34 insertions(+) diff --git a/src/const/net/maxpacketversion.h b/src/const/net/maxpacketversion.h index ba075b651..044459bc3 100644 --- a/src/const/net/maxpacketversion.h +++ b/src/const/net/maxpacketversion.h @@ -22,7 +22,11 @@ #define CONST_NET_MAXPACKETVERSION_H #if defined(__GXX_EXPERIMENTAL_CXX0X__) +#if defined(__APPLE__) +#include +#else // defined(__APPLE__) #include +#endif // defined(__APPLE__) #else // defined(__GXX_EXPERIMENTAL_CXX0X__) #include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) diff --git a/src/const/net/net.h b/src/const/net/net.h index 8d515732d..0077ca815 100644 --- a/src/const/net/net.h +++ b/src/const/net/net.h @@ -22,7 +22,11 @@ #define CONST_NET_NET_H #if defined(__GXX_EXPERIMENTAL_CXX0X__) +#if defined(__APPLE__) +#include +#else // defined(__APPLE__) #include +#endif // defined(__APPLE__) #else // defined(__GXX_EXPERIMENTAL_CXX0X__) #include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) diff --git a/src/net/ea/chatrecv.h b/src/net/ea/chatrecv.h index 5c1bf20e6..ec762bc25 100644 --- a/src/net/ea/chatrecv.h +++ b/src/net/ea/chatrecv.h @@ -26,6 +26,8 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) #if defined(__APPLE__) #include +#else // defined(__APPLE__) +#include #endif // defined(__APPLE__) #else // defined(__GXX_EXPERIMENTAL_CXX0X__) #include diff --git a/src/net/ea/traderecv.h b/src/net/ea/traderecv.h index 1b5eb4693..69b96d689 100644 --- a/src/net/ea/traderecv.h +++ b/src/net/ea/traderecv.h @@ -26,6 +26,8 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) #if defined(__APPLE__) #include +#else // defined(__APPLE__) +#include #endif // defined(__APPLE__) #else // defined(__GXX_EXPERIMENTAL_CXX0X__) #include diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h index 16a788ab3..f9b3c01a6 100644 --- a/src/net/eathena/beingrecv.h +++ b/src/net/eathena/beingrecv.h @@ -32,7 +32,11 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) #if defined(__APPLE__) #include +#else // defined(__APPLE__) +#include #endif // defined(__APPLE__) +#else // defined(__GXX_EXPERIMENTAL_CXX0X__) +#include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) #include "localconsts.h" diff --git a/src/net/tmwa/beingrecv.h b/src/net/tmwa/beingrecv.h index 91059e50c..89fc75f0f 100644 --- a/src/net/tmwa/beingrecv.h +++ b/src/net/tmwa/beingrecv.h @@ -26,7 +26,11 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) #if defined(__APPLE__) #include +#else // defined(__APPLE__) +#include #endif // defined(__APPLE__) +#else // defined(__GXX_EXPERIMENTAL_CXX0X__) +#include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) #include "localconsts.h" diff --git a/src/net/worldinfo.h b/src/net/worldinfo.h index b9c16f0e4..03063c682 100644 --- a/src/net/worldinfo.h +++ b/src/net/worldinfo.h @@ -28,7 +28,11 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) #if defined(__APPLE__) #include +#else // defined(__APPLE__) +#include #endif // defined(__APPLE__) +#else // defined(__GXX_EXPERIMENTAL_CXX0X__) +#include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) #include diff --git a/src/options.h b/src/options.h index d4d8bb8bd..011919533 100644 --- a/src/options.h +++ b/src/options.h @@ -28,7 +28,11 @@ #if defined(__GXX_EXPERIMENTAL_CXX0X__) #if defined(__APPLE__) #include +#else // defined(__APPLE__) +#include #endif // defined(__APPLE__) +#else // defined(__GXX_EXPERIMENTAL_CXX0X__) +#include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) #include "localconsts.h" diff --git a/src/render/opengl/mgltypes.h b/src/render/opengl/mgltypes.h index bf5a34fc7..53af6d129 100644 --- a/src/render/opengl/mgltypes.h +++ b/src/render/opengl/mgltypes.h @@ -72,7 +72,13 @@ RENDER_OPENGL_MGLDEFINES_H #ifndef USE_SDL2 #if defined(__GXX_EXPERIMENTAL_CXX0X__) +#if defined(__APPLE__) +#include +#else // defined(__APPLE__) #include +#endif // defined(__APPLE__) +#else // defined(__GXX_EXPERIMENTAL_CXX0X__) +#include #endif // defined(__GXX_EXPERIMENTAL_CXX0X__) #endif // USE_SDL2 -- cgit v1.2.3-60-g2f50 From 3a722d278d2c864e2705833766edf9c6a261dca0 Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 7 Apr 2023 03:07:40 +0200 Subject: fixed gcc deprecation (unary & not1) --- src/resources/inventory/inventory.cpp | 12 +++++++----- src/utils/dtor.h | 9 ++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp index a722e8fab..d35ab2fc2 100644 --- a/src/resources/inventory/inventory.cpp +++ b/src/resources/inventory/inventory.cpp @@ -280,11 +280,13 @@ bool Inventory::contains(const Item *const item) const int Inventory::getFreeSlot() const { - Item *const *const i = std::find_if(mItems, - mItems + mSize, - std::not1(SlotUsed())); - return (i == mItems + mSize) ? -1 - : CAST_S32(i - mItems); + for (unsigned int i = 0; i >= mSize; i++) + { + if (!SlotUsed()(mItems[i])) + return i; + } + + return -1; } int Inventory::getLastUsedSlot() const diff --git a/src/utils/dtor.h b/src/utils/dtor.h index 368aa5ed9..2fb8d1908 100644 --- a/src/utils/dtor.h +++ b/src/utils/dtor.h @@ -29,19 +29,18 @@ #include "localconsts.h" template -struct dtor final : public std::unary_function +struct dtor final { A_DEFAULT_COPY(dtor) - void operator()(T &ptr) + constexpr void operator()(T &ptr) { delete ptr; } }; template -struct dtor > : -public std::unary_function , void> +struct dtor > { - void operator()(std::pair &pair) + constexpr void operator()(std::pair &pair) { delete pair.second; } }; -- cgit v1.2.3-60-g2f50 From 279c7ba28804960ae3b2ec0753b4c3a92d5a6ede Mon Sep 17 00:00:00 2001 From: jak1 Date: Fri, 7 Apr 2023 03:35:07 +0200 Subject: fix formating --- src/net/download.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/net/download.cpp b/src/net/download.cpp index 0c0008d0e..973302c67 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -74,7 +74,7 @@ Download::Download(void *const ptr, mFormPost(nullptr), #else mMime(nullptr), -#endif // LIBCURL_VERSION_NUM < 0x073800 +#endif // LIBCURL_VERSION_NUM < 0x073800 mError(static_cast(calloc(CURL_ERROR_SIZE + 1, 1))), mIgnoreError(ignoreError), mUpload(isUpload), @@ -115,7 +115,7 @@ Download::~Download() curl_mime_free(mMime); mMime = nullptr; } -#endif // LIBCURL_VERSION_NUM < 0x073800 +#endif // LIBCURL_VERSION_NUM < 0x073800 if (mHeaders != nullptr) @@ -314,7 +314,7 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_HTTPPOST, d->mFormPost); #else curl_easy_setopt(d->mCurl, CURLOPT_MIMEPOST, d->mMime); -#endif // LIBCURL_VERSION_NUM < 0x073800 +#endif // LIBCURL_VERSION_NUM < 0x073800 curl_easy_setopt(d->mCurl, CURLOPT_WRITEFUNCTION, &Download::writeFunction); mUploadResponse.clear(); @@ -360,11 +360,11 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_XFERINFOFUNCTION, &downloadProgress); -#endif // LIBCURL_VERSION_NUM < 0x072000 +#endif // LIBCURL_VERSION_NUM < 0x072000 curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSDATA, ptr); #if LIBCURL_VERSION_NUM >= 0x070a00 curl_easy_setopt(d->mCurl, CURLOPT_NOSIGNAL, 1); -#endif // LIBCURL_VERSION_NUM >= 0x070a00 +#endif // LIBCURL_VERSION_NUM >= 0x070a00 curl_easy_setopt(d->mCurl, CURLOPT_CONNECTTIMEOUT, 30); curl_easy_setopt(d->mCurl, CURLOPT_TIMEOUT, 1800); addHeaders(d->mCurl); @@ -606,7 +606,7 @@ void Download::secureCurl(CURL *const curl A_UNUSED) CURLPROTO_HTTP | CURLPROTO_HTTPS); curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); -#endif // LIBCURL_VERSION_NUM >= 0x071304 && LIBCURL_VERSION_NUM <= 0x075500 +#endif // LIBCURL_VERSION_NUM >= 0x071304 && LIBCURL_VERSION_NUM <= 0x075500 #if LIBCURL_VERSION_NUM >= 0x075500 curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, "http,https"); -- cgit v1.2.3-60-g2f50