mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Extract CRenderTools::RenderCursor
This commit is contained in:
parent
caa23bcfdd
commit
fccfbd5b70
|
@ -171,14 +171,7 @@ void CEmoticon::OnRender()
|
|||
else
|
||||
m_SelectedEyeEmote = -1;
|
||||
|
||||
Graphics()->WrapClamp();
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1, 1, 1, 1);
|
||||
IGraphics::CQuadItem QuadItem(m_SelectorMouse.x + Screen.w / 2, m_SelectorMouse.y + Screen.h / 2, 24, 24);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->WrapNormal();
|
||||
RenderTools()->RenderCursor(m_SelectorMouse + vec2(Screen.w, Screen.h) / 2, 24.0f);
|
||||
}
|
||||
|
||||
void CEmoticon::Emote(int Emoticon)
|
||||
|
|
|
@ -2575,18 +2575,8 @@ void CMenus::OnRender()
|
|||
|
||||
UI()->Update(mx, my, mx * 3.0f, my * 3.0f);
|
||||
|
||||
// render
|
||||
Render();
|
||||
|
||||
// render cursor
|
||||
Graphics()->WrapClamp();
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1, 1, 1, 1);
|
||||
IGraphics::CQuadItem QuadItem(mx, my, 24, 24);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->WrapNormal();
|
||||
RenderTools()->RenderCursor(vec2(mx, my), 24.0f);
|
||||
|
||||
// render debug information
|
||||
if(g_Config.m_Debug)
|
||||
|
|
|
@ -435,15 +435,7 @@ void CSpectator::OnRender()
|
|||
}
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
// draw cursor
|
||||
Graphics()->WrapClamp();
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
IGraphics::CQuadItem QuadItem(m_SelectorMouse.x + Width / 2.0f, m_SelectorMouse.y + Height / 2.0f, 48.0f, 48.0f);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->WrapNormal();
|
||||
RenderTools()->RenderCursor(m_SelectorMouse + vec2(Width, Height) / 2, 48.0f);
|
||||
}
|
||||
|
||||
void CSpectator::OnReset()
|
||||
|
|
|
@ -119,6 +119,18 @@ void CRenderTools::DrawSprite(float x, float y, float ScaledWidth, float ScaledH
|
|||
Graphics()->QuadsDraw(&QuadItem, 1);
|
||||
}
|
||||
|
||||
void CRenderTools::RenderCursor(vec2 Center, float Size)
|
||||
{
|
||||
Graphics()->WrapClamp();
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CURSOR].m_Id);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
IGraphics::CQuadItem QuadItem(Center.x, Center.y, Size, Size);
|
||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->WrapNormal();
|
||||
}
|
||||
|
||||
int CRenderTools::QuadContainerAddSprite(int QuadContainerIndex, float x, float y, float Size)
|
||||
{
|
||||
IGraphics::CQuadItem QuadItem(x, y, Size, Size);
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
|
||||
void DrawSprite(float x, float y, float size);
|
||||
void DrawSprite(float x, float y, float ScaledWidth, float ScaledHeight);
|
||||
void RenderCursor(vec2 Center, float Size);
|
||||
int QuadContainerAddSprite(int QuadContainerIndex, float x, float y, float size);
|
||||
int QuadContainerAddSprite(int QuadContainerIndex, float size);
|
||||
int QuadContainerAddSprite(int QuadContainerIndex, float Width, float Height);
|
||||
|
|
Loading…
Reference in a new issue