| 174 | } |
| 175 | |
| 176 | void CUIStatic::DrawTexture() |
| 177 | { |
| 178 | if (m_bTextureEnable && GetShader() && GetShader()->inited()) |
| 179 | { |
| 180 | Frect rect; |
| 181 | GetAbsoluteRect(rect); |
| 182 | m_UIStaticItem.SetPos(rect.left + m_TextureOffset.x, rect.top + m_TextureOffset.y); |
| 183 | |
| 184 | if (m_bStretchTexture) |
| 185 | { |
| 186 | if (Heading()) |
| 187 | { |
| 188 | if (m_UIStaticItem.GetFixedLTWhileHeading()) |
| 189 | { |
| 190 | float t1, t2; |
| 191 | t1 = rect.width(); |
| 192 | t2 = rect.height(); |
| 193 | rect.y2 = rect.y1 + t1; |
| 194 | rect.x2 = rect.x1 + t2; |
| 195 | } |
| 196 | } |
| 197 | m_UIStaticItem.SetRect(0, 0, rect.width(), rect.height()); |
| 198 | } |
| 199 | else |
| 200 | { |
| 201 | Frect r = {0.0f, 0.0f, m_UIStaticItem.GetOriginalRectScaled().width(), m_UIStaticItem.GetOriginalRectScaled().height()}; |
| 202 | if (r.width() && r.height()) |
| 203 | { |
| 204 | if (Heading()) |
| 205 | { |
| 206 | float t1, t2; |
| 207 | t1 = rect.width(); |
| 208 | t2 = rect.height(); |
| 209 | rect.y2 = rect.y1 + t1; |
| 210 | rect.x2 = rect.x1 + t2; |
| 211 | } |
| 212 | m_UIStaticItem.SetRect(r); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | if (Heading()) |
| 217 | { |
| 218 | m_UIStaticItem.Render(GetHeading()); |
| 219 | } |
| 220 | else |
| 221 | m_UIStaticItem.Render(); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | void CUIStatic::Update() |
| 226 | { |
nothing calls this directly
no test coverage detected