use inline getter for rectange width/height

This commit is contained in:
Misha 2023-10-07 20:18:58 -04:00
parent f3b7df111e
commit d0066d9068
2 changed files with 11 additions and 4 deletions

View File

@ -1,9 +1,6 @@
#ifndef MXRECT32_H
#define MXRECT32_H
#define MxRect32GetWidth(rect) (rect.m_right - rect.m_left) + 1
#define MxRect32GetHeight(rect) (rect.m_bottom - rect.m_top) + 1
class MxRect32
{
public:
@ -20,6 +17,16 @@ class MxRect32
MxS32 m_top;
MxS32 m_right;
MxS32 m_bottom;
inline MxS32 GetWidth()
{
return (m_right - m_left) + 1;
}
inline MxS32 GetHeight()
{
return (m_bottom - m_top) + 1;
}
};
#endif // MXRECT32_H

View File

@ -109,7 +109,7 @@ void MxVideoPresenter::Destroy(MxBool p_reinit)
rect.m_top = GetLocationY();
MVideoManager()->InvalidateRect(rect);
MVideoManager()->vtable0x34(rect.m_left, rect.m_top, MxRect32GetWidth(rect), MxRect32GetHeight(rect));
MVideoManager()->vtable0x34(rect.m_left, rect.m_top, rect.GetWidth(), rect.GetHeight());
}
delete m_bitmap;