Merge pull request #453 from Bromeon/master
Added operator for division of two sf::Time objects
This commit is contained in:
commit
de0401a02e
@ -399,6 +399,18 @@ SFML_SYSTEM_API Time& operator /=(Time& left, float right);
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
SFML_SYSTEM_API Time& operator /=(Time& left, Int64 right);
|
SFML_SYSTEM_API Time& operator /=(Time& left, Int64 right);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \relates Time
|
||||||
|
/// \brief Overload of binary / operator to compute the ratio of two time values
|
||||||
|
///
|
||||||
|
/// \param left Left operand (a time)
|
||||||
|
/// \param right Right operand (a time)
|
||||||
|
///
|
||||||
|
/// \return \a left divided by \a right
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
SFML_SYSTEM_API float operator /(Time left, Time right);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \relates Time
|
/// \relates Time
|
||||||
/// \brief Overload of binary % operator to compute remainder of a time value
|
/// \brief Overload of binary % operator to compute remainder of a time value
|
||||||
|
@ -237,6 +237,13 @@ Time& operator /=(Time& left, Int64 right)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
float operator /(Time left, Time right)
|
||||||
|
{
|
||||||
|
return left.asSeconds() / right.asSeconds();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Time operator %(Time left, Time right)
|
Time operator %(Time left, Time right)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user