| 167 | } |
| 168 | |
| 169 | void CMiniMapSpot::Draw() |
| 170 | { |
| 171 | CObject* O = Level().CurrentViewEntity(); |
| 172 | if (O && m_icon_above->inited() && m_icon_below->inited()) |
| 173 | { |
| 174 | float ml_y = MapLocation()->GetLastPosition().y; |
| 175 | float d = O->Position().y - ml_y; |
| 176 | |
| 177 | if (d > 1.8f) |
| 178 | { |
| 179 | GetUIStaticItem().SetShader(m_icon_below); |
| 180 | GetUIStaticItem().SetOriginalRect(m_tex_rect_below.x1, m_tex_rect_below.y1, m_tex_rect_below.width(), m_tex_rect_below.height()); |
| 181 | } |
| 182 | else if (d < -1.8f) |
| 183 | { |
| 184 | GetUIStaticItem().SetShader(m_icon_above); |
| 185 | GetUIStaticItem().SetOriginalRect(m_tex_rect_above.x1, m_tex_rect_above.y1, m_tex_rect_above.width(), m_tex_rect_above.height()); |
| 186 | } |
| 187 | else |
| 188 | { |
| 189 | GetUIStaticItem().SetShader(m_icon_normal); |
| 190 | GetUIStaticItem().SetOriginalRect(m_tex_rect_normal.x1, m_tex_rect_normal.y1, m_tex_rect_normal.width(), m_tex_rect_normal.height()); |
| 191 | } |
| 192 | }; |
| 193 | |
| 194 | inherited::Draw(); |
| 195 | } |
no test coverage detected