| 45 | } |
| 46 | |
| 47 | void CUIStaticItem::Render() |
| 48 | { |
| 49 | VERIFY(g_bRendering); |
| 50 | |
| 51 | UIRender->SetShader(*hShader); |
| 52 | if (alpha_ref != -1) |
| 53 | UIRender->SetAlphaRef(alpha_ref); |
| 54 | |
| 55 | // convert&set pos |
| 56 | Fvector2 bp; |
| 57 | UI()->ClientToScreenScaled(bp, float(iPos.x), float(iPos.y)); |
| 58 | //bp.x = (float)iFloor(bp.x); |
| 59 | //bp.y = (float)iFloor(bp.y); |
| 60 | |
| 61 | // actual rendering |
| 62 | Fvector2 pos; |
| 63 | Fvector2 f_len; |
| 64 | UI()->ClientToScreenScaled(f_len, iVisRect.x2, iVisRect.y2); |
| 65 | |
| 66 | int tile_x = fis_zero(iRemX) ? iTileX : iTileX + 1; |
| 67 | int tile_y = fis_zero(iRemY) ? iTileY : iTileY + 1; |
| 68 | if (!(tile_x && tile_y)) |
| 69 | return; |
| 70 | |
| 71 | // render |
| 72 | UIRender->StartPrimitive(8 * tile_x * tile_y, IUIRender::ptTriList, UI()->m_currentPointType); |
| 73 | for (int x = 0; x < tile_x; ++x) |
| 74 | { |
| 75 | for (int y = 0; y < tile_y; ++y) |
| 76 | { |
| 77 | pos.set(bp.x + f_len.x * x, bp.y + f_len.y * y); |
| 78 | inherited::Render(pos, dwColor); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | // set scissor |
| 83 | Frect clip_rect = {iPos.x, iPos.y, iPos.x + iVisRect.x2 * iTileX + iRemX, iPos.y + iVisRect.y2 * iTileY + iRemY}; |
| 84 | UI()->PushScissor(clip_rect); |
| 85 | |
| 86 | UIRender->FlushPrimitive(); |
| 87 | |
| 88 | UI()->PopScissor(); |
| 89 | |
| 90 | if (alpha_ref != -1) |
| 91 | UIRender->SetAlphaRef(0); |
| 92 | } |
| 93 | |
| 94 | void CUIStaticItem::Render(float angle) |
| 95 | { |
nothing calls this directly
no test coverage detected