diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp index 020a0c702..23643e2a4 100644 --- a/src/game/client/ui.cpp +++ b/src/game/client/ui.cpp @@ -94,6 +94,28 @@ void CUI::ClipDisable() Graphics()->ClipDisable(); } +void CUIRect::HSplitMid(CUIRect *pTop, CUIRect *pBottom) const +{ + CUIRect r = *this; + float Cut = r.h/2; + + if(pTop) + { + pTop->x = r.x; + pTop->y = r.y; + pTop->w = r.w; + pTop->h = Cut; + } + + if(pBottom) + { + pBottom->x = r.x; + pBottom->y = r.y + Cut; + pBottom->w = r.w; + pBottom->h = r.h - Cut; + } +} + void CUIRect::HSplitTop(float Cut, CUIRect *pTop, CUIRect *pBottom) const { CUIRect r = *this; diff --git a/src/game/client/ui.h b/src/game/client/ui.h index 9ff85dd5b..c339de733 100644 --- a/src/game/client/ui.h +++ b/src/game/client/ui.h @@ -10,6 +10,7 @@ class CUIRect public: float x, y, w, h; + void HSplitMid(CUIRect *pTop, CUIRect *pBottom) const; void HSplitTop(float Cut, CUIRect *pTop, CUIRect *pBottom) const; void HSplitBottom(float Cut, CUIRect *pTop, CUIRect *pBottom) const; void VSplitMid(CUIRect *pLeft, CUIRect *pRight) const;