mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Implemented sf::Color::toInteger() to complement the new sf::Color constructor.
This commit is contained in:
parent
88ec48cb85
commit
1f2bc148fe
@ -62,12 +62,20 @@ public:
|
||||
Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha = 255);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Construct the color from 32 bit unsigned integer
|
||||
/// \brief Construct the color from 32-bit unsigned integer
|
||||
///
|
||||
/// \param color Number containing the RGBA components (in that order)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Color(Uint32 color);
|
||||
explicit Color(Uint32 color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Retrieve the color as a 32-bit unsigned integer
|
||||
///
|
||||
/// \return Color represented as a 32-bit unsigned integer
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Uint32 toInteger();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Static member data
|
||||
|
@ -78,6 +78,13 @@ a((color & 0x000000ff) >> 0 )
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
Uint32 Color::toInteger()
|
||||
{
|
||||
return (r << 24) | (g << 16) | (b << 8) | a;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool operator ==(const Color& left, const Color& right)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user