Fix MSVC errors

fix-squashed-planets
MrSimbax 2021-12-21 18:01:42 +01:00
parent d3dd99c384
commit 4ecfb47f07
3 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,6 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include <cstring> #include <cstring>
#include <optional>
#include <boost/property_tree/ini_parser.hpp> #include <boost/property_tree/ini_parser.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>

View File

@ -31,6 +31,7 @@
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
#include <string> #include <string>
#include <optional>
/** /**
* \class CFontLoader * \class CFontLoader

View File

@ -291,7 +291,7 @@ private:
{ {
if (auto font = fontLoader.GetFont(type)) if (auto font = fontLoader.GetFont(type))
{ {
m_fonts[type] = MakeUnique<MultisizeFont>(std::move(*font)); m_fonts[type] = std::make_unique<MultisizeFont>(std::move(*font));
return true; return true;
} }
m_error = "Error on loading fonts: font type " + ToString(type) + " is not configured"; m_error = "Error on loading fonts: font type " + ToString(type) + " is not configured";
@ -319,7 +319,7 @@ private:
return nullptr; return nullptr;
} }
GetLogger()->Debug("Loaded font file %s (font size = %d)\n", multisizeFont->fileName.c_str(), pointSize); GetLogger()->Debug("Loaded font file %s (font size = %d)\n", multisizeFont->fileName.c_str(), pointSize);
auto newFont = MakeUnique<CachedFont>(std::move(file), pointSize); auto newFont = std::make_unique<CachedFont>(std::move(file), pointSize);
if (newFont->font == nullptr) if (newFont->font == nullptr)
{ {
m_error = std::string("TTF_OpenFont error ") + std::string(TTF_GetError()); m_error = std::string("TTF_OpenFont error ") + std::string(TTF_GetError());
@ -335,7 +335,7 @@ private:
m_lastFontSize = pointSize; m_lastFontSize = pointSize;
} }
bool IsLastCachedFont(FontType font, int pointSize) bool IsLastCachedFont(FontType font, int pointSize) const
{ {
return return
m_lastCachedFont != nullptr && m_lastCachedFont != nullptr &&