mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix: Quads always show properly in editor
This commit is contained in:
parent
bcec9d025d
commit
ead16eb951
|
@ -72,7 +72,7 @@ public:
|
|||
// map render methods (gc_render_map.cpp)
|
||||
static void RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Channels, float Time, float *pResult);
|
||||
void RenderQuads(CQuad *pQuads, int NumQuads, int Flags, ENVELOPE_EVAL pfnEval, void *pUser);
|
||||
void ForceRenderQuads(CQuad *pQuads, int NumQuads, int Flags, ENVELOPE_EVAL pfnEval, void *pUser);
|
||||
void ForceRenderQuads(CQuad *pQuads, int NumQuads, int Flags, ENVELOPE_EVAL pfnEval, void *pUser, float Alpha = 1.0f);
|
||||
void RenderTilemap(CTile *pTiles, int w, int h, float Scale, vec4 Color, int RenderFlags, ENVELOPE_EVAL pfnEval, void *pUser, int ColorEnv, int ColorEnvOffset);
|
||||
|
||||
// helpers
|
||||
|
|
|
@ -88,10 +88,10 @@ void CRenderTools::RenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, ENV
|
|||
if(!g_Config.m_ClShowQuads || g_Config.m_ClOverlayEntities == 100)
|
||||
return;
|
||||
|
||||
ForceRenderQuads(pQuads, NumQuads, RenderFlags, pfnEval, pUser);
|
||||
ForceRenderQuads(pQuads, NumQuads, RenderFlags, pfnEval, pUser, (100-g_Config.m_ClOverlayEntities)/100.0f);
|
||||
}
|
||||
|
||||
void CRenderTools::ForceRenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, ENVELOPE_EVAL pfnEval, void *pUser)
|
||||
void CRenderTools::ForceRenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags, ENVELOPE_EVAL pfnEval, void *pUser, float Alpha)
|
||||
{
|
||||
Graphics()->QuadsBegin();
|
||||
float Conv = 1/255.0f;
|
||||
|
@ -142,10 +142,6 @@ void CRenderTools::ForceRenderQuads(CQuad *pQuads, int NumQuads, int RenderFlags
|
|||
Rot = aChannels[2]/360.0f*pi*2;
|
||||
}
|
||||
|
||||
float Alpha = (100-g_Config.m_ClOverlayEntities)/100.0f;
|
||||
if (g_Config.m_ClOverlayEntities == 100) // We're in editor
|
||||
Alpha = 1.0f;
|
||||
|
||||
IGraphics::CColorVertex Array[4] = {
|
||||
IGraphics::CColorVertex(0, q->m_aColors[0].r*Conv*r, q->m_aColors[0].g*Conv*g, q->m_aColors[0].b*Conv*b, q->m_aColors[0].a*Conv*a*Alpha),
|
||||
IGraphics::CColorVertex(1, q->m_aColors[1].r*Conv*r, q->m_aColors[1].g*Conv*g, q->m_aColors[1].b*Conv*b, q->m_aColors[1].a*Conv*a*Alpha),
|
||||
|
|
Loading…
Reference in a new issue