mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Merge branch 'develop' of https://github.com/vcmi/vcmi into develop
This commit is contained in:
commit
8058cb3cad
@ -58,6 +58,9 @@
|
||||
<Add option="-Wno-sign-compare" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-Wno-overloaded-virtual" />
|
||||
<Add option="-DBOOST_SYSTEM_NO_DEPRECATED" />
|
||||
<Add option="-D_WIN32_WINNT=0x0501" />
|
||||
<Add option="-D_WIN32" />
|
||||
<Add directory="$(#boost.include)" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
|
@ -57,6 +57,8 @@
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-Wno-overloaded-virtual" />
|
||||
<Add option="-fpermissive" />
|
||||
<Add option="-D_WIN32_WINNT=0x0501" />
|
||||
<Add option="-D_WIN32" />
|
||||
<Add directory="$(#boost.include)" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
|
@ -43,7 +43,9 @@
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-Wno-overloaded-virtual" />
|
||||
<Add option="-DBOOST_THREAD_USE_LIB" />
|
||||
<Add option="-DBOOST_SYSTEM_NO_DEPRECATED" />
|
||||
<Add option="-D_WIN32_WINNT=0x0501" />
|
||||
<Add option="-D_WIN32" />
|
||||
<Add directory="$(#boost.include)" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
|
@ -65,7 +65,9 @@
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-Wno-overloaded-virtual" />
|
||||
<Add option="-DBOOST_THREAD_USE_LIB" />
|
||||
<Add option="-DBOOST_SYSTEM_NO_DEPRECATED" />
|
||||
<Add option="-D_WIN32_WINNT=0x0501" />
|
||||
<Add option="-D_WIN32" />
|
||||
<Add option="-DFL_CPP11" />
|
||||
<Add directory="$(#boost.include)" />
|
||||
<Add directory="../../include" />
|
||||
|
2
Global.h
2
Global.h
@ -155,6 +155,7 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
||||
#endif
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/any.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/crc.hpp>
|
||||
@ -172,7 +173,6 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
||||
#include <boost/logic/tribool.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/optional/optional_io.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <boost/range/adaptor/filtered.hpp>
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
#include <boost/range/algorithm.hpp>
|
||||
|
@ -2,6 +2,9 @@
|
||||
//
|
||||
#include "StdInc.h"
|
||||
#include <SDL_mixer.h>
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include "gui/SDL_Extensions.h"
|
||||
#include "CGameInfo.h"
|
||||
#include "mapHandler.h"
|
||||
|
@ -51,13 +51,14 @@ namespace vstd
|
||||
virtual ~CLoggerBase(){};
|
||||
|
||||
virtual void log(ELogLevel::ELogLevel level, const std::string & message) const = 0;
|
||||
virtual void log(ELogLevel::ELogLevel level, const boost::format & fmt) const = 0;
|
||||
|
||||
template<typename T, typename ... Args>
|
||||
void log(ELogLevel::ELogLevel level, const std::string & format, T t, Args ... args) const
|
||||
{
|
||||
boost::format fmt(format);
|
||||
makeFormat(fmt, t, args...);
|
||||
log(level, fmt.str());
|
||||
log(level, fmt);
|
||||
}
|
||||
|
||||
/// Log methods for various log levels
|
||||
|
@ -1612,7 +1612,7 @@ DLL_LINKAGE void StacksHealedOrResurrected::applyGs(CGameState *gs)
|
||||
if(resurrected)
|
||||
{
|
||||
if(changedStack->count > 0 || changedStack->firstHPleft > 0)
|
||||
logGlobal->warn("Dead stack %s with positive total HP", changedStack->nodeName(), changedStack->totalHealth());
|
||||
logGlobal->warn("Dead stack %s with positive total HP %d", changedStack->nodeName(), changedStack->totalHealth());
|
||||
|
||||
changedStack->state.insert(EBattleStackState::ALIVE);
|
||||
}
|
||||
|
@ -153,6 +153,7 @@
|
||||
<Unit filename="CGameInterface.h" />
|
||||
<Unit filename="CGameState.cpp" />
|
||||
<Unit filename="CGameState.h" />
|
||||
<Unit filename="CGameStateFwd.h" />
|
||||
<Unit filename="CGeneralTextHandler.cpp" />
|
||||
<Unit filename="CGeneralTextHandler.h" />
|
||||
<Unit filename="CHeroHandler.cpp" />
|
||||
|
@ -119,6 +119,18 @@ void CLogger::log(ELogLevel::ELogLevel level, const std::string & message) const
|
||||
callTargets(LogRecord(domain, level, message));
|
||||
}
|
||||
|
||||
void CLogger::log(ELogLevel::ELogLevel level, const boost::format & fmt) const
|
||||
{
|
||||
try
|
||||
{
|
||||
log(level, fmt.str());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
log(ELogLevel::ERROR, "Invalid log format!");
|
||||
}
|
||||
}
|
||||
|
||||
ELogLevel::ELogLevel CLogger::getLevel() const
|
||||
{
|
||||
TLockGuard _(mx);
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
CLoggerStream errorStream() const;
|
||||
|
||||
void log(ELogLevel::ELogLevel level, const std::string & message) const override;
|
||||
void log(ELogLevel::ELogLevel level, const boost::format & fmt) const override;
|
||||
|
||||
void addTarget(std::unique_ptr<ILogTarget> && target);
|
||||
void clearTargets();
|
||||
|
@ -61,6 +61,9 @@
|
||||
<Add option="-Wno-sign-compare" />
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-Wno-overloaded-virtual" />
|
||||
<Add option="-DBOOST_SYSTEM_NO_DEPRECATED" />
|
||||
<Add option="-D_WIN32_WINNT=0x0501" />
|
||||
<Add option="-D_WIN32" />
|
||||
<Add directory="$(#boost.include)" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
/*
|
||||
* CVCMIServer.h, part of VCMI engine
|
||||
@ -97,4 +97,4 @@ public:
|
||||
void startListeningThread(CConnection * pc);
|
||||
};
|
||||
|
||||
extern boost::program_options::variables_map cmdLineOptions;
|
||||
extern boost::program_options::variables_map cmdLineOptions;
|
||||
|
@ -47,6 +47,8 @@
|
||||
<Add option="-Wno-unused-parameter" />
|
||||
<Add option="-Wno-overloaded-virtual" />
|
||||
<Add option="-Wno-unused-local-typedefs" />
|
||||
<Add option="-D_WIN32_WINNT=0x0501" />
|
||||
<Add option="-D_WIN32" />
|
||||
<Add directory="$(#zlib.include)" />
|
||||
<Add directory="$(#boost.include)" />
|
||||
<Add directory="../include" />
|
||||
@ -71,6 +73,7 @@
|
||||
</Unit>
|
||||
<Unit filename="StdInc.h">
|
||||
<Option compile="1" />
|
||||
<Option weight="0" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
|
Loading…
Reference in New Issue
Block a user