+++ /dev/null
-From aa00fdbd0e99b2beec382c7677a64d962b748dcb Mon Sep 17 00:00:00 2001
-From: Rohit Nirmal <rohitnirmal9@gmail.com>
-Date: Wed, 6 May 2015 19:16:51 -0500
-Subject: [PATCH] Fix building with Boost 1.58.
-
----
- CCallback.cpp | 2 +-
- lib/CArtHandler.cpp | 2 +-
- lib/CGameInfoCallback.cpp | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/CCallback.cpp b/CCallback.cpp
-index 8009bc7..da280db 100644
---- a/CCallback.cpp
-+++ b/CCallback.cpp
-@@ -80,7 +80,7 @@ void CCallback::recruitCreatures(const CGDwelling *obj, const CArmedInstance * d
- \r
- bool CCallback::dismissCreature(const CArmedInstance *obj, SlotID stackPos)\r
- {\r
-- if(((player>=0) && obj->tempOwner != player) || (obj->stacksCount()<2 && obj->needsLastStack()))\r
-+ if((player && obj->tempOwner != player) || (obj->stacksCount()<2 && obj->needsLastStack()))\r
- return false;\r
- \r
- DisbandCreature pack(stackPos,obj->id);\r
-diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp
-index 2d9dd01..0026a66 100644
---- a/lib/CArtHandler.cpp
-+++ b/lib/CArtHandler.cpp
-@@ -671,7 +671,7 @@ boost::optional<std::vector<CArtifact*>&> CArtHandler::listFromClass( CArtifact:
- case CArtifact::ART_RELIC:\r
- return relics;\r
- default: //special artifacts should not be erased\r
-- return nullptr;\r
-+ return boost::optional<std::vector<CArtifact*>&>();\r
- }\r
- }\r
- \r
-diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp
-index 051bb9c..2a59b96 100644
---- a/lib/CGameInfoCallback.cpp
-+++ b/lib/CGameInfoCallback.cpp
-@@ -403,7 +403,7 @@ std::vector <const CGObjectInstance * > CGameInfoCallback::getVisitableObjs(int3
-
- for(const CGObjectInstance * obj : t->visitableObjects)
- {
-- if(player < nullptr || obj->ID != Obj::EVENT) //hide events from players
-+ if(player || obj->ID != Obj::EVENT) //hide events from players
- ret.push_back(obj);
- }
-
--- /dev/null
+From 83c6ffbda0f373848e11b81f128647bfcaed024f Mon Sep 17 00:00:00 2001
+From: Raphnalor <37222713+Raphnalor@users.noreply.github.com>
+Date: Sun, 11 Mar 2018 16:02:20 +0300
+Subject: [PATCH] Reflect changes in boost::asio released in Boost 1.66. (#428)
+
+The service template parameters are disabled by default for now.
+Use BOOST_ASIO_ENABLE_OLD_SERVICES macro to enable the old interface.
+---
+ lib/serializer/Connection.cpp | 3 +++
+ lib/serializer/Connection.h | 6 ++++++
+ server/CVCMIServer.cpp | 3 +++
+ server/CVCMIServer.h | 8 +++++++-
+ 4 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/lib/serializer/Connection.cpp b/lib/serializer/Connection.cpp
+index 0a842d1d3..ae1810e8b 100644
+--- a/lib/serializer/Connection.cpp
++++ b/lib/serializer/Connection.cpp
+@@ -14,6 +14,9 @@
+ #include "../mapping/CMap.h"
+ #include "../CGameState.h"
+
++#if BOOST_VERSION >= 106600
++#define BOOST_ASIO_ENABLE_OLD_SERVICES
++#endif
+ #include <boost/asio.hpp>
+
+ using namespace boost;
+diff --git a/lib/serializer/Connection.h b/lib/serializer/Connection.h
+index b6ceee7a0..cb134e2b6 100644
+--- a/lib/serializer/Connection.h
++++ b/lib/serializer/Connection.h
+@@ -22,7 +22,13 @@ namespace boost
+ {
+ class tcp;
+ }
++
++#if BOOST_VERSION >= 106600 // Boost version >= 1.66
++ class io_context;
++ typedef io_context io_service;
++#else
+ class io_service;
++#endif
+
+ template <typename Protocol> class stream_socket_service;
+ template <typename Protocol,typename StreamSocketService>
+diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp
+index b077607be..d459a8e95 100644
+--- a/server/CVCMIServer.cpp
++++ b/server/CVCMIServer.cpp
+@@ -9,5 +9,8 @@
+ #include "StdInc.h"\r
+ \r
++#if BOOST_VERSION >= 106600
++#define BOOST_ASIO_ENABLE_OLD_SERVICES
++#endif\r
+ #include <boost/asio.hpp>\r
+ \r
+ #include "../lib/filesystem/Filesystem.h"\r
+diff --git a/server/CVCMIServer.h b/server/CVCMIServer.h
+index 6fa7ad5bb..ad9951f64 100644
+--- a/server/CVCMIServer.h
++++ b/server/CVCMIServer.h
+@@ -26,7 +26,13 @@ namespace boost
+ {\r
+ class tcp;\r
+ }\r
+- class io_service;\r
++\r
++#if BOOST_VERSION >= 106600 // Boost version >= 1.66
++ class io_context;
++ typedef io_context io_service;
++#else
++ class io_service;
++#endif\r
+ \r
+ template <typename Protocol> class stream_socket_service;\r
+ template <typename Protocol,typename StreamSocketService>\r
+++ /dev/null
---- vcmi-0.98/lib/Connection.cpp~ 2015-04-01 07:34:22.000000000 +0000
-+++ vcmi-0.98/lib/Connection.cpp 2016-05-28 17:54:42.579831336 +0000
-@@ -440,7 +440,7 @@
- return typeDescr; //type found, return ptr to structure\r
- \r
- //type not found - add it to the list and return given ID\r
-- auto newType = make_shared<TypeDescriptor>();\r
-+ auto newType = std::make_shared<TypeDescriptor>();\r
- newType->typeID = typeInfos.size() + 1;\r
- newType->name = type->name();\r
- typeInfos[type] = newType;\r
---- vcmi-0.98/client/Client.cpp~ 2015-04-01 07:34:22.000000000 +0000
-+++ vcmi-0.98/client/Client.cpp 2016-05-28 18:01:35.421105201 +0000
-@@ -451,7 +451,7 @@
- }\r
- else \r
- {\r
-- installNewPlayerInterface(make_shared<CPlayerInterface>(color), color);\r
-+ installNewPlayerInterface(std::make_shared<CPlayerInterface>(color), color);\r
- humanPlayers++;\r
- }\r
- }\r
-@@ -467,7 +467,7 @@
- if(!gNoGUI)\r
- {\r
- boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim);\r
-- auto p = make_shared<CPlayerInterface>(PlayerColor::NEUTRAL);\r
-+ auto p = std::make_shared<CPlayerInterface>(PlayerColor::NEUTRAL);\r
- p->observerInDuelMode = true;\r
- installNewPlayerInterface(p, boost::none);\r
- GH.curInt = p.get();\r
-@@ -550,7 +550,7 @@
- else\r
- {\r
- assert(isHuman);\r
-- nInt = make_shared<CPlayerInterface>(pid);\r
-+ nInt = std::make_shared<CPlayerInterface>(pid);\r
- }\r
- \r
- nInt->dllName = dllname;\r
-@@ -620,7 +620,7 @@
- else\r
- {\r
- assert(isHuman);\r
-- nInt = make_shared<CPlayerInterface>(pid);\r
-+ nInt = std::make_shared<CPlayerInterface>(pid);\r
- }\r
- \r
- nInt->dllName = dllname;\r
-@@ -866,7 +866,7 @@
- playerint[colorUsed] = gameInterface;\r
- \r
- logGlobal->traceStream() << boost::format("\tInitializing the interface for player %s") % colorUsed;\r
-- auto cb = make_shared<CCallback>(gs, color, this);\r
-+ auto cb = std::make_shared<CCallback>(gs, color, this);\r
- callbacks[colorUsed] = cb;\r
- battleCallbacks[colorUsed] = cb;\r
- gameInterface->init(cb);\r
-@@ -887,7 +887,7 @@
- if(needCallback)\r
- {\r
- logGlobal->traceStream() << boost::format("\tInitializing the battle interface for player %s") % *color;\r
-- auto cbc = make_shared<CBattleCallback>(gs, color, this);\r
-+ auto cbc = std::make_shared<CBattleCallback>(gs, color, this);\r
- battleCallbacks[colorUsed] = cbc;\r
- battleInterface->init(cbc);\r
- }\r
+++ /dev/null
-diff -ur vcmi-0.98.orig/client/CVideoHandler.cpp vcmi-0.98/client/CVideoHandler.cpp
---- vcmi-0.98.orig/client/CVideoHandler.cpp 2015-04-01 09:34:22.000000000 +0200
-+++ vcmi-0.98/client/CVideoHandler.cpp 2016-03-29 01:45:43.689696331 +0200
-@@ -155,7 +155,7 @@
- }\r
- \r
- // Allocate video frame\r
-- frame = avcodec_alloc_frame();\r
-+ frame = av_frame_alloc();\r
- \r
- //setup scaling\r
- \r
-@@ -201,21 +201,21 @@
- #endif\r
- { // Convert the image into YUV format that SDL uses\r
- sws = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt, \r
-- pos.w, pos.h, PIX_FMT_YUV420P, \r
-+ pos.w, pos.h, AV_PIX_FMT_YUV420P, \r
- SWS_BICUBIC, nullptr, nullptr, nullptr);\r
- }\r
- else\r
- {\r
- \r
-- PixelFormat screenFormat = PIX_FMT_NONE;\r
-+ AVPixelFormat screenFormat = AV_PIX_FMT_NONE;\r
- if (screen->format->Bshift > screen->format->Rshift)\r
- {\r
- // this a BGR surface\r
- switch (screen->format->BytesPerPixel)\r
- {\r
-- case 2: screenFormat = PIX_FMT_BGR565; break;\r
-- case 3: screenFormat = PIX_FMT_BGR24; break;\r
-- case 4: screenFormat = PIX_FMT_BGR32; break;\r
-+ case 2: screenFormat = AV_PIX_FMT_BGR565; break;\r
-+ case 3: screenFormat = AV_PIX_FMT_BGR24; break;\r
-+ case 4: screenFormat = AV_PIX_FMT_BGR32; break;\r
- default: return false;\r
- }\r
- }\r
-@@ -224,9 +224,9 @@
- // this a RGB surface\r
- switch (screen->format->BytesPerPixel)\r
- {\r
-- case 2: screenFormat = PIX_FMT_RGB565; break;\r
-- case 3: screenFormat = PIX_FMT_RGB24; break;\r
-- case 4: screenFormat = PIX_FMT_RGB32; break;\r
-+ case 2: screenFormat = AV_PIX_FMT_RGB565; break;\r
-+ case 3: screenFormat = AV_PIX_FMT_RGB24; break;\r
-+ case 4: screenFormat = AV_PIX_FMT_RGB32; break;\r
- default: return false;\r
- }\r
- }\r
Summary: Heroes 3: WoG recreated
Name: vcmi
-Version: 0.98
-Release: 7
+Version: 0.99
+Release: 1
License: GPL v2+
Group: X11/Applications/Games
Source0: https://github.com/vcmi/vcmi/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 6a69e52a3380358220eba67332b097c6
+# Source0-md5: 686c2a0283184add785d50b447db806f
Source1: http://download.vcmi.eu/core.zip
# Source1-md5: 5cf75d588cc53b93aceb809a6068ae37
-Patch0: boost-1.58.patch
-Patch1: ffmpeg3.patch
-Patch2: cxx.patch
+Patch0: boost-1.66.patch
URL: http://www.vcmi.eu/
BuildRequires: Qt5Network-devel
BuildRequires: qt5-build
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
%build
install -d build