|
@@ -13,29 +13,27 @@
|
|
|
#include "CStack.h"
|
|
#include "CStack.h"
|
|
|
#include "VCMIDirs.h"
|
|
#include "VCMIDirs.h"
|
|
|
|
|
|
|
|
-#ifdef VCMI_WINDOWS
|
|
|
|
|
-#include <windows.h> //for .dll libs
|
|
|
|
|
-#elif !defined VCMI_ANDROID
|
|
|
|
|
-#include <dlfcn.h>
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
#include "serializer/BinaryDeserializer.h"
|
|
#include "serializer/BinaryDeserializer.h"
|
|
|
#include "serializer/BinarySerializer.h"
|
|
#include "serializer/BinarySerializer.h"
|
|
|
|
|
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
|
|
-
|
|
|
|
|
-#include "AI/VCAI/VCAI.h"
|
|
|
|
|
-#include "AI/Nullkiller/AIGateway.h"
|
|
|
|
|
-#include "AI/BattleAI/BattleAI.h"
|
|
|
|
|
-
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+#ifdef STATIC_AI
|
|
|
|
|
+# include "AI/VCAI/VCAI.h"
|
|
|
|
|
+# include "AI/Nullkiller/AIGateway.h"
|
|
|
|
|
+# include "AI/BattleAI/BattleAI.h"
|
|
|
|
|
+#else
|
|
|
|
|
+# ifdef VCMI_WINDOWS
|
|
|
|
|
+# include <windows.h> //for .dll libs
|
|
|
|
|
+# else
|
|
|
|
|
+# include <dlfcn.h>
|
|
|
|
|
+# endif // VCMI_WINDOWS
|
|
|
|
|
+#endif // STATIC_AI
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
template<typename rett>
|
|
template<typename rett>
|
|
|
std::shared_ptr<rett> createAny(const boost::filesystem::path & libpath, const std::string & methodName)
|
|
std::shared_ptr<rett> createAny(const boost::filesystem::path & libpath, const std::string & methodName)
|
|
|
{
|
|
{
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
|
|
|
|
+#ifdef STATIC_AI
|
|
|
// android currently doesn't support loading libs dynamically, so the access to the known libraries
|
|
// android currently doesn't support loading libs dynamically, so the access to the known libraries
|
|
|
// is possible only via specializations of this template
|
|
// is possible only via specializations of this template
|
|
|
throw std::runtime_error("Could not resolve ai library " + libpath.generic_string());
|
|
throw std::runtime_error("Could not resolve ai library " + libpath.generic_string());
|
|
@@ -96,10 +94,10 @@ std::shared_ptr<rett> createAny(const boost::filesystem::path & libpath, const s
|
|
|
logGlobal->error("Cannot get AI!");
|
|
logGlobal->error("Cannot get AI!");
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
-#endif //!VCMI_ANDROID
|
|
|
|
|
|
|
+#endif // STATIC_AI
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
|
|
|
|
+#ifdef STATIC_AI
|
|
|
|
|
|
|
|
template<>
|
|
template<>
|
|
|
std::shared_ptr<CGlobalAI> createAny(const boost::filesystem::path & libpath, const std::string & methodName)
|
|
std::shared_ptr<CGlobalAI> createAny(const boost::filesystem::path & libpath, const std::string & methodName)
|
|
@@ -118,7 +116,7 @@ std::shared_ptr<CBattleGameInterface> createAny(const boost::filesystem::path &
|
|
|
return std::make_shared<CBattleAI>();
|
|
return std::make_shared<CBattleAI>();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+#endif // STATIC_AI
|
|
|
|
|
|
|
|
template<typename rett>
|
|
template<typename rett>
|
|
|
std::shared_ptr<rett> createAnyAI(std::string dllname, const std::string & methodName)
|
|
std::shared_ptr<rett> createAnyAI(std::string dllname, const std::string & methodName)
|