mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Improve match
This commit is contained in:
parent
693d3d2601
commit
5b75bf0145
@ -741,10 +741,14 @@ MxBool Infocenter::VTable0x5c()
|
||||
void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y)
|
||||
{
|
||||
MxS16 i;
|
||||
for (i = 0; i < sizeof(m_mapAreas) / sizeof(m_mapAreas[0]); i++) {
|
||||
if (m_mapAreas[i].m_area.ContainsPoint(p_x, p_y)) {
|
||||
for (i = 0; i < (MxS32) (sizeof(m_mapAreas) / sizeof(m_mapAreas[0])); i++) {
|
||||
MxS32 right = m_mapAreas[i].m_area.GetRight();
|
||||
MxS32 bottom = m_mapAreas[i].m_area.GetBottom();
|
||||
MxS32 left = m_mapAreas[i].m_area.GetLeft();
|
||||
MxS32 top = m_mapAreas[i].m_area.GetTop();
|
||||
|
||||
if (left <= p_x && p_x <= right && top <= p_y && p_y <= bottom)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 7) {
|
||||
|
||||
@ -71,11 +71,6 @@ class MxRect32 {
|
||||
return m_left < p_rect.m_right && p_rect.m_left < m_right && m_top < p_rect.m_bottom && p_rect.m_top < m_bottom;
|
||||
}
|
||||
|
||||
inline MxBool ContainsPoint(MxS32 p_x, MxS32 p_y)
|
||||
{
|
||||
return m_left <= p_x && p_x <= m_right && m_top <= p_y && p_y <= m_bottom;
|
||||
}
|
||||
|
||||
inline MxS32 GetWidth() const { return (m_right - m_left) + 1; }
|
||||
inline MxS32 GetHeight() const { return (m_bottom - m_top) + 1; }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user