Allow error message to be formatted

This commit is contained in:
SirLynix
2023-08-14 23:16:37 +02:00
committed by Jérôme Leclercq
parent 25957c4b7f
commit a741672a51
119 changed files with 707 additions and 490 deletions

View File

@@ -53,7 +53,7 @@ namespace Nz
inline void MTLParser::Error(const std::string& message)
{
NazaraError(message + " at line #" + std::to_string(m_lineCount));
NazaraError("{0} at line #{1}", message, m_lineCount);
}
inline void MTLParser::Flush() const
@@ -64,7 +64,7 @@ namespace Nz
inline void MTLParser::Warning(const std::string& message)
{
NazaraWarning(message + " at line #" + std::to_string(m_lineCount));
NazaraWarning("{0} at line #{1}", message, m_lineCount);
}
inline void MTLParser::UnrecognizedLine(bool error)

View File

@@ -153,7 +153,7 @@ namespace Nz
inline void OBJParser::Error(const std::string& message)
{
NazaraError(message + " at line #" + std::to_string(m_lineCount));
NazaraError("{0} at line #{1}", message, m_lineCount);
}
inline void OBJParser::Flush() const
@@ -164,7 +164,7 @@ namespace Nz
inline void OBJParser::Warning(const std::string& message)
{
NazaraWarning(message + " at line #" + std::to_string(m_lineCount));
NazaraWarning("{0} at line #{1}", message, m_lineCount);
}
inline bool OBJParser::UnrecognizedLine(bool error)

View File

@@ -159,7 +159,7 @@ namespace Nz
return m_position;
}
NazaraError("Coordinate system out of enum (0x" + NumberToString(UnderlyingCast(coordSys), 16) + ')');
NazaraError("Coordinate system out of enum ({0:#x})", UnderlyingCast(coordSys));
return Vector3f();
}
@@ -181,7 +181,7 @@ namespace Nz
return m_rotation;
}
NazaraError("Coordinate system out of enum (0x" + NumberToString(UnderlyingCast(coordSys), 16) + ')');
NazaraError("Coordinate system out of enum ({0:#x})", UnderlyingCast(coordSys));
return Quaternionf();
}
@@ -197,7 +197,7 @@ namespace Nz
return m_scale;
}
NazaraError("Coordinate system out of enum (0x" + NumberToString(UnderlyingCast(coordSys), 16) + ')');
NazaraError("Coordinate system out of enum ({0:#x})", UnderlyingCast(coordSys));
return Vector3f();
}

View File

@@ -200,13 +200,13 @@ namespace Nz
ConvertFunction func = s_convertFunctions[srcFormat][dstFormat];
if (!func)
{
NazaraError("Pixel format conversion from " + std::string(GetName(srcFormat)) + " to " + std::string(GetName(dstFormat)) + " is not supported");
NazaraError("pixel format conversion from {0} to {1} is not supported", GetName(srcFormat), GetName(dstFormat));
return false;
}
if (!func(reinterpret_cast<const UInt8*>(start), reinterpret_cast<const UInt8*>(end), reinterpret_cast<UInt8*>(dst)))
{
NazaraError("Pixel format conversion from " + std::string(GetName(srcFormat)) + " to " + std::string(GetName(dstFormat)) + " failed");
NazaraError("pixel format conversion from {0} to {1} failed", GetName(srcFormat), GetName(dstFormat));
return false;
}