Color: Replace std::ostringstream usage by Format

This commit is contained in:
SirLynix 2024-01-16 14:06:19 +01:00
parent ea4b8eaaea
commit bbef5cfd1d
2 changed files with 4 additions and 10 deletions

View File

@ -2,9 +2,9 @@
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Format.hpp>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <Nazara/Core/Debug.hpp>
namespace Nz
@ -68,15 +68,10 @@ namespace Nz
inline std::string Color::ToString() const
{
std::ostringstream ss;
ss << "Color(" << r << ", " << g << ", " << b;
if (!IsOpaque())
ss << ", " << a;
ss << ')';
return ss.str();
return Format("Color({0}, {1}, {2}, {3})", r, g, b, a);
else
return Format("Color({0}, {1}, {2})", r, g, b);
}
/*!

View File

@ -8,7 +8,6 @@
#include <array>
#include <ctime>
#include <filesystem>
#include <sstream>
#include <Nazara/Core/Debug.hpp>
namespace Nz