mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 11:18:36 +12:00
c++17: use std::clamp
This commit is contained in:
parent
02ba529eea
commit
7724161c14
3 changed files with 8 additions and 25 deletions
|
@ -23,14 +23,9 @@ struct gem_t
|
|||
gem_color() : r(0.0f), g(0.0f), b(0.0f) {}
|
||||
gem_color(float r_, float g_, float b_)
|
||||
{
|
||||
r = clamp(r_);
|
||||
g = clamp(g_);
|
||||
b = clamp(b_);
|
||||
}
|
||||
|
||||
float clamp(float f) const
|
||||
{
|
||||
return std::max(0.0f, std::min(f, 1.0f));
|
||||
r = std::clamp(r_, 0.0f, 1.0f);
|
||||
g = std::clamp(g_, 0.0f, 1.0f);
|
||||
b = std::clamp(b_, 0.0f, 1.0f);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue