| 67 | void CUIFrameWindow::SetColor(u32 cl) { m_UIWndFrame.SetTextureColor(cl); } |
| 68 | |
| 69 | void CUIFrameWindow::FrameClip(const Frect parentAbsR) |
| 70 | { |
| 71 | using std::max; |
| 72 | using std::min; |
| 73 | VERIFY(g_bRendering); |
| 74 | |
| 75 | // Если нет границ клиппанья, то скипаем |
| 76 | if (!GetParent()) |
| 77 | return; |
| 78 | |
| 79 | Frect ourAbsR; |
| 80 | GetAbsoluteRect(ourAbsR); |
| 81 | Fvector2 ts; |
| 82 | int tile_x, tile_y; |
| 83 | float rem_x, rem_y; |
| 84 | float size_x, size_y; |
| 85 | Frect r, null; |
| 86 | null.set(0.0f, 0.0f, 0.0f, 0.0f); |
| 87 | |
| 88 | m_UIWndFrame.UpdateSize(); |
| 89 | |
| 90 | // Проверяем на видимость фрейма |
| 91 | if (max(ourAbsR.right, parentAbsR.left) == parentAbsR.left || min(ourAbsR.left, parentAbsR.right) == parentAbsR.right || |
| 92 | min(ourAbsR.top, parentAbsR.bottom) == parentAbsR.bottom || max(ourAbsR.bottom, parentAbsR.top) == parentAbsR.top) |
| 93 | { |
| 94 | m_UIWndFrame.frame[CUIFrameRect::fmRT].SetTile(0, 0, 0, 0); |
| 95 | m_UIWndFrame.frame[CUIFrameRect::fmR].SetTile(0, 0, 0, 0); |
| 96 | m_UIWndFrame.frame[CUIFrameRect::fmRB].SetTile(0, 0, 0, 0); |
| 97 | m_UIWndFrame.frame[CUIFrameRect::fmB].SetTile(0, 0, 0, 0); |
| 98 | m_UIWndFrame.frame[CUIFrameRect::fmLB].SetTile(0, 0, 0, 0); |
| 99 | m_UIWndFrame.frame[CUIFrameRect::fmL].SetTile(0, 0, 0, 0); |
| 100 | m_UIWndFrame.frame[CUIFrameRect::fmLT].SetTile(0, 0, 0, 0); |
| 101 | m_UIWndFrame.frame[CUIFrameRect::fmT].SetTile(0, 0, 0, 0); |
| 102 | m_UIWndFrame.frame[CUIFrameRect::fmBK].SetTile(0, 0, 0, 0); |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | // fmRT |
| 107 | r.x1 = max(m_UIWndFrame.frame[CUIFrameRect::fmRT].GetPosX(), parentAbsR.left) - m_UIWndFrame.frame[CUIFrameRect::fmRT].GetPosX(); |
| 108 | r.y1 = max(m_UIWndFrame.frame[CUIFrameRect::fmRT].GetPosY(), parentAbsR.top) - m_UIWndFrame.frame[CUIFrameRect::fmRT].GetPosY(); |
| 109 | r.x2 = min(ourAbsR.right, parentAbsR.right) - max(m_UIWndFrame.frame[CUIFrameRect::fmRT].GetPosX(), parentAbsR.left) + r.x1; |
| 110 | r.y2 = min(m_UIWndFrame.frame[CUIFrameRect::fmR].GetPosY(), parentAbsR.bottom) - max(m_UIWndFrame.frame[CUIFrameRect::fmRT].GetPosY(), parentAbsR.top) + r.y1; |
| 111 | |
| 112 | ClampMax_Zero(r); |
| 113 | m_UIWndFrame.frame[CUIFrameRect::fmRT].SetRect(r); |
| 114 | m_UIWndFrame.frame[CUIFrameRect::fmRT].SetTile(1, 1, 0, 0); |
| 115 | |
| 116 | // fmR |
| 117 | UIRender->SetShader(*m_UIWndFrame.frame[CUIFrameRect::fmR].GetShader()); |
| 118 | UIRender->GetActiveTextureResolution(ts); |
| 119 | size_y = min(m_UIWndFrame.frame[CUIFrameRect::fmRB].GetPosY(), parentAbsR.bottom) - max(m_UIWndFrame.frame[CUIFrameRect::fmR].GetPosY(), parentAbsR.top); |
| 120 | size_x = min(ourAbsR.right, parentAbsR.right) - max(m_UIWndFrame.frame[CUIFrameRect::fmR].GetPosX(), parentAbsR.left); |
| 121 | rem_y = fmod(size_y, ts.y); |
| 122 | rem_x = fmod(size_x, ts.x); |
| 123 | tile_y = iFloor(size_y / ts.y); |
| 124 | tile_x = iFloor(size_x / ts.x); |
| 125 | |
| 126 | if (tile_y < 0) |
nothing calls this directly
no test coverage detected