I just noticed that irr::core::dimension2d< T > has no operator- but it does have operator-= and operator+= always has a operator+ so why no operator- ?
~DtD
dimension2d has a operator+, +=. and -= but no - ?
I agree. Doing something like "ares->getDriver()->getScreenSize()+core::dimension2ds(-40,-40)" works but it looks off and would not work with non-signed dimensions if you ever used them.
~DtD
In case sombody is confused by my snipet, ares it my game engine and dimension2ds is just a typecase of dimension2d<s32>
~DtD
In case sombody is confused by my snipet, ares it my game engine and dimension2ds is just a typecase of dimension2d<s32>
I made a function for operator- for dimension2d just add it after operator+ in dimension2d.h on line 99.
~DtD
Code: Select all
//! Subtract two dimensions
dimension2d<T> operator-(const dimension2d<T>& other) const
{
return dimension2d<T>(Width-other.Width, Height-other.Height);
}