mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Formspecs: Add state-selection to style elements (#9378)
This commit is contained in:
parent
ba3587e776
commit
f780bae05c
22 changed files with 462 additions and 325 deletions
|
@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "irr_v2d.h"
|
||||
#include "irr_v3d.h"
|
||||
#include "irr_aabb3d.h"
|
||||
#include "SColor.h"
|
||||
#include <matrix4.h>
|
||||
|
||||
#define rangelim(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d)))
|
||||
|
@ -432,3 +433,12 @@ inline v3f getPitchYawRoll(const core::matrix4 &m)
|
|||
{
|
||||
return getPitchYawRollRad(m) * core::RADTODEG64;
|
||||
}
|
||||
|
||||
// Muliply the RGB value of a color linearly, and clamp to black/white
|
||||
inline irr::video::SColor multiplyColorValue(const irr::video::SColor &color, float mod)
|
||||
{
|
||||
return irr::video::SColor(color.getAlpha(),
|
||||
core::clamp<u32>(color.getRed() * mod, 0, 255),
|
||||
core::clamp<u32>(color.getGreen() * mod, 0, 255),
|
||||
core::clamp<u32>(color.getBlue() * mod, 0, 255));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue