mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add CRenderTools::DrawRect/4
and make DrawUIRect/4
delegates
So usages of `DrawRoundRect/Ext` can more easily be replaced with `DrawRect/4` and so the basic draw methods can be moved to the engine graphics without depending on the `CUIRect` class.
This commit is contained in:
parent
ebf6ce4d27
commit
a0ef36847b
|
@ -507,24 +507,31 @@ void CRenderTools::DrawRoundRect(float x, float y, float w, float h, float r)
|
|||
DrawRoundRectExt(x, y, w, h, r, 0xf);
|
||||
}
|
||||
|
||||
void CRenderTools::DrawUIRect(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding)
|
||||
void CRenderTools::DrawRect(float x, float y, float w, float h, ColorRGBA Color, int Corners, float Rounding)
|
||||
{
|
||||
Graphics()->TextureClear();
|
||||
|
||||
// TODO: FIX US
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(Color);
|
||||
DrawRoundRectExt(pRect->x, pRect->y, pRect->w, pRect->h, Rounding, Corners);
|
||||
DrawRoundRectExt(x, y, w, h, Rounding, Corners);
|
||||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
void CRenderTools::DrawUIRect(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding)
|
||||
{
|
||||
DrawRect(pRect->x, pRect->y, pRect->w, pRect->h, Color, Corners, Rounding);
|
||||
}
|
||||
|
||||
void CRenderTools::DrawRect4(float x, float y, float w, float h, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, int Corners, float Rounding)
|
||||
{
|
||||
Graphics()->TextureClear();
|
||||
Graphics()->QuadsBegin();
|
||||
DrawRoundRectExt4(x, y, w, h, ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight, Rounding, Corners);
|
||||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
void CRenderTools::DrawUIRect4(const CUIRect *pRect, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, int Corners, float Rounding)
|
||||
{
|
||||
Graphics()->TextureClear();
|
||||
|
||||
Graphics()->QuadsBegin();
|
||||
DrawRoundRectExt4(pRect->x, pRect->y, pRect->w, pRect->h, ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight, Rounding, Corners);
|
||||
Graphics()->QuadsEnd();
|
||||
DrawRect4(pRect->x, pRect->y, pRect->w, pRect->h, ColorTopLeft, ColorTopRight, ColorBottomLeft, ColorBottomRight, Corners, Rounding);
|
||||
}
|
||||
|
||||
void CRenderTools::DrawCircle(float x, float y, float r, int Segments)
|
||||
|
|
|
@ -113,7 +113,9 @@ public:
|
|||
|
||||
void DrawUIElRect(CUIElement::SUIElementRect &ElUIRect, const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding);
|
||||
|
||||
void DrawRect(float x, float y, float w, float h, ColorRGBA Color, int Corners, float Rounding);
|
||||
void DrawUIRect(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding);
|
||||
void DrawRect4(float x, float y, float w, float h, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, int Corners, float Rounding);
|
||||
void DrawUIRect4(const CUIRect *pRect, vec4 ColorTopLeft, vec4 ColorTopRight, vec4 ColorBottomLeft, vec4 ColorBottomRight, int Corners, float Rounding);
|
||||
|
||||
void DrawCircle(float x, float y, float r, int Segments);
|
||||
|
|
Loading…
Reference in a new issue