Improved code, fixed missing includes

Thanks to d@rk-marouane (@progdupeu.pl)


Former-commit-id: 4147388501d4263e624f4c6402902ef071f88ffd
This commit is contained in:
Lynix 2014-12-17 13:53:59 +01:00
parent 02643f9442
commit 1ee02d4fcf
2 changed files with 5 additions and 3 deletions

View File

@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/StringStream.hpp>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stdexcept>
@ -235,7 +236,7 @@ inline void NzColor::ToCMYK(const NzColor& color, float* cyan, float* magenta, f
float c, m, y;
ToCMY(color, &c, &m, &y);
float k = std::min(std::min(std::min(1.f, c), m), y);
float k = std::min({1.f, c, m, y});
if (NzNumberEquals(k, 1.f))
{
@ -260,8 +261,8 @@ inline void NzColor::ToHSL(const NzColor& color, nzUInt8* hue, nzUInt8* saturati
float g = color.g / 255.f;
float b = color.b / 255.f;
float min = std::min(std::min(r, g), b); // Min. value of RGB
float max = std::max(std::max(r, g), b); // Max. value of RGB
float min = std::min({r, g, b}); // Min. value of RGB
float max = std::max({r, g, b}); // Max. value of RGB
float deltaMax = max - min; //Delta RGB value

View File

@ -5,6 +5,7 @@
#include <Nazara/Utility/VideoMode.hpp>
#include <Nazara/Utility/VideoModeImpl.hpp>
#include <algorithm>
#include <functional>
#include <Nazara/Utility/Debug.hpp>
NzVideoMode::NzVideoMode() :