diff --git a/src/game/client/components/effects.cpp b/src/game/client/components/effects.cpp index d50f13a25..bac5e698e 100644 --- a/src/game/client/components/effects.cpp +++ b/src/game/client/components/effects.cpp @@ -158,17 +158,17 @@ void CEffects::PlayerDeath(vec2 Pos, int ClientID) { if(m_pClient->m_GameInfo.m_GameFlags&GAMEFLAG_TEAMS) { - int ColorVal = m_pClient->m_pSkins->GetTeamColor(m_pClient->m_aClients[ClientID].m_aUseCustomColors[CSkins::SKINPART_BODY], m_pClient->m_aClients[ClientID].m_aSkinPartColors[CSkins::SKINPART_BODY], - m_pClient->m_aClients[ClientID].m_Team, CSkins::SKINPART_BODY); + int ColorVal = m_pClient->m_pSkins->GetTeamColor(m_pClient->m_aClients[ClientID].m_aUseCustomColors[SKINPART_BODY], m_pClient->m_aClients[ClientID].m_aSkinPartColors[SKINPART_BODY], + m_pClient->m_aClients[ClientID].m_Team, SKINPART_BODY); BloodColor = m_pClient->m_pSkins->GetColorV3(ColorVal); } else { - if(m_pClient->m_aClients[ClientID].m_aUseCustomColors[CSkins::SKINPART_BODY]) - BloodColor = m_pClient->m_pSkins->GetColorV3(m_pClient->m_aClients[ClientID].m_aSkinPartColors[CSkins::SKINPART_BODY]); + if(m_pClient->m_aClients[ClientID].m_aUseCustomColors[SKINPART_BODY]) + BloodColor = m_pClient->m_pSkins->GetColorV3(m_pClient->m_aClients[ClientID].m_aSkinPartColors[SKINPART_BODY]); else { - const CSkins::CSkinPart *s = m_pClient->m_pSkins->GetSkinPart(CSkins::SKINPART_BODY, m_pClient->m_aClients[ClientID].m_SkinPartIDs[CSkins::SKINPART_BODY]); + const CSkins::CSkinPart *s = m_pClient->m_pSkins->GetSkinPart(SKINPART_BODY, m_pClient->m_aClients[ClientID].m_SkinPartIDs[SKINPART_BODY]); if(s) BloodColor = s->m_BloodColor; } diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index a371fb564..19f45a0dd 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -45,7 +45,7 @@ CMenus::CMenus() m_NeedRestartGraphics = false; m_NeedRestartSound = false; - m_TeePartSelected = CSkins::SKINPART_BODY; + m_TeePartSelected = SKINPART_BODY; m_aSaveSkinName[0] = 0; m_RefreshSkinSelector = true; m_pSelectedSkin = 0; diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index a1e4d348c..3b1191bce 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -78,7 +78,7 @@ void CMenus::SaveSkinfile() io_write(File, p, str_length(p)); int Count = 0; - for(int PartIndex = 0; PartIndex < CSkins::NUM_SKINPARTS; PartIndex++) + for(int PartIndex = 0; PartIndex < NUM_SKINPARTS; PartIndex++) { if(!CSkins::ms_apSkinVariables[PartIndex][0]) continue; @@ -112,7 +112,7 @@ void CMenus::SaveSkinfile() str_format(aBuf, sizeof(aBuf), ",\n\t\t\"%s\": %d", CSkins::ms_apColorComponents[c], Val); io_write(File, aBuf, str_length(aBuf)); } - if(PartIndex == CSkins::SKINPART_MARKING) + if(PartIndex == SKINPART_MARKING) { int Val = (*CSkins::ms_apColorVariables[PartIndex] >> 24) & 0xff; str_format(aBuf, sizeof(aBuf), ",\n\t\t\"%s\": %d", CSkins::ms_apColorComponents[3], Val); @@ -165,7 +165,7 @@ void CMenus::RenderHSLPicker(CUIRect MainView) MainView.HSplitTop(Spacing, 0, &MainView); bool Modified = false; - bool UseAlpha = m_TeePartSelected == CSkins::SKINPART_MARKING; + bool UseAlpha = m_TeePartSelected == SKINPART_MARKING; int Color = *CSkins::ms_apColorVariables[m_TeePartSelected]; int Hue, Sat, Lgt, Alp; @@ -384,7 +384,7 @@ void CMenus::RenderHSLPicker(CUIRect MainView) if(Modified) { int NewVal = (Hue << 16) + (Sat << 8) + Lgt; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { if(m_TeePartSelected == p) *CSkins::ms_apColorVariables[p] = NewVal; @@ -431,12 +431,12 @@ void CMenus::RenderSkinSelection(CUIRect MainView) if(Item.m_Visible) { CTeeRenderInfo Info; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { if(s->m_aUseCustomColors[p]) { Info.m_aTextures[p] = s->m_apParts[p]->m_ColorTexture; - Info.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(s->m_aPartColors[p], p==CSkins::SKINPART_MARKING); + Info.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(s->m_aPartColors[p], p==SKINPART_MARKING); } else { @@ -458,7 +458,7 @@ void CMenus::RenderSkinSelection(CUIRect MainView) { m_pSelectedSkin = s_paSkinList[NewSelected]; mem_copy(g_Config.m_PlayerSkin, m_pSelectedSkin->m_aName, sizeof(g_Config.m_PlayerSkin)); - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { mem_copy(CSkins::ms_apSkinVariables[p], m_pSelectedSkin->m_apParts[p]->m_aName, 24); *CSkins::ms_apUCCVariables[p] = m_pSelectedSkin->m_aUseCustomColors[p]; @@ -476,7 +476,7 @@ void CMenus::RenderSkinPartSelection(CUIRect MainView) static float s_ScrollValue = 0.0f; if(s_InitSkinPartList) { - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { s_paList[p].clear(); for(int i = 0; i < m_pClient->m_pSkins->NumSkinPart(p); ++i) @@ -506,7 +506,7 @@ void CMenus::RenderSkinPartSelection(CUIRect MainView) if(Item.m_Visible) { CTeeRenderInfo Info; - for(int j = 0; j < CSkins::NUM_SKINPARTS; j++) + for(int j = 0; j < NUM_SKINPARTS; j++) { int SkinPart = m_pClient->m_pSkins->FindSkinPart(j, CSkins::ms_apSkinVariables[j], false); const CSkins::CSkinPart *pSkinPart = m_pClient->m_pSkins->GetSkinPart(j, SkinPart); @@ -516,7 +516,7 @@ void CMenus::RenderSkinPartSelection(CUIRect MainView) Info.m_aTextures[j] = s->m_ColorTexture; else Info.m_aTextures[j] = pSkinPart->m_ColorTexture; - Info.m_aColors[j] = m_pClient->m_pSkins->GetColorV4(*CSkins::ms_apColorVariables[j], j==CSkins::SKINPART_MARKING); + Info.m_aColors[j] = m_pClient->m_pSkins->GetColorV4(*CSkins::ms_apColorVariables[j], j==SKINPART_MARKING); } else { @@ -943,7 +943,7 @@ void CMenus::RenderSettingsTeeCustom(CUIRect MainView) float ButtonWidth = (Patterns.w/6.0f)-(SpacingW*5.0)/6.0f; static int s_aPatternButtons[6] = {0}; - for(int i = 0; i < CSkins::NUM_SKINPARTS; i++) + for(int i = 0; i < NUM_SKINPARTS; i++) { Patterns.VSplitLeft(ButtonWidth, &Button, &Patterns); if(DoButton_MenuTabTop(&s_aPatternButtons[i], Localize(CSkins::ms_apSkinPartNames[i]), m_TeePartSelected==i, &Button)) @@ -1014,14 +1014,14 @@ void CMenus::RenderSettingsTee(CUIRect MainView) CTeeRenderInfo OwnSkinInfo; OwnSkinInfo.m_Size = 50.0f; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { int SkinPart = m_pClient->m_pSkins->FindSkinPart(p, CSkins::ms_apSkinVariables[p], false); const CSkins::CSkinPart *pSkinPart = m_pClient->m_pSkins->GetSkinPart(p, SkinPart); if(*CSkins::ms_apUCCVariables[p]) { OwnSkinInfo.m_aTextures[p] = pSkinPart->m_ColorTexture; - OwnSkinInfo.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(*CSkins::ms_apColorVariables[p], p==CSkins::SKINPART_MARKING); + OwnSkinInfo.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(*CSkins::ms_apColorVariables[p], p==SKINPART_MARKING); } else { @@ -1044,19 +1044,19 @@ void CMenus::RenderSettingsTee(CUIRect MainView) RenderTools()->DrawUIRect(&Left, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { int TeamColor = m_pClient->m_pSkins->GetTeamColor(*CSkins::ms_apUCCVariables[p], *CSkins::ms_apColorVariables[p], TEAM_RED, p); - OwnSkinInfo.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(TeamColor, p==CSkins::SKINPART_MARKING); + OwnSkinInfo.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(TeamColor, p==SKINPART_MARKING); } RenderTools()->RenderTee(CAnimState::GetIdle(), &OwnSkinInfo, 0, vec2(1, 0), vec2(Left.x+Left.w/2.0f, Left.y+Left.h/2.0f+2.0f)); RenderTools()->DrawUIRect(&Right, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { int TeamColor = m_pClient->m_pSkins->GetTeamColor(*CSkins::ms_apUCCVariables[p], *CSkins::ms_apColorVariables[p], TEAM_BLUE, p); - OwnSkinInfo.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(TeamColor, p==CSkins::SKINPART_MARKING); + OwnSkinInfo.m_aColors[p] = m_pClient->m_pSkins->GetColorV4(TeamColor, p==SKINPART_MARKING); } RenderTools()->RenderTee(CAnimState::GetIdle(), &OwnSkinInfo, 0, vec2(1, 0), vec2(Right.x+Right.w/2.0f, Right.y+Right.h/2.0f+2.0f)); } diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index f8c4ea294..8423e282f 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -45,9 +45,9 @@ void CPlayers::RenderHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float HandPos += DirY * PostRotOffset.y; //Graphics()->TextureSet(data->m_aImages[IMAGE_CHAR_DEFAULT].id); - Graphics()->TextureSet(pInfo->m_aTextures[CSkins::SKINPART_HANDS]); + Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_HANDS]); Graphics()->QuadsBegin(); - vec4 Color = pInfo->m_aColors[CSkins::SKINPART_HANDS]; + vec4 Color = pInfo->m_aColors[SKINPART_HANDS]; Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a); // two passes @@ -475,7 +475,7 @@ void CPlayers::RenderPlayer( { vec2 GhostPosition = mix(vec2(pPrevChar->m_X, pPrevChar->m_Y), vec2(pPlayerChar->m_X, pPlayerChar->m_Y), Client()->IntraGameTick()); CTeeRenderInfo Ghost = RenderInfo; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) Ghost.m_aColors[p].a *= 0.5f; RenderTools()->RenderTee(&State, &Ghost, Player.m_Emote, Direction, GhostPosition); // render ghost } @@ -540,18 +540,18 @@ void CPlayers::OnRender() if(Skin != -1) { const CSkins::CSkin *pNinja = m_pClient->m_pSkins->Get(Skin); - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { if(IsTeamplay) { m_aRenderInfo[i].m_aTextures[p] = pNinja->m_apParts[p]->m_ColorTexture; int ColorVal = m_pClient->m_pSkins->GetTeamColor(true, pNinja->m_aPartColors[p], m_pClient->m_aClients[i].m_Team, p); - m_aRenderInfo[i].m_aColors[p] = m_pClient->m_pSkins->GetColorV4(ColorVal, p==CSkins::SKINPART_MARKING); + m_aRenderInfo[i].m_aColors[p] = m_pClient->m_pSkins->GetColorV4(ColorVal, p==SKINPART_MARKING); } else if(pNinja->m_aUseCustomColors[p]) { m_aRenderInfo[i].m_aTextures[p] = pNinja->m_apParts[p]->m_ColorTexture; - m_aRenderInfo[i].m_aColors[p] = m_pClient->m_pSkins->GetColorV4(pNinja->m_aPartColors[p], p==CSkins::SKINPART_MARKING); + m_aRenderInfo[i].m_aColors[p] = m_pClient->m_pSkins->GetColorV4(pNinja->m_aPartColors[p], p==SKINPART_MARKING); } else { diff --git a/src/game/client/components/skins.h b/src/game/client/components/skins.h index 079fd5f1f..527255f81 100644 --- a/src/game/client/components/skins.h +++ b/src/game/client/components/skins.h @@ -15,14 +15,6 @@ public: SKINFLAG_SPECIAL=1<<0, SKINFLAG_STANDARD=1<<1, - SKINPART_BODY=0, - SKINPART_MARKING, - SKINPART_DECORATION, - SKINPART_HANDS, - SKINPART_FEET, - SKINPART_EYES, - NUM_SKINPARTS, - DARKEST_COLOR_LGT=61, NUM_COLOR_COMPONENTS=4 diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index cd58061bf..f8772a2c8 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -928,7 +928,7 @@ void CGameClient::OnNewSnapshot() IntsToStr(pInfo->m_aClan, 3, pClient->m_aClan); pClient->m_Country = pInfo->m_Country; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { IntsToStr(pInfo->m_aaSkinPartNames[p], 6, pClient->m_aaSkinPartNames[p]); pClient->m_aUseCustomColors[p] = pInfo->m_aUseCustomColors[p]; @@ -1284,12 +1284,12 @@ void CGameClient::CClientData::UpdateRenderInfo(CGameClient *pGameClient, bool U { m_SkinInfo.m_Size = 64; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { int ID = pGameClient->m_pSkins->FindSkinPart(p, m_aaSkinPartNames[p], false); if(ID < 0) { - if(p == CSkins::SKINPART_MARKING || p == CSkins::SKINPART_DECORATION) + if(p == SKINPART_MARKING || p == SKINPART_DECORATION) ID = pGameClient->m_pSkins->FindSkinPart(p, "", false); else ID = pGameClient->m_pSkins->FindSkinPart(p, "standard", false); @@ -1306,7 +1306,7 @@ void CGameClient::CClientData::UpdateRenderInfo(CGameClient *pGameClient, bool U if(m_aUseCustomColors[p]) { m_SkinInfo.m_aTextures[p] = pSkinPart->m_ColorTexture; - m_SkinInfo.m_aColors[p] = pGameClient->m_pSkins->GetColorV4(m_aSkinPartColors[p], p==CSkins::SKINPART_MARKING); + m_SkinInfo.m_aColors[p] = pGameClient->m_pSkins->GetColorV4(m_aSkinPartColors[p], p==SKINPART_MARKING); } else { @@ -1321,11 +1321,11 @@ void CGameClient::CClientData::UpdateRenderInfo(CGameClient *pGameClient, bool U // force team colors if(pGameClient->m_GameInfo.m_GameFlags&GAMEFLAG_TEAMS) { - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { m_RenderInfo.m_aTextures[p] = pGameClient->m_pSkins->GetSkinPart(p, m_SkinPartIDs[p])->m_ColorTexture; int ColorVal = pGameClient->m_pSkins->GetTeamColor(m_aUseCustomColors[p], m_aSkinPartColors[p], m_Team, p); - m_RenderInfo.m_aColors[p] = pGameClient->m_pSkins->GetColorV4(ColorVal, p==CSkins::SKINPART_MARKING); + m_RenderInfo.m_aColors[p] = pGameClient->m_pSkins->GetColorV4(ColorVal, p==SKINPART_MARKING); } } } @@ -1342,7 +1342,7 @@ void CGameClient::CClientData::Reset(CGameClient *pGameClient) m_Active = false; m_ChatIgnore = false; m_Friend = false; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { m_SkinPartIDs[p] = 0; m_SkinInfo.m_aTextures[p] = pGameClient->m_pSkins->GetSkinPart(p, 0)->m_ColorTexture; @@ -1388,7 +1388,7 @@ void CGameClient::SendStartInfo() Msg.m_pName = g_Config.m_PlayerName; Msg.m_pClan = g_Config.m_PlayerClan; Msg.m_Country = g_Config.m_PlayerCountry; - for(int p = 0; p < CSkins::NUM_SKINPARTS; p++) + for(int p = 0; p < NUM_SKINPARTS; p++) { Msg.m_apSkinPartNames[p] = CSkins::ms_apSkinVariables[p]; Msg.m_aUseCustomColors[p] = *CSkins::ms_apUCCVariables[p]; diff --git a/src/game/client/render.cpp b/src/game/client/render.cpp index 45f4e4a25..8ba28a850 100644 --- a/src/game/client/render.cpp +++ b/src/game/client/render.cpp @@ -332,11 +332,6 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote vec2 Direction = Dir; vec2 Position = Pos; - //Graphics()->TextureSet(data->images[IMAGE_CHAR_DEFAULT].id); - - // TODO: FIX ME - //Graphics()->QuadsDraw(pos.x, pos.y-128, 128, 128); - // first pass we draw the outline // second pass we draw the filling for(int p = 0; p < 2; p++) @@ -354,12 +349,12 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote IGraphics::CQuadItem Item; // draw decoration - if(pInfo->m_aTextures[2].IsValid()) + if(pInfo->m_aTextures[SKINPART_DECORATION].IsValid()) { Graphics()->TextureSet(pInfo->m_aTextures[2]); Graphics()->QuadsBegin(); Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle*pi*2); - Graphics()->SetColor(pInfo->m_aColors[2].r, pInfo->m_aColors[2].g, pInfo->m_aColors[2].b, pInfo->m_aColors[2].a); + Graphics()->SetColor(pInfo->m_aColors[SKINPART_DECORATION].r, pInfo->m_aColors[SKINPART_DECORATION].g, pInfo->m_aColors[SKINPART_DECORATION].b, pInfo->m_aColors[SKINPART_DECORATION].a); SelectSprite(OutLine?SPRITE_TEE_DECORATION_OUTLINE:SPRITE_TEE_DECORATION, 0, 0, 0); Item = BodyItem; Graphics()->QuadsDraw(&Item, 1); @@ -367,7 +362,7 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote } // draw body (behind marking) - Graphics()->TextureSet(pInfo->m_aTextures[0]); + Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_BODY]); Graphics()->QuadsBegin(); Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle*pi*2); if(OutLine) @@ -377,7 +372,7 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote } else { - Graphics()->SetColor(pInfo->m_aColors[0].r, pInfo->m_aColors[0].g, pInfo->m_aColors[0].b, pInfo->m_aColors[0].a); + Graphics()->SetColor(pInfo->m_aColors[SKINPART_BODY].r, pInfo->m_aColors[SKINPART_BODY].g, pInfo->m_aColors[SKINPART_BODY].b, pInfo->m_aColors[SKINPART_BODY].a); SelectSprite(SPRITE_TEE_BODY, 0, 0, 0); } Item = BodyItem; @@ -385,12 +380,13 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote Graphics()->QuadsEnd(); // draw marking - if(pInfo->m_aTextures[1].IsValid() && !OutLine) + if(pInfo->m_aTextures[SKINPART_MARKING].IsValid() && !OutLine) { - Graphics()->TextureSet(pInfo->m_aTextures[1]); + Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_MARKING]); Graphics()->QuadsBegin(); Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle*pi*2); - Graphics()->SetColor(pInfo->m_aColors[1].r*pInfo->m_aColors[1].a, pInfo->m_aColors[1].g*pInfo->m_aColors[1].a, pInfo->m_aColors[1].b*pInfo->m_aColors[1].a, pInfo->m_aColors[1].a); + Graphics()->SetColor(pInfo->m_aColors[SKINPART_MARKING].r*pInfo->m_aColors[SKINPART_MARKING].a, pInfo->m_aColors[SKINPART_MARKING].g*pInfo->m_aColors[SKINPART_MARKING].a, + pInfo->m_aColors[SKINPART_MARKING].b*pInfo->m_aColors[SKINPART_MARKING].a, pInfo->m_aColors[SKINPART_MARKING].a); SelectSprite(SPRITE_TEE_MARKING, 0, 0, 0); Item = BodyItem; Graphics()->QuadsDraw(&Item, 1); @@ -400,7 +396,7 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote // draw body (in front of marking) if(!OutLine) { - Graphics()->TextureSet(pInfo->m_aTextures[0]); + Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_BODY]); Graphics()->QuadsBegin(); Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle*pi*2); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -414,10 +410,10 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote } // draw eyes - Graphics()->TextureSet(pInfo->m_aTextures[5]); + Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_EYES]); Graphics()->QuadsBegin(); Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle*pi*2); - Graphics()->SetColor(pInfo->m_aColors[5].r, pInfo->m_aColors[5].g, pInfo->m_aColors[5].b, pInfo->m_aColors[5].a); + Graphics()->SetColor(pInfo->m_aColors[SKINPART_EYES].r, pInfo->m_aColors[SKINPART_EYES].g, pInfo->m_aColors[SKINPART_EYES].b, pInfo->m_aColors[SKINPART_EYES].a); if(p == 1) { switch (Emote) @@ -449,7 +445,7 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote } // draw feet - Graphics()->TextureSet(pInfo->m_aTextures[4]); + Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_FEET]); Graphics()->QuadsBegin(); CAnimKeyframe *pFoot = f ? pAnim->GetFrontFoot() : pAnim->GetBackFoot(); @@ -469,7 +465,7 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote float cs = 1.0f; // color scale if(Indicate) cs = 0.5f; - Graphics()->SetColor(pInfo->m_aColors[4].r*cs, pInfo->m_aColors[4].g*cs, pInfo->m_aColors[4].b*cs, pInfo->m_aColors[4].a); + Graphics()->SetColor(pInfo->m_aColors[SKINPART_FEET].r*cs, pInfo->m_aColors[SKINPART_FEET].g*cs, pInfo->m_aColors[SKINPART_FEET].b*cs, pInfo->m_aColors[SKINPART_FEET].a); SelectSprite(SPRITE_TEE_FOOT, 0, 0, 0); } diff --git a/src/game/client/render.h b/src/game/client/render.h index 969820f53..d5b3599b8 100644 --- a/src/game/client/render.h +++ b/src/game/client/render.h @@ -8,35 +8,44 @@ #include #include "ui.h" + +// sprite renderings +enum +{ + SKINPART_BODY = 0, + SKINPART_MARKING, + SKINPART_DECORATION, + SKINPART_HANDS, + SKINPART_FEET, + SKINPART_EYES, + NUM_SKINPARTS, + + SPRITE_FLAG_FLIP_Y = 1, + SPRITE_FLAG_FLIP_X = 2, + + LAYERRENDERFLAG_OPAQUE = 1, + LAYERRENDERFLAG_TRANSPARENT = 2, + + TILERENDERFLAG_EXTEND = 4, +}; + class CTeeRenderInfo { public: CTeeRenderInfo() { - for(int i = 0; i < 6; i++) + for(int i = 0; i < NUM_SKINPARTS; i++) m_aColors[i] = vec4(1,1,1,1); m_Size = 1.0f; m_GotAirJump = 1; }; - IGraphics::CTextureHandle m_aTextures[6]; - vec4 m_aColors[6]; + IGraphics::CTextureHandle m_aTextures[NUM_SKINPARTS]; + vec4 m_aColors[NUM_SKINPARTS]; float m_Size; int m_GotAirJump; }; -// sprite renderings -enum -{ - SPRITE_FLAG_FLIP_Y=1, - SPRITE_FLAG_FLIP_X=2, - - LAYERRENDERFLAG_OPAQUE=1, - LAYERRENDERFLAG_TRANSPARENT=2, - - TILERENDERFLAG_EXTEND=4, -}; - typedef void (*ENVELOPE_EVAL)(float TimeOffset, int Env, float *pChannels, void *pUser); class CRenderTools