Color: Replace std::ostringstream usage by Format
This commit is contained in:
parent
ea4b8eaaea
commit
bbef5cfd1d
|
|
@ -2,9 +2,9 @@
|
||||||
// This file is part of the "Nazara Engine - Core module"
|
// This file is part of the "Nazara Engine - Core module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Format.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <sstream>
|
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
|
|
@ -68,15 +68,10 @@ namespace Nz
|
||||||
|
|
||||||
inline std::string Color::ToString() const
|
inline std::string Color::ToString() const
|
||||||
{
|
{
|
||||||
std::ostringstream ss;
|
|
||||||
ss << "Color(" << r << ", " << g << ", " << b;
|
|
||||||
|
|
||||||
if (!IsOpaque())
|
if (!IsOpaque())
|
||||||
ss << ", " << a;
|
return Format("Color({0}, {1}, {2}, {3})", r, g, b, a);
|
||||||
|
else
|
||||||
ss << ')';
|
return Format("Color({0}, {1}, {2})", r, g, b);
|
||||||
|
|
||||||
return ss.str();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <sstream>
|
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue