# HG changeset patch # User alfadur # Date 1539543450 -10800 # Node ID 6c8d4e140f27e67006b8ba0a8e307d8712d7b025 # Parent a44e4c057f571fb4012cef40fd38b475c970ab3c fix frontend compatibility issues diff -r a44e4c057f57 -r 6c8d4e140f27 QTfrontend/campaign.cpp --- a/QTfrontend/campaign.cpp Sun Oct 14 21:25:59 2018 +0300 +++ b/QTfrontend/campaign.cpp Sun Oct 14 21:57:30 2018 +0300 @@ -31,7 +31,7 @@ // if then is found rename it to use _ QString spaceCampName = campaignName; spaceCampName = spaceCampName.replace(QString("_"),QString(" ")); - if (!teamfile->childGroups().contains("Campaign " + campaignName) and + if (!teamfile->childGroups().contains("Campaign " + campaignName) && teamfile->childGroups().contains("Campaign " + spaceCampName)){ teamfile->beginGroup("Campaign " + spaceCampName); QStringList keys = teamfile->childKeys(); @@ -57,7 +57,7 @@ QSettings* teamfile = getCampTeamFile(campaignName, teamName); int progress = teamfile->value("Campaign " + campaignName + "/Progress", 0).toInt(); int unlockedMissions = teamfile->value("Campaign " + campaignName + "/UnlockedMissions", 0).toInt(); - if(progress>0 and unlockedMissions==0) + if(progress>0 && unlockedMissions==0) { QSettings campfile("physfs://Missions/Campaign/" + campaignName + "/campaign.ini", QSettings::IniFormat, 0); campfile.setIniCodec("UTF-8"); @@ -124,9 +124,9 @@ QSettings* m_info = getCampMetaInfo(); - if(progress>=0 and unlockedMissions==0) + if(progress >= 0 && unlockedMissions == 0) { - for(unsigned int i=progress+1;i>0;i--) + for(unsigned int i = progress + 1; i > 0; i--) { MissionInfo missionInfo; QString script = campfile.value(QString("Mission %1/Script").arg(i)).toString(); diff -r a44e4c057f57 -r 6c8d4e140f27 QTfrontend/drawmapscene.cpp --- a/QTfrontend/drawmapscene.cpp Sun Oct 14 21:25:59 2018 +0300 +++ b/QTfrontend/drawmapscene.cpp Sun Oct 14 21:57:30 2018 +0300 @@ -29,6 +29,10 @@ #define DRAWN_MAP_COLOR_CURSOR_PEN (Qt::green) #define DRAWN_MAP_COLOR_CURSOR_ERASER (Qt::red) +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + template T sqr(const T & x) { return x*x; diff -r a44e4c057f57 -r 6c8d4e140f27 QTfrontend/ui/widget/about.cpp --- a/QTfrontend/ui/widget/about.cpp Sun Oct 14 21:25:59 2018 +0300 +++ b/QTfrontend/ui/widget/about.cpp Sun Oct 14 21:57:30 2018 +0300 @@ -100,12 +100,16 @@ //: For the version numbers of Hedgewars' software dependencies QString libinfo = QString(tr("Dependency versions:") + QString("
")); -#ifdef __GNUC__ +#if defined(__GNUC__) libinfo.append(QString(tr("GCC: %1")).arg(__VERSION__)); +#elif defined(WIN32_VCPKG) + libinfo.append(QString(tr("VC++: %1")).arg(_MSC_FULL_VER)); +#elif defined(__VERSION__) + libinfo.append(QString(tr("Unknown Compiler: %1")).arg(__VERSION__)); +#else + libinfo.append(QString(tr("Unknown Compiler"))); +#endif libinfo.append(QString("
")); -#else - libinfo.append(QString(tr("Unknown Compiler")).arg(__VERSION__) + QString("
")); -#endif const SDL_version *sdl_ver; SDL_version sdl_version; diff -r a44e4c057f57 -r 6c8d4e140f27 QTfrontend/ui/widget/chatwidget.cpp --- a/QTfrontend/ui/widget/chatwidget.cpp Sun Oct 14 21:25:59 2018 +0300 +++ b/QTfrontend/ui/widget/chatwidget.cpp Sun Oct 14 21:57:30 2018 +0300 @@ -308,7 +308,7 @@ void HWChatWidget::linkClicked(const QUrl & link) { - if ((link.scheme() == "http") or (link.scheme() == "https")) + if ((link.scheme() == "http") || (link.scheme() == "https")) QDesktopServices::openUrl(link); else if (link.scheme() == "hwnick") { diff -r a44e4c057f57 -r 6c8d4e140f27 QTfrontend/util/namegen.cpp --- a/QTfrontend/util/namegen.cpp Sun Oct 14 21:25:59 2018 +0300 +++ b/QTfrontend/util/namegen.cpp Sun Oct 14 21:57:30 2018 +0300 @@ -155,7 +155,7 @@ for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++) { HWHog hh = team.hedgehog(i); - if (sameHogs and i > 0) + if (sameHogs && i > 0) hh.Hat = team.hedgehog(i-1).Hat; else hh.Hat = getRandomHat(withDLC);