mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Merge pull request #8997 from Robyt3/Client-RenderTools-SelectSprite-Cleanup
Remove unused parameters of `SelectSprite` functions
This commit is contained in:
commit
5189c18c3c
|
@ -66,9 +66,9 @@ void CPlayers::RenderHand7(const CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir
|
||||||
Graphics()->SetColor(Color);
|
Graphics()->SetColor(Color);
|
||||||
Graphics()->QuadsSetRotation(Angle);
|
Graphics()->QuadsSetRotation(Angle);
|
||||||
|
|
||||||
RenderTools()->SelectSprite7(client_data7::SPRITE_TEE_HAND_OUTLINE, 0, 0, 0);
|
RenderTools()->SelectSprite7(client_data7::SPRITE_TEE_HAND_OUTLINE);
|
||||||
Graphics()->QuadsDraw(&QuadOutline, 1);
|
Graphics()->QuadsDraw(&QuadOutline, 1);
|
||||||
RenderTools()->SelectSprite7(client_data7::SPRITE_TEE_HAND, 0, 0, 0);
|
RenderTools()->SelectSprite7(client_data7::SPRITE_TEE_HAND);
|
||||||
Graphics()->QuadsDraw(&QuadHand, 1);
|
Graphics()->QuadsDraw(&QuadHand, 1);
|
||||||
|
|
||||||
Graphics()->QuadsSetRotation(0);
|
Graphics()->QuadsSetRotation(0);
|
||||||
|
|
|
@ -58,14 +58,14 @@ void CRenderTools::Init(IGraphics *pGraphics, ITextRender *pTextRender)
|
||||||
Graphics()->QuadContainerUpload(m_TeeQuadContainerIndex);
|
Graphics()->QuadContainerUpload(m_TeeQuadContainerIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::SelectSprite(CDataSprite *pSpr, int Flags, int sx, int sy) const
|
void CRenderTools::SelectSprite(const CDataSprite *pSprite, int Flags) const
|
||||||
{
|
{
|
||||||
int x = pSpr->m_X + sx;
|
int x = pSprite->m_X;
|
||||||
int y = pSpr->m_Y + sy;
|
int y = pSprite->m_Y;
|
||||||
int w = pSpr->m_W;
|
int w = pSprite->m_W;
|
||||||
int h = pSpr->m_H;
|
int h = pSprite->m_H;
|
||||||
int cx = pSpr->m_pSet->m_Gridx;
|
int cx = pSprite->m_pSet->m_Gridx;
|
||||||
int cy = pSpr->m_pSet->m_Gridy;
|
int cy = pSprite->m_pSet->m_Gridy;
|
||||||
|
|
||||||
GetSpriteScaleImpl(w, h, gs_SpriteWScale, gs_SpriteHScale);
|
GetSpriteScaleImpl(w, h, gs_SpriteWScale, gs_SpriteHScale);
|
||||||
|
|
||||||
|
@ -83,18 +83,16 @@ void CRenderTools::SelectSprite(CDataSprite *pSpr, int Flags, int sx, int sy) co
|
||||||
Graphics()->QuadsSetSubset(x1, y1, x2, y2);
|
Graphics()->QuadsSetSubset(x1, y1, x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::SelectSprite(int Id, int Flags, int sx, int sy) const
|
void CRenderTools::SelectSprite(int Id, int Flags) const
|
||||||
{
|
{
|
||||||
if(Id < 0 || Id >= g_pData->m_NumSprites)
|
dbg_assert(Id >= 0 && Id < g_pData->m_NumSprites, "Id invalid");
|
||||||
return;
|
SelectSprite(&g_pData->m_aSprites[Id], Flags);
|
||||||
SelectSprite(&g_pData->m_aSprites[Id], Flags, sx, sy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::SelectSprite7(int Id, int Flags, int sx, int sy) const
|
void CRenderTools::SelectSprite7(int Id, int Flags) const
|
||||||
{
|
{
|
||||||
if(Id < 0 || Id >= client_data7::g_pData->m_NumSprites)
|
dbg_assert(Id >= 0 && Id < client_data7::g_pData->m_NumSprites, "Id invalid");
|
||||||
return;
|
SelectSprite(&client_data7::g_pData->m_aSprites[Id], Flags);
|
||||||
SelectSprite(&client_data7::g_pData->m_aSprites[Id], Flags, sx, sy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRenderTools::GetSpriteScale(const CDataSprite *pSprite, float &ScaleX, float &ScaleY) const
|
void CRenderTools::GetSpriteScale(const CDataSprite *pSprite, float &ScaleX, float &ScaleY) const
|
||||||
|
@ -310,7 +308,7 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
Graphics()->TextureSet(pInfo->m_aSixup[g_Config.m_ClDummy].m_BotTexture);
|
Graphics()->TextureSet(pInfo->m_aSixup[g_Config.m_ClDummy].m_BotTexture);
|
||||||
Graphics()->QuadsBegin();
|
Graphics()->QuadsBegin();
|
||||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_BOT_BACKGROUND, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_BOT_BACKGROUND);
|
||||||
Item = BotItem;
|
Item = BotItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
|
@ -322,13 +320,13 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
Graphics()->TextureSet(pInfo->m_aSixup[g_Config.m_ClDummy].m_BotTexture);
|
Graphics()->TextureSet(pInfo->m_aSixup[g_Config.m_ClDummy].m_BotTexture);
|
||||||
Graphics()->QuadsBegin();
|
Graphics()->QuadsBegin();
|
||||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_BOT_FOREGROUND, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_BOT_FOREGROUND);
|
||||||
Item = BotItem;
|
Item = BotItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
ColorRGBA Color = pInfo->m_aSixup[g_Config.m_ClDummy].m_BotColor;
|
ColorRGBA Color = pInfo->m_aSixup[g_Config.m_ClDummy].m_BotColor;
|
||||||
Color.a = Alpha;
|
Color.a = Alpha;
|
||||||
Graphics()->SetColor(Color);
|
Graphics()->SetColor(Color);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_BOT_GLOW, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_BOT_GLOW);
|
||||||
Item = BotItem;
|
Item = BotItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
|
@ -343,7 +341,7 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
ColorRGBA Color = pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_DECORATION];
|
ColorRGBA Color = pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_DECORATION];
|
||||||
Color.a = Alpha;
|
Color.a = Alpha;
|
||||||
Graphics()->SetColor(Color);
|
Graphics()->SetColor(Color);
|
||||||
SelectSprite7(OutLine ? client_data7::SPRITE_TEE_DECORATION_OUTLINE : client_data7::SPRITE_TEE_DECORATION, 0, 0, 0);
|
SelectSprite7(OutLine ? client_data7::SPRITE_TEE_DECORATION_OUTLINE : client_data7::SPRITE_TEE_DECORATION);
|
||||||
Item = BodyItem;
|
Item = BodyItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
|
@ -356,14 +354,14 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
if(OutLine)
|
if(OutLine)
|
||||||
{
|
{
|
||||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_BODY_OUTLINE, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_BODY_OUTLINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ColorRGBA Color = pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_BODY];
|
ColorRGBA Color = pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_BODY];
|
||||||
Color.a = Alpha;
|
Color.a = Alpha;
|
||||||
Graphics()->SetColor(Color);
|
Graphics()->SetColor(Color);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_BODY, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_BODY);
|
||||||
}
|
}
|
||||||
Item = BodyItem;
|
Item = BodyItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
|
@ -377,7 +375,7 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle * pi * 2);
|
Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle * pi * 2);
|
||||||
ColorRGBA MarkingColor = pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_MARKING];
|
ColorRGBA MarkingColor = pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_MARKING];
|
||||||
Graphics()->SetColor(MarkingColor.r * MarkingColor.a, MarkingColor.g * MarkingColor.a, MarkingColor.b * MarkingColor.a, MarkingColor.a * Alpha);
|
Graphics()->SetColor(MarkingColor.r * MarkingColor.a, MarkingColor.g * MarkingColor.a, MarkingColor.b * MarkingColor.a, MarkingColor.a * Alpha);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_MARKING, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_MARKING);
|
||||||
Item = BodyItem;
|
Item = BodyItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
Graphics()->QuadsEnd();
|
Graphics()->QuadsEnd();
|
||||||
|
@ -392,7 +390,7 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
||||||
for(int t = 0; t < 2; t++)
|
for(int t = 0; t < 2; t++)
|
||||||
{
|
{
|
||||||
SelectSprite7(t == 0 ? client_data7::SPRITE_TEE_BODY_SHADOW : client_data7::SPRITE_TEE_BODY_UPPER_OUTLINE, 0, 0, 0);
|
SelectSprite7(t == 0 ? client_data7::SPRITE_TEE_BODY_SHADOW : client_data7::SPRITE_TEE_BODY_UPPER_OUTLINE);
|
||||||
Item = BodyItem;
|
Item = BodyItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
}
|
}
|
||||||
|
@ -421,19 +419,19 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
switch(Emote)
|
switch(Emote)
|
||||||
{
|
{
|
||||||
case EMOTE_PAIN:
|
case EMOTE_PAIN:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_EYES_PAIN, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_EYES_PAIN);
|
||||||
break;
|
break;
|
||||||
case EMOTE_HAPPY:
|
case EMOTE_HAPPY:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_EYES_HAPPY, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_EYES_HAPPY);
|
||||||
break;
|
break;
|
||||||
case EMOTE_SURPRISE:
|
case EMOTE_SURPRISE:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_EYES_SURPRISE, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_EYES_SURPRISE);
|
||||||
break;
|
break;
|
||||||
case EMOTE_ANGRY:
|
case EMOTE_ANGRY:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_EYES_ANGRY, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_EYES_ANGRY);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_EYES_NORMAL, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_EYES_NORMAL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,16 +454,16 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
switch(pInfo->m_aSixup[g_Config.m_ClDummy].m_HatSpriteIndex)
|
switch(pInfo->m_aSixup[g_Config.m_ClDummy].m_HatSpriteIndex)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_HATS_TOP1, Flag, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_HATS_TOP1, Flag);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_HATS_TOP2, Flag, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_HATS_TOP2, Flag);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_HATS_SIDE1, Flag, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_HATS_SIDE1, Flag);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_HATS_SIDE2, Flag, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_HATS_SIDE2, Flag);
|
||||||
}
|
}
|
||||||
Item = BodyItem;
|
Item = BodyItem;
|
||||||
Graphics()->QuadsDraw(&Item, 1);
|
Graphics()->QuadsDraw(&Item, 1);
|
||||||
|
@ -486,7 +484,7 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
if(OutLine)
|
if(OutLine)
|
||||||
{
|
{
|
||||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_FOOT_OUTLINE, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_FOOT_OUTLINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -499,7 +497,7 @@ void CRenderTools::RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pIn
|
||||||
pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_FEET].g * ColorScale,
|
pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_FEET].g * ColorScale,
|
||||||
pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_FEET].b * ColorScale,
|
pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_FEET].b * ColorScale,
|
||||||
pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_FEET].a * Alpha);
|
pInfo->m_aSixup[g_Config.m_ClDummy].m_aColors[protocol7::SKINPART_FEET].a * Alpha);
|
||||||
SelectSprite7(client_data7::SPRITE_TEE_FOOT, 0, 0, 0);
|
SelectSprite7(client_data7::SPRITE_TEE_FOOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
IGraphics::CQuadItem QuadItem(Position.x + pFoot->m_X * AnimScale, Position.y + pFoot->m_Y * AnimScale, w, h);
|
IGraphics::CQuadItem QuadItem(Position.x + pFoot->m_X * AnimScale, Position.y + pFoot->m_Y * AnimScale, w, h);
|
||||||
|
|
|
@ -178,6 +178,8 @@ class CRenderTools
|
||||||
static void GetRenderTeeBodyScale(float BaseSize, float &BodyScale);
|
static void GetRenderTeeBodyScale(float BaseSize, float &BodyScale);
|
||||||
static void GetRenderTeeFeetScale(float BaseSize, float &FeetScaleWidth, float &FeetScaleHeight);
|
static void GetRenderTeeFeetScale(float BaseSize, float &FeetScaleWidth, float &FeetScaleHeight);
|
||||||
|
|
||||||
|
void SelectSprite(const CDataSprite *pSprite, int Flags) const;
|
||||||
|
|
||||||
void RenderTee6(const CAnimState *pAnim, const CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos, float Alpha = 1.0f) const;
|
void RenderTee6(const CAnimState *pAnim, const CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos, float Alpha = 1.0f) const;
|
||||||
void RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos, float Alpha = 1.0f) const;
|
void RenderTee7(const CAnimState *pAnim, const CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos, float Alpha = 1.0f) const;
|
||||||
|
|
||||||
|
@ -187,9 +189,8 @@ public:
|
||||||
|
|
||||||
void Init(class IGraphics *pGraphics, class ITextRender *pTextRender);
|
void Init(class IGraphics *pGraphics, class ITextRender *pTextRender);
|
||||||
|
|
||||||
void SelectSprite(CDataSprite *pSprite, int Flags = 0, int sx = 0, int sy = 0) const;
|
void SelectSprite(int Id, int Flags = 0) const;
|
||||||
void SelectSprite(int Id, int Flags = 0, int sx = 0, int sy = 0) const;
|
void SelectSprite7(int Id, int Flags = 0) const;
|
||||||
void SelectSprite7(int Id, int Flags = 0, int sx = 0, int sy = 0) const;
|
|
||||||
|
|
||||||
void GetSpriteScale(const CDataSprite *pSprite, float &ScaleX, float &ScaleY) const;
|
void GetSpriteScale(const CDataSprite *pSprite, float &ScaleX, float &ScaleY) const;
|
||||||
void GetSpriteScale(int Id, float &ScaleX, float &ScaleY) const;
|
void GetSpriteScale(int Id, float &ScaleX, float &ScaleY) const;
|
||||||
|
|
Loading…
Reference in a new issue