diff options
| author | GreYFoXGTi <GreYFoXGTi@GMaiL.CoM> | 2011-02-12 12:40:36 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-02-12 21:18:41 +0100 |
| commit | 1b2703aaba9ef21b8fca7c12b299fcd0fd4b9251 (patch) | |
| tree | d4b94b98105c3af23c79bae02a132bfe66738392 /src/game/client | |
| parent | e45ad2a085d8f02aadc5d823a1d7dda4e1da70aa (diff) | |
| download | zcatch-1b2703aaba9ef21b8fca7c12b299fcd0fd4b9251.tar.gz zcatch-1b2703aaba9ef21b8fca7c12b299fcd0fd4b9251.zip | |
Refactoring & fixed WEAPONSPEC_GUN in content.py
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/components/binds.cpp | 24 | ||||
| -rw-r--r-- | src/game/client/components/binds.h | 6 | ||||
| -rw-r--r-- | src/game/client/components/chat.cpp | 26 | ||||
| -rw-r--r-- | src/game/client/components/chat.h | 4 | ||||
| -rw-r--r-- | src/game/client/components/effects.cpp | 10 | ||||
| -rw-r--r-- | src/game/client/components/effects.h | 2 | ||||
| -rw-r--r-- | src/game/client/components/hud.cpp | 12 | ||||
| -rw-r--r-- | src/game/client/components/items.cpp | 14 | ||||
| -rw-r--r-- | src/game/client/components/items.h | 2 | ||||
| -rw-r--r-- | src/game/client/components/menus.h | 2 | ||||
| -rw-r--r-- | src/game/client/components/menus_browser.cpp | 32 | ||||
| -rw-r--r-- | src/game/client/components/menus_demo.cpp | 12 | ||||
| -rw-r--r-- | src/game/client/components/nameplates.cpp | 4 | ||||
| -rw-r--r-- | src/game/client/components/players.cpp | 14 | ||||
| -rw-r--r-- | src/game/client/components/scoreboard.cpp | 12 | ||||
| -rw-r--r-- | src/game/client/components/sounds.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/components/voting.cpp | 12 | ||||
| -rw-r--r-- | src/game/client/components/voting.h | 4 | ||||
| -rw-r--r-- | src/game/client/gameclient.cpp | 132 | ||||
| -rw-r--r-- | src/game/client/gameclient.h | 6 |
20 files changed, 166 insertions, 166 deletions
diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index f2cdd85f..7f473ef4 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -26,17 +26,17 @@ CBinds::CBinds() m_SpecialBinds.m_pBinds = this; } -void CBinds::Bind(int KeyId, const char *pStr) +void CBinds::Bind(int KeyID, const char *pStr) { - if(KeyId < 0 || KeyId >= KEY_LAST) + if(KeyID < 0 || KeyID >= KEY_LAST) return; - str_copy(m_aaKeyBindings[KeyId], pStr, sizeof(m_aaKeyBindings[KeyId])); + str_copy(m_aaKeyBindings[KeyID], pStr, sizeof(m_aaKeyBindings[KeyID])); char aBuf[256]; - if(!m_aaKeyBindings[KeyId][0]) - str_format(aBuf, sizeof(aBuf), "unbound %s (%d)", Input()->KeyName(KeyId), KeyId); + if(!m_aaKeyBindings[KeyID][0]) + str_format(aBuf, sizeof(aBuf), "unbound %s (%d)", Input()->KeyName(KeyID), KeyID); else - str_format(aBuf, sizeof(aBuf), "bound %s (%d) = %s", Input()->KeyName(KeyId), KeyId, m_aaKeyBindings[KeyId]); + str_format(aBuf, sizeof(aBuf), "bound %s (%d) = %s", Input()->KeyName(KeyID), KeyID, m_aaKeyBindings[KeyID]); Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf); } @@ -60,10 +60,10 @@ void CBinds::UnbindAll() m_aaKeyBindings[i][0] = 0; } -const char *CBinds::Get(int KeyId) +const char *CBinds::Get(int KeyID) { - if(KeyId > 0 && KeyId < KEY_LAST) - return m_aaKeyBindings[KeyId]; + if(KeyID > 0 && KeyID < KEY_LAST) + return m_aaKeyBindings[KeyID]; return ""; } @@ -136,7 +136,7 @@ void CBinds::ConBind(IConsole::IResult *pResult, void *pUserData) { CBinds *pBinds = (CBinds *)pUserData; const char *pKeyName = pResult->GetString(0); - int id = pBinds->GetKeyId(pKeyName); + int id = pBinds->GetKeyID(pKeyName); if(!id) { @@ -154,7 +154,7 @@ void CBinds::ConUnbind(IConsole::IResult *pResult, void *pUserData) { CBinds *pBinds = (CBinds *)pUserData; const char *pKeyName = pResult->GetString(0); - int id = pBinds->GetKeyId(pKeyName); + int id = pBinds->GetKeyID(pKeyName); if(!id) { @@ -188,7 +188,7 @@ void CBinds::ConDumpBinds(IConsole::IResult *pResult, void *pUserData) } } -int CBinds::GetKeyId(const char *pKeyName) +int CBinds::GetKeyID(const char *pKeyName) { // check for numeric if(pKeyName[0] == '&') diff --git a/src/game/client/components/binds.h b/src/game/client/components/binds.h index 1f73016e..ad51a47c 100644 --- a/src/game/client/components/binds.h +++ b/src/game/client/components/binds.h @@ -9,7 +9,7 @@ class CBinds : public CComponent { char m_aaKeyBindings[KEY_LAST][128]; - int GetKeyId(const char *pKeyName); + int GetKeyID(const char *pKeyName); static void ConBind(IConsole::IResult *pResult, void *pUserData); static void ConUnbind(IConsole::IResult *pResult, void *pUserData); @@ -31,10 +31,10 @@ public: CBindsSpecial m_SpecialBinds; - void Bind(int KeyId, const char *pStr); + void Bind(int KeyID, const char *pStr); void SetDefaults(); void UnbindAll(); - const char *Get(int KeyId); + const char *Get(int KeyID); const char *GetKey(const char *pBindStr); virtual void OnConsoleInit(); diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 3632b45d..524f0e75 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -192,13 +192,13 @@ void CChat::OnMessage(int MsgType, void *pRawMsg) if(MsgType == NETMSGTYPE_SV_CHAT) { CNetMsg_Sv_Chat *pMsg = (CNetMsg_Sv_Chat *)pRawMsg; - AddLine(pMsg->m_Cid, pMsg->m_Team, pMsg->m_pMessage); + AddLine(pMsg->m_ClientID, pMsg->m_Team, pMsg->m_pMessage); } } -void CChat::AddLine(int ClientId, int Team, const char *pLine) +void CChat::AddLine(int ClientID, int Team, const char *pLine) { - if(ClientId != -1 && m_pClient->m_aClients[ClientId].m_aName[0] == '\0') // unknown client + if(ClientID != -1 && m_pClient->m_aClients[ClientID].m_aName[0] == '\0') // unknown client return; char *p = const_cast<char*>(pLine); @@ -219,30 +219,30 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine) m_aLines[m_CurrentLine].m_Time = time_get(); m_aLines[m_CurrentLine].m_YOffset[0] = -1.0f; m_aLines[m_CurrentLine].m_YOffset[1] = -1.0f; - m_aLines[m_CurrentLine].m_ClientId = ClientId; + m_aLines[m_CurrentLine].m_ClientID = ClientID; m_aLines[m_CurrentLine].m_Team = Team; m_aLines[m_CurrentLine].m_NameColor = -2; - m_aLines[m_CurrentLine].m_Highlighted = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalCid].m_aName) != 0; + m_aLines[m_CurrentLine].m_Highlighted = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName) != 0; - if(ClientId == -1) // server message + if(ClientID == -1) // server message { str_copy(m_aLines[m_CurrentLine].m_aName, "*** ", sizeof(m_aLines[m_CurrentLine].m_aName)); str_format(m_aLines[m_CurrentLine].m_aText, sizeof(m_aLines[m_CurrentLine].m_aText), "%s", pLine); } else { - if(m_pClient->m_aClients[ClientId].m_Team == TEAM_SPECTATORS) + if(m_pClient->m_aClients[ClientID].m_Team == TEAM_SPECTATORS) m_aLines[m_CurrentLine].m_NameColor = TEAM_SPECTATORS; if(m_pClient->m_Snap.m_pGameobj && m_pClient->m_Snap.m_pGameobj->m_Flags&GAMEFLAG_TEAMS) { - if(m_pClient->m_aClients[ClientId].m_Team == TEAM_RED) + if(m_pClient->m_aClients[ClientID].m_Team == TEAM_RED) m_aLines[m_CurrentLine].m_NameColor = TEAM_RED; - else if(m_pClient->m_aClients[ClientId].m_Team == TEAM_BLUE) + else if(m_pClient->m_aClients[ClientID].m_Team == TEAM_BLUE) m_aLines[m_CurrentLine].m_NameColor = TEAM_BLUE; } - str_copy(m_aLines[m_CurrentLine].m_aName, m_pClient->m_aClients[ClientId].m_aName, sizeof(m_aLines[m_CurrentLine].m_aName)); + str_copy(m_aLines[m_CurrentLine].m_aName, m_pClient->m_aClients[ClientID].m_aName, sizeof(m_aLines[m_CurrentLine].m_aName)); str_format(m_aLines[m_CurrentLine].m_aText, sizeof(m_aLines[m_CurrentLine].m_aText), ": %s", pLine); } @@ -252,7 +252,7 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine) } // play sound - if(ClientId >= 0) + if(ClientID >= 0) m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_CLIENT, 0, vec2(0,0)); else m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_SERVER, 0, vec2(0,0)); @@ -349,7 +349,7 @@ void CChat::OnRender() Cursor.m_LineWidth = LineWidth; // render name - if(m_aLines[r].m_ClientId == -1) + if(m_aLines[r].m_ClientID == -1) TextRender()->TextColor(1.0f, 1.0f, 0.5f, Blend); // system else if(m_aLines[r].m_Team) TextRender()->TextColor(0.45f, 0.9f, 0.45f, Blend); // team message @@ -365,7 +365,7 @@ void CChat::OnRender() TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1); // render line - if(m_aLines[r].m_ClientId == -1) + if(m_aLines[r].m_ClientID == -1) TextRender()->TextColor(1.0f, 1.0f, 0.5f, Blend); // system else if(m_aLines[r].m_Highlighted) TextRender()->TextColor(1.0f, 0.5f, 0.5f, Blend); // highlighted diff --git a/src/game/client/components/chat.h b/src/game/client/components/chat.h index da6a3b16..652564ed 100644 --- a/src/game/client/components/chat.h +++ b/src/game/client/components/chat.h @@ -18,7 +18,7 @@ class CChat : public CComponent { int64 m_Time; float m_YOffset[2]; - int m_ClientId; + int m_ClientID; int m_Team; int m_NameColor; char m_aName[64]; @@ -57,7 +57,7 @@ public: bool IsActive() const { return m_Mode != MODE_NONE; } - void AddLine(int ClientId, int Team, const char *pLine); + void AddLine(int ClientID, int Team, const char *pLine); void EnableMode(int Team); diff --git a/src/game/client/components/effects.cpp b/src/game/client/components/effects.cpp index 9f99d431..edf39c97 100644 --- a/src/game/client/components/effects.cpp +++ b/src/game/client/components/effects.cpp @@ -148,17 +148,17 @@ void CEffects::PlayerSpawn(vec2 Pos) m_pClient->m_pSounds->Play(CSounds::CHN_WORLD, SOUND_PLAYER_SPAWN, 1.0f, Pos); } -void CEffects::PlayerDeath(vec2 Pos, int Cid) +void CEffects::PlayerDeath(vec2 Pos, int ClientID) { vec3 BloodColor(1.0f,1.0f,1.0f); - if(Cid >= 0) + if(ClientID >= 0) { - if(m_pClient->m_aClients[Cid].m_UseCustomColor) - BloodColor = m_pClient->m_pSkins->GetColorV3(m_pClient->m_aClients[Cid].m_ColorBody); + if(m_pClient->m_aClients[ClientID].m_UseCustomColor) + BloodColor = m_pClient->m_pSkins->GetColorV3(m_pClient->m_aClients[ClientID].m_ColorBody); else { - const CSkins::CSkin *s = m_pClient->m_pSkins->Get(m_pClient->m_aClients[Cid].m_SkinId); + const CSkins::CSkin *s = m_pClient->m_pSkins->Get(m_pClient->m_aClients[ClientID].m_SkinID); if(s) BloodColor = s->m_BloodColor; } diff --git a/src/game/client/components/effects.h b/src/game/client/components/effects.h index 494c5137..b3924382 100644 --- a/src/game/client/components/effects.h +++ b/src/game/client/components/effects.h @@ -21,7 +21,7 @@ public: void AirJump(vec2 Pos); void DamageIndicator(vec2 Pos, vec2 Dir); void PlayerSpawn(vec2 Pos); - void PlayerDeath(vec2 Pos, int ClientId); + void PlayerDeath(vec2 Pos, int ClientID); void PowerupShine(vec2 Pos, vec2 Size); void Update(); diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index c49abca1..b87cf650 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -122,13 +122,13 @@ void CHud::RenderScoreHud() else if(m_pClient->m_Snap.m_paFlags[t]->m_CarriedBy >= 0) { // draw name of the flag holder - int Id = m_pClient->m_Snap.m_paFlags[t]->m_CarriedBy%MAX_CLIENTS; - const char *pName = m_pClient->m_aClients[Id].m_aName; + int ID = m_pClient->m_Snap.m_paFlags[t]->m_CarriedBy%MAX_CLIENTS; + const char *pName = m_pClient->m_aClients[ID].m_aName; float w = TextRender()->TextWidth(0, 10.0f, pName, -1); TextRender()->Text(0, Whole-ScoreWidthMax-ImageSize-3*Split-w, 247.0f+t*20, 10.0f, pName, -1); // draw tee of the flag holder - CTeeRenderInfo Info = m_pClient->m_aClients[Id].m_RenderInfo; + CTeeRenderInfo Info = m_pClient->m_aClients[ID].m_RenderInfo; Info.m_Size = 18.0f; RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, EMOTE_NORMAL, vec2(1,0), vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, 246.0f+Info.m_Size/2+t*20)); @@ -147,7 +147,7 @@ void CHud::RenderScoreHud() if(m_pClient->m_Snap.m_paInfoByScore[i]->m_Team != TEAM_SPECTATORS) { apPlayerInfo[t] = m_pClient->m_Snap.m_paInfoByScore[i]; - if(apPlayerInfo[t]->m_ClientId == m_pClient->m_Snap.m_LocalCid) + if(apPlayerInfo[t]->m_ClientID == m_pClient->m_Snap.m_LocalClientID) Local = t; ++t; } @@ -159,7 +159,7 @@ void CHud::RenderScoreHud() { if(m_pClient->m_Snap.m_paInfoByScore[i]->m_Team != TEAM_SPECTATORS) ++aPos[1]; - if(m_pClient->m_Snap.m_paInfoByScore[i]->m_ClientId == m_pClient->m_Snap.m_LocalCid) + if(m_pClient->m_Snap.m_paInfoByScore[i]->m_ClientID == m_pClient->m_Snap.m_LocalClientID) { apPlayerInfo[1] = m_pClient->m_Snap.m_paInfoByScore[i]; Local = 1; @@ -198,7 +198,7 @@ void CHud::RenderScoreHud() // draw tee if(apPlayerInfo[t]) { - CTeeRenderInfo Info = m_pClient->m_aClients[apPlayerInfo[t]->m_ClientId].m_RenderInfo; + CTeeRenderInfo Info = m_pClient->m_aClients[apPlayerInfo[t]->m_ClientID].m_RenderInfo; Info.m_Size = 18.0f; RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, EMOTE_NORMAL, vec2(1,0), vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, 246.0f+Info.m_Size/2+t*20)); diff --git a/src/game/client/components/items.cpp b/src/game/client/components/items.cpp index 3379378b..fe14a339 100644 --- a/src/game/client/components/items.cpp +++ b/src/game/client/components/items.cpp @@ -15,7 +15,7 @@ #include "items.h" -void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemId) +void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID) { // get positions @@ -70,12 +70,12 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemId) if(!pInfo->m_Paused) Time += (Client()->LocalTime()-LastLocalTime)*pInfo->m_Speed; - Graphics()->QuadsSetRotation(Time*pi*2*2 + ItemId); + Graphics()->QuadsSetRotation(Time*pi*2*2 + ItemID); LastLocalTime = Client()->LocalTime(); } else - Graphics()->QuadsSetRotation(Client()->LocalTime()*pi*2*2 + ItemId); + Graphics()->QuadsSetRotation(Client()->LocalTime()*pi*2*2 + ItemID); } else { @@ -175,7 +175,7 @@ void CItems::RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent) Pos = vec2(pCurrent->m_X, pCurrent->m_Y); // make sure to use predicted position if we are the carrier - if(m_pClient->m_Snap.m_pLocalInfo && pCurrent->m_CarriedBy == m_pClient->m_Snap.m_pLocalInfo->m_ClientId) + if(m_pClient->m_Snap.m_pLocalInfo && pCurrent->m_CarriedBy == m_pClient->m_Snap.m_pLocalInfo->m_ClientID) Pos = m_pClient->m_LocalCharacterPos; IGraphics::CQuadItem QuadItem(Pos.x, Pos.y-Size*0.75f, Size, Size*2); @@ -262,11 +262,11 @@ void CItems::OnRender() if(Item.m_Type == NETOBJTYPE_PROJECTILE) { - RenderProjectile((const CNetObj_Projectile *)pData, Item.m_Id); + RenderProjectile((const CNetObj_Projectile *)pData, Item.m_ID); } else if(Item.m_Type == NETOBJTYPE_PICKUP) { - const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_Id); + const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID); if(pPrev) RenderPickup((const CNetObj_Pickup *)pPrev, (const CNetObj_Pickup *)pData); } @@ -284,7 +284,7 @@ void CItems::OnRender() if(Item.m_Type == NETOBJTYPE_FLAG) { - const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_Id); + const void *pPrev = Client()->SnapFindItem(IClient::SNAP_PREV, Item.m_Type, Item.m_ID); if (pPrev) RenderFlag((const CNetObj_Flag *)pPrev, (const CNetObj_Flag *)pData); } diff --git a/src/game/client/components/items.h b/src/game/client/components/items.h index 444d0209..2fd188eb 100644 --- a/src/game/client/components/items.h +++ b/src/game/client/components/items.h @@ -6,7 +6,7 @@ class CItems : public CComponent { - void RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemId); + void RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID); void RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCurrent); void RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent); void RenderLaser(const struct CNetObj_Laser *pCurrent); diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 40f6f1bd..35a9918f 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -78,7 +78,7 @@ class CMenus : public CComponent CUIRect m_HitRect; }; - void UiDoListboxStart(void *pId, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems, + void UiDoListboxStart(void *pID, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems, int ItemsPerRow, int SelectedIndex, float ScrollValue); CListboxItem UiDoListboxNextItem(void *pID, bool Selected = false); CListboxItem UiDoListboxNextRow(); diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 6fc2cb26..f977dba6 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -27,7 +27,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) struct CColumn { - int m_Id; + int m_ID; int m_Sort; CLocConstString m_Caption; int m_Direction; @@ -270,14 +270,14 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) Button.h = Row.h; Button.w = s_aCols[c].m_Rect.w; - int Id = s_aCols[c].m_Id; + int ID = s_aCols[c].m_ID; - if(Id == COL_FLAG_LOCK) + if(ID == COL_FLAG_LOCK) { if(pItem->m_Flags & SERVER_FLAG_PASSWORD) DoButton_Icon(IMAGE_BROWSEICONS, SPRITE_BROWSE_LOCK, &Button); } - else if(Id == COL_FLAG_PURE) + else if(ID == COL_FLAG_PURE) { if( str_comp(pItem->m_aGameType, "DM") == 0 || str_comp(pItem->m_aGameType, "TDM") == 0 || @@ -291,12 +291,12 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) DoButton_Icon(IMAGE_BROWSEICONS, SPRITE_BROWSE_UNPURE, &Button); } } - else if(Id == COL_FLAG_FAV) + else if(ID == COL_FLAG_FAV) { if(pItem->m_Favorite) DoButton_Icon(IMAGE_BROWSEICONS, SPRITE_BROWSE_HEART, &Button); } - else if(Id == COL_NAME) + else if(ID == COL_NAME) { CTextCursor Cursor; TextRender()->SetCursor(&Cursor, Button.x, Button.y, 12.0f * UI()->Scale(), TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); @@ -305,14 +305,14 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) if(g_Config.m_BrFilterString[0] && (pItem->m_QuickSearchHit&IServerBrowser::QUICK_SERVERNAME)) { // highlight the parts that matches - const char *s = str_find_nocase(pItem->m_aName, g_Config.m_BrFilterString); - if(s) + const char *pStr = str_find_nocase(pItem->m_aName, g_Config.m_BrFilterString); + if(pStr) { - TextRender()->TextEx(&Cursor, pItem->m_aName, (int)(s-pItem->m_aName)); + TextRender()->TextEx(&Cursor, pItem->m_aName, (int)(pStr-pItem->m_aName)); TextRender()->TextColor(0.4f,0.4f,1.0f,1); - TextRender()->TextEx(&Cursor, s, str_length(g_Config.m_BrFilterString)); + TextRender()->TextEx(&Cursor, pStr, str_length(g_Config.m_BrFilterString)); TextRender()->TextColor(1,1,1,1); - TextRender()->TextEx(&Cursor, s+str_length(g_Config.m_BrFilterString), -1); + TextRender()->TextEx(&Cursor, pStr+str_length(g_Config.m_BrFilterString), -1); } else TextRender()->TextEx(&Cursor, pItem->m_aName, -1); @@ -320,14 +320,14 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) else TextRender()->TextEx(&Cursor, pItem->m_aName, -1); } - else if(Id == COL_MAP) + else if(ID == COL_MAP) { CTextCursor Cursor; TextRender()->SetCursor(&Cursor, Button.x, Button.y, 12.0f * UI()->Scale(), TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); Cursor.m_LineWidth = Button.w; TextRender()->TextEx(&Cursor, pItem->m_aMap, -1); } - else if(Id == COL_PLAYERS) + else if(ID == COL_PLAYERS) { str_format(aTemp, sizeof(aTemp), "%i/%i", pItem->m_NumPlayers, pItem->m_MaxPlayers); if(g_Config.m_BrFilterString[0] && (pItem->m_QuickSearchHit&IServerBrowser::QUICK_PLAYERNAME)) @@ -335,17 +335,17 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) UI()->DoLabelScaled(&Button, aTemp, 12.0f, 1); TextRender()->TextColor(1,1,1,1); } - else if(Id == COL_PING) + else if(ID == COL_PING) { str_format(aTemp, sizeof(aTemp), "%i", pItem->m_Latency); UI()->DoLabelScaled(&Button, aTemp, 12.0f, 1); } - else if(Id == COL_VERSION) + else if(ID == COL_VERSION) { const char *pVersion = pItem->m_aVersion; UI()->DoLabelScaled(&Button, pVersion, 12.0f, 1); } - else if(Id == COL_GAMETYPE) + else if(ID == COL_GAMETYPE) { CTextCursor Cursor; TextRender()->SetCursor(&Cursor, Button.x, Button.y, 12.0f*UI()->Scale(), TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 9ffe7aa6..5663bd85 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -26,12 +26,12 @@ int CMenus::DoButton_DemoPlayer(const void *pID, const char *pText, int Checked, return UI()->DoButtonLogic(pID, pText, Checked, pRect); } -int CMenus::DoButton_DemoPlayer_Sprite(const void *pID, int SpriteId, int Checked, const CUIRect *pRect) +int CMenus::DoButton_DemoPlayer_Sprite(const void *pID, int SpriteID, int Checked, const CUIRect *pRect) { RenderTools()->DrawUIRect(pRect, vec4(1,1,1, Checked ? 0.10f : 0.5f)*ButtonColorMul(pID), CUI::CORNER_ALL, 5.0f); Graphics()->TextureSet(g_pData->m_aImages[IMAGE_DEMOBUTTONS].m_Id); Graphics()->QuadsBegin(); - RenderTools()->SelectSprite(SpriteId); + RenderTools()->SelectSprite(SpriteID); IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h); Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsEnd(); @@ -79,8 +79,8 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) // do seekbar { - static int s_SeekBarId = 0; - void *id = &s_SeekBarId; + static int s_SeekBarID = 0; + void *id = &s_SeekBarID; char aBuffer[128]; RenderTools()->DrawUIRect(&SeekBar, vec4(0,0,0,0.5f), CUI::CORNER_ALL, 5.0f); @@ -235,7 +235,7 @@ static int gs_ListBoxItemsPerRow; static float gs_ListBoxScrollValue; static bool gs_ListBoxItemActivated; -void CMenus::UiDoListboxStart(void *pId, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems, +void CMenus::UiDoListboxStart(void *pID, const CUIRect *pRect, float RowHeight, const char *pTitle, const char *pBottomText, int NumItems, int ItemsPerRow, int SelectedIndex, float ScrollValue) { CUIRect Scroll, Row; @@ -290,7 +290,7 @@ void CMenus::UiDoListboxStart(void *pId, const CUIRect *pRect, float RowHeight, } Scroll.HMargin(5.0f, &Scroll); - gs_ListBoxScrollValue = DoScrollbarV(pId, &Scroll, gs_ListBoxScrollValue); + gs_ListBoxScrollValue = DoScrollbarV(pID, &Scroll, gs_ListBoxScrollValue); // the list gs_ListBoxView = gs_ListBoxOriginalView; diff --git a/src/game/client/components/nameplates.cpp b/src/game/client/components/nameplates.cpp index 39d081a9..ee67eb82 100644 --- a/src/game/client/components/nameplates.cpp +++ b/src/game/client/components/nameplates.cpp @@ -29,7 +29,7 @@ void CNamePlates::RenderNameplate( if(g_Config.m_ClNameplatesAlways == 0) a = clamp(1-powf(distance(m_pClient->m_pControls->m_TargetPos, Position)/200.0f,16.0f), 0.0f, 1.0f); - const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientId].m_aName; + const char *pName = m_pClient->m_aClients[pPlayerInfo->m_ClientID].m_aName; float tw = TextRender()->TextWidth(0, FontSize, pName, -1); TextRender()->TextColor(1.0f, 1.0f, 1.0f, a); @@ -46,7 +46,7 @@ void CNamePlates::RenderNameplate( if(g_Config.m_Debug) // render client id when in debug aswell { char aBuf[128]; - str_format(aBuf, sizeof(aBuf),"%d", pPlayerInfo->m_ClientId); + str_format(aBuf, sizeof(aBuf),"%d", pPlayerInfo->m_ClientID); TextRender()->Text(0, Position.x, Position.y-90, 28.0f, aBuf, -1); } diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 0544010a..3094a738 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -94,7 +94,7 @@ void CPlayers::RenderHook( Player = *pPlayerChar; CNetObj_PlayerInfo pInfo = *pPlayerInfo; - CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientId].m_RenderInfo; + CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientID].m_RenderInfo; // check for teamplay modes bool IsTeamplay = false; @@ -154,7 +154,7 @@ void CPlayers::RenderHook( if(pPlayerChar->m_HookedPlayer != -1) { - if(m_pClient->m_Snap.m_pLocalInfo && pPlayerChar->m_HookedPlayer == m_pClient->m_Snap.m_pLocalInfo->m_ClientId) + if(m_pClient->m_Snap.m_pLocalInfo && pPlayerChar->m_HookedPlayer == m_pClient->m_Snap.m_pLocalInfo->m_ClientID) { if(Client()->State() == IClient::STATE_DEMOPLAYBACK) // only use prediction if needed HookPos = vec2(m_pClient->m_LocalCharacterPos.x, m_pClient->m_LocalCharacterPos.y); @@ -217,7 +217,7 @@ void CPlayers::RenderPlayer( Player = *pPlayerChar; CNetObj_PlayerInfo pInfo = *pPlayerInfo; - CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientId].m_RenderInfo; + CTeeRenderInfo RenderInfo = m_pClient->m_aClients[pInfo.m_ClientID].m_RenderInfo; // check for teamplay modes bool IsTeamplay = false; @@ -509,13 +509,13 @@ void CPlayers::RenderPlayer( Graphics()->QuadsEnd(); } - if (m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart != -1 && m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart + 2 * Client()->GameTickSpeed() > Client()->GameTick()) + if (m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart != -1 && m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart + 2 * Client()->GameTickSpeed() > Client()->GameTick()) { Graphics()->TextureSet(g_pData->m_aImages[IMAGE_EMOTICONS].m_Id); Graphics()->QuadsBegin(); - int SinceStart = Client()->GameTick() - m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart; - int FromEnd = m_pClient->m_aClients[pInfo.m_ClientId].m_EmoticonStart + 2 * Client()->GameTickSpeed() - Client()->GameTick(); + int SinceStart = Client()->GameTick() - m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart; + int FromEnd = m_pClient->m_aClients[pInfo.m_ClientID].m_EmoticonStart + 2 * Client()->GameTickSpeed() - Client()->GameTick(); float a = 1; @@ -536,7 +536,7 @@ void CPlayers::RenderPlayer( Graphics()->SetColor(1.0f,1.0f,1.0f,a); // client_datas::emoticon is an offset from the first emoticon - RenderTools()->SelectSprite(SPRITE_OOP + m_pClient->m_aClients[pInfo.m_ClientId].m_Emoticon); + RenderTools()->SelectSprite(SPRITE_OOP + m_pClient->m_aClients[pInfo.m_ClientID].m_Emoticon); IGraphics::CQuadItem QuadItem(Position.x, Position.y - 23 - 32*h, 64, 64*h); Graphics()->QuadsDraw(&QuadItem, 1); Graphics()->QuadsEnd(); diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index bed48619..d5588c10 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -102,7 +102,7 @@ void CScoreboard::RenderSpectators(float x, float y, float w) { if(Count) str_append(aBuffer, ", ", sizeof(aBuffer)); - str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, sizeof(aBuffer)); + str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, sizeof(aBuffer)); Count++; } } @@ -198,9 +198,9 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch TextRender()->Text(0, x+ScoreWidth-Width, y+(FontSize-FontSizeResize)/2, FontSizeResize, aBuf, -1); FontSizeResize = FontSize; - while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1) > w-163.0f-PingWidth) + while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1) > w-163.0f-PingWidth) --FontSizeResize; - TextRender()->Text(0, x+128.0f, y+(FontSize-FontSizeResize)/2, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1); + TextRender()->Text(0, x+128.0f, y+(FontSize-FontSizeResize)/2, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1); FontSizeResize = FontSize; str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, -9999, 9999)); @@ -209,8 +209,8 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch TextRender()->Text(0, x+w-35.0f-Width, y+(FontSize-FontSizeResize)/2, FontSizeResize, aBuf, -1); // render avatar - if((m_pClient->m_Snap.m_paFlags[0] && m_pClient->m_Snap.m_paFlags[0]->m_CarriedBy == pInfo->m_ClientId) || - (m_pClient->m_Snap.m_paFlags[1] && m_pClient->m_Snap.m_paFlags[1]->m_CarriedBy == pInfo->m_ClientId)) + if((m_pClient->m_Snap.m_paFlags[0] && m_pClient->m_Snap.m_paFlags[0]->m_CarriedBy == pInfo->m_ClientID) || + (m_pClient->m_Snap.m_paFlags[1] && m_pClient->m_Snap.m_paFlags[1]->m_CarriedBy == pInfo->m_ClientID)) { Graphics()->BlendNormal(); Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id); @@ -225,7 +225,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch Graphics()->QuadsEnd(); } - CTeeRenderInfo TeeInfo = m_pClient->m_aClients[pInfo->m_ClientId].m_RenderInfo; + CTeeRenderInfo TeeInfo = m_pClient->m_aClients[pInfo->m_ClientID].m_RenderInfo; TeeInfo.m_Size *= TeeSizeMod; RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1,0), vec2(x+90, y+28+TeeOffset)); diff --git a/src/game/client/components/sounds.cpp b/src/game/client/components/sounds.cpp index d631a330..f162e5e6 100644 --- a/src/game/client/components/sounds.cpp +++ b/src/game/client/components/sounds.cpp @@ -62,7 +62,7 @@ void CSounds::Enqueue(int SetId) void CSounds::PlayAndRecord(int Chn, int SetId, float Vol, vec2 Pos) { CNetMsg_Sv_SoundGlobal Msg; - Msg.m_Soundid = SetId; + Msg.m_SoundID = SetId; Client()->SendPackMsg(&Msg, MSGFLAG_NOSEND|MSGFLAG_RECORD); Play(Chn, SetId, Vol, Pos); diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 4ddd6318..e2531818 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -31,13 +31,13 @@ void CVoting::Callvote(const char *pType, const char *pValue) Client()->SendPackMsg(&Msg, MSGFLAG_VITAL); } -void CVoting::CallvoteKick(int ClientId, const char *pReason) +void CVoting::CallvoteKick(int ClientID, const char *pReason) { char aBuf[32]; if(pReason[0]) - str_format(aBuf, sizeof(aBuf), "%d %s", ClientId, pReason); + str_format(aBuf, sizeof(aBuf), "%d %s", ClientID, pReason); else - str_format(aBuf, sizeof(aBuf), "%d", ClientId); + str_format(aBuf, sizeof(aBuf), "%d", ClientID); Callvote("kick", aBuf); } @@ -57,13 +57,13 @@ void CVoting::CallvoteOption(int OptionId) } } -void CVoting::ForcevoteKick(int ClientId, const char *pReason) +void CVoting::ForcevoteKick(int ClientID, const char *pReason) { char aBuf[32]; if(pReason[0]) - str_format(aBuf, sizeof(aBuf), "kick %d %s", ClientId, pReason); + str_format(aBuf, sizeof(aBuf), "kick %d %s", ClientID, pReason); else - str_format(aBuf, sizeof(aBuf), "kick %d", ClientId); + str_format(aBuf, sizeof(aBuf), "kick %d", ClientID); Client()->Rcon(aBuf); } diff --git a/src/game/client/components/voting.h b/src/game/client/components/voting.h index 60631107..87e0ec10 100644 --- a/src/game/client/components/voting.h +++ b/src/game/client/components/voting.h @@ -41,9 +41,9 @@ public: void RenderBars(CUIRect Bars, bool Text); - void CallvoteKick(int ClientId, const char *pReason); + void CallvoteKick(int ClientID, const char *pReason); void CallvoteOption(int Option); - void ForcevoteKick(int ClientId, const char *pReason); + void ForcevoteKick(int ClientID, const char *pReason); void ForcevoteOption(int Option); void Vote(int v); // -1 = no, 1 = yes diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index f1ff3709..99195dc3 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -374,7 +374,7 @@ void CGameClient::OnReset() for(int i = 0; i < MAX_CLIENTS; i++) { m_aClients[i].m_aName[0] = 0; - m_aClients[i].m_SkinId = 0; + m_aClients[i].m_SkinID = 0; m_aClients[i].m_Team = 0; m_aClients[i].m_Angle = 0; m_aClients[i].m_Emoticon = 0; @@ -465,12 +465,12 @@ void CGameClient::OnRender() if(m_LastSendInfo && Client()->State() == IClient::STATE_ONLINE && !m_pMenus->IsActive() && m_LastSendInfo+time_freq()*5 < time_get()) { // resend if client info differs - if(str_comp(g_Config.m_PlayerName, m_aClients[m_Snap.m_LocalCid].m_aName) || - str_comp(g_Config.m_PlayerSkin, m_aClients[m_Snap.m_LocalCid].m_aSkinName) || + if(str_comp(g_Config.m_PlayerName, m_aClients[m_Snap.m_LocalClientID].m_aName) || + str_comp(g_Config.m_PlayerSkin, m_aClients[m_Snap.m_LocalClientID].m_aSkinName) || (g_GameClient.m_Snap.m_pGameobj && !(g_GameClient.m_Snap.m_pGameobj->m_Flags&GAMEFLAG_TEAMS) && // no teamgame? - (g_Config.m_PlayerUseCustomColor != m_aClients[m_Snap.m_LocalCid].m_UseCustomColor || - g_Config.m_PlayerColorBody != m_aClients[m_Snap.m_LocalCid].m_ColorBody || - g_Config.m_PlayerColorFeet != m_aClients[m_Snap.m_LocalCid].m_ColorFeet))) + (g_Config.m_PlayerUseCustomColor != m_aClients[m_Snap.m_LocalClientID].m_UseCustomColor || + g_Config.m_PlayerColorBody != m_aClients[m_Snap.m_LocalClientID].m_ColorBody || + g_Config.m_PlayerColorFeet != m_aClients[m_Snap.m_LocalClientID].m_ColorFeet))) { SendInfo(false); } @@ -553,8 +553,8 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker) CNetMsg_Sv_Emoticon *pMsg = (CNetMsg_Sv_Emoticon *)pRawMsg; // apply - m_aClients[pMsg->m_Cid].m_Emoticon = pMsg->m_Emoticon; - m_aClients[pMsg->m_Cid].m_EmoticonStart = Client()->GameTick(); + m_aClients[pMsg->m_ClientID].m_Emoticon = pMsg->m_Emoticon; + m_aClients[pMsg->m_ClientID].m_EmoticonStart = Client()->GameTick(); } else if(MsgId == NETMSGTYPE_SV_SOUNDGLOBAL) { @@ -563,12 +563,12 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker) // don't enqueue pseudo-global sounds from demos (created by PlayAndRecord) CNetMsg_Sv_SoundGlobal *pMsg = (CNetMsg_Sv_SoundGlobal *)pRawMsg; - if(pMsg->m_Soundid == SOUND_CTF_DROP || pMsg->m_Soundid == SOUND_CTF_RETURN || - pMsg->m_Soundid == SOUND_CTF_CAPTURE || pMsg->m_Soundid == SOUND_CTF_GRAB_EN || - pMsg->m_Soundid == SOUND_CTF_GRAB_PL) - g_GameClient.m_pSounds->Enqueue(pMsg->m_Soundid); + if(pMsg->m_SoundID == SOUND_CTF_DROP || pMsg->m_SoundID == SOUND_CTF_RETURN || + pMsg->m_SoundID == SOUND_CTF_CAPTURE || pMsg->m_SoundID == SOUND_CTF_GRAB_EN || + pMsg->m_SoundID == SOUND_CTF_GRAB_PL) + g_GameClient.m_pSounds->Enqueue(pMsg->m_SoundID); else - g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_Soundid, 1.0f, vec2(0,0)); + g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_SoundID, 1.0f, vec2(0,0)); } } @@ -638,12 +638,12 @@ void CGameClient::ProcessEvents() else if(Item.m_Type == NETEVENTTYPE_DEATH) { NETEVENT_DEATH *ev = (NETEVENT_DEATH *)pData; - g_GameClient.m_pEffects->PlayerDeath(vec2(ev->m_X, ev->m_Y), ev->m_ClientId); + g_GameClient.m_pEffects->PlayerDeath(vec2(ev->m_X, ev->m_Y), ev->m_ClientID); } else if(Item.m_Type == NETEVENTTYPE_SOUNDWORLD) { NETEVENT_SOUNDWORLD *ev = (NETEVENT_SOUNDWORLD *)pData; - g_GameClient.m_pSounds->Play(CSounds::CHN_WORLD, ev->m_SoundId, 1.0f, vec2(ev->m_X, ev->m_Y)); + g_GameClient.m_pSounds->Play(CSounds::CHN_WORLD, ev->m_SoundID, 1.0f, vec2(ev->m_X, ev->m_Y)); } } } @@ -654,7 +654,7 @@ void CGameClient::OnNewSnapshot() // clear out the invalid pointers mem_zero(&g_GameClient.m_Snap, sizeof(g_GameClient.m_Snap)); - m_Snap.m_LocalCid = -1; + m_Snap.m_LocalClientID = -1; // secure snapshot { @@ -668,7 +668,7 @@ void CGameClient::OnNewSnapshot() if(g_Config.m_Debug) { char aBuf[256]; - str_format(aBuf, sizeof(aBuf), "invalidated index=%d type=%d (%s) size=%d id=%d", Index, Item.m_Type, m_NetObjHandler.GetObjName(Item.m_Type), Item.m_DataSize, Item.m_Id); + str_format(aBuf, sizeof(aBuf), "invalidated index=%d type=%d (%s) size=%d id=%d", Index, Item.m_Type, m_NetObjHandler.GetObjName(Item.m_Type), Item.m_DataSize, Item.m_ID); Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf); } Client()->SnapInvalidateItem(IClient::SNAP_CURRENT, Index); @@ -708,41 +708,41 @@ void CGameClient::OnNewSnapshot() if(Item.m_Type == NETOBJTYPE_CLIENTINFO) { const CNetObj_ClientInfo *pInfo = (const CNetObj_ClientInfo *)pData; - int Cid = Item.m_Id; - IntsToStr(&pInfo->m_Name0, 6, m_aClients[Cid].m_aName); - IntsToStr(&pInfo->m_Skin0, 6, m_aClients[Cid].m_aSkinName); + int ClientID = Item.m_ID; + IntsToStr(&pInfo->m_Name0, 6, m_aClients[ClientID].m_aName); + IntsToStr(&pInfo->m_Skin0, 6, m_aClients[ClientID].m_aSkinName); - m_aClients[Cid].m_UseCustomColor = pInfo->m_UseCustomColor; - m_aClients[Cid].m_ColorBody = pInfo->m_ColorBody; - m_aClients[Cid].m_ColorFeet = pInfo->m_ColorFeet; + m_aClients[ClientID].m_UseCustomColor = pInfo->m_UseCustomColor; + m_aClients[ClientID].m_ColorBody = pInfo->m_ColorBody; + m_aClients[ClientID].m_ColorFeet = pInfo->m_ColorFeet; // prepare the info - if(m_aClients[Cid].m_aSkinName[0] == 'x' || m_aClients[Cid].m_aSkinName[1] == '_') - str_copy(m_aClients[Cid].m_aSkinName, "default", 64); + if(m_aClients[ClientID].m_aSkinName[0] == 'x' || m_aClients[ClientID].m_aSkinName[1] == '_') + str_copy(m_aClients[ClientID].m_aSkinName, "default", 64); - m_aClients[Cid].m_SkinInfo.m_ColorBody = m_pSkins->GetColorV4(m_aClients[Cid].m_ColorBody); - m_aClients[Cid].m_SkinInfo.m_ColorFeet = m_pSkins->GetColorV4(m_aClients[Cid].m_ColorFeet); - m_aClients[Cid].m_SkinInfo.m_Size = 64; + m_aClients[ClientID].m_SkinInfo.m_ColorBody = m_pSkins->GetColorV4(m_aClients[ClientID].m_ColorBody); + m_aClients[ClientID].m_SkinInfo.m_ColorFeet = m_pSkins->GetColorV4(m_aClients[ClientID].m_ColorFeet); + m_aClients[ClientID].m_SkinInfo.m_Size = 64; // find new skin - m_aClients[Cid].m_SkinId = g_GameClient.m_pSkins->Find(m_aClients[Cid].m_aSkinName); - if(m_aClients[Cid].m_SkinId < 0) + m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find(m_aClients[ClientID].m_aSkinName); + if(m_aClients[ClientID].m_SkinID < 0) { - m_aClients[Cid].m_SkinId = g_GameClient.m_pSkins->Find("default"); - if(m_aClients[Cid].m_SkinId < 0) - m_aClients[Cid].m_SkinId = 0; + m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find("default"); + if(m_aClients[ClientID].m_SkinID < 0) + m_aClients[ClientID].m_SkinID = 0; } - if(m_aClients[Cid].m_UseCustomColor) - m_aClients[Cid].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[Cid].m_SkinId)->m_ColorTexture; + if(m_aClients[ClientID].m_UseCustomColor) + m_aClients[ClientID].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[ClientID].m_SkinID)->m_ColorTexture; else { - m_aClients[Cid].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[Cid].m_SkinId)->m_OrgTexture; - m_aClients[Cid].m_SkinInfo.m_ColorBody = vec4(1,1,1,1); - m_aClients[Cid].m_SkinInfo.m_ColorFeet = vec4(1,1,1,1); + m_aClients[ClientID].m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(m_aClients[ClientID].m_SkinID)->m_OrgTexture; + m_aClients[ClientID].m_SkinInfo.m_ColorBody = vec4(1,1,1,1); + m_aClients[ClientID].m_SkinInfo.m_ColorFeet = vec4(1,1,1,1); } - m_aClients[Cid].UpdateRenderInfo(); + m_aClients[ClientID].UpdateRenderInfo(); g_GameClient.m_Snap.m_NumPlayers++; } @@ -750,12 +750,12 @@ void CGameClient::OnNewSnapshot() { const CNetObj_PlayerInfo *pInfo = (const CNetObj_PlayerInfo *)pData; - m_aClients[pInfo->m_ClientId].m_Team = pInfo->m_Team; - m_Snap.m_paPlayerInfos[pInfo->m_ClientId] = pInfo; + m_aClients[pInfo->m_ClientID].m_Team = pInfo->m_Team; + m_Snap.m_paPlayerInfos[pInfo->m_ClientID] = pInfo; if(pInfo->m_Local) { - m_Snap.m_LocalCid = Item.m_Id; + m_Snap.m_LocalClientID = Item.m_ID; m_Snap.m_pLocalInfo = pInfo; if(pInfo->m_Team == TEAM_SPECTATORS) @@ -769,17 +769,17 @@ void CGameClient::OnNewSnapshot() } else if(Item.m_Type == NETOBJTYPE_CHARACTER) { - const void *pOld = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, Item.m_Id); + const void *pOld = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, Item.m_ID); if(pOld) { - m_Snap.m_aCharacters[Item.m_Id].m_Active = true; - m_Snap.m_aCharacters[Item.m_Id].m_Prev = *((const CNetObj_Character *)pOld); - m_Snap.m_aCharacters[Item.m_Id].m_Cur = *((const CNetObj_Character *)pData); - - if(m_Snap.m_aCharacters[Item.m_Id].m_Prev.m_Tick) - Evolve(&m_Snap.m_aCharacters[Item.m_Id].m_Prev, Client()->PrevGameTick()); - if(m_Snap.m_aCharacters[Item.m_Id].m_Cur.m_Tick) - Evolve(&m_Snap.m_aCharacters[Item.m_Id].m_Cur, Client()->GameTick()); + m_Snap.m_aCharacters[Item.m_ID].m_Active = true; + m_Snap.m_aCharacters[Item.m_ID].m_Prev = *((const CNetObj_Character *)pOld); + m_Snap.m_aCharacters[Item.m_ID].m_Cur = *((const CNetObj_Character *)pData); + + if(m_Snap.m_aCharacters[Item.m_ID].m_Prev.m_Tick) + Evolve(&m_Snap.m_aCharacters[Item.m_ID].m_Prev, Client()->PrevGameTick()); + if(m_Snap.m_aCharacters[Item.m_ID].m_Cur.m_Tick) + Evolve(&m_Snap.m_aCharacters[Item.m_ID].m_Cur, Client()->GameTick()); } } else if(Item.m_Type == NETOBJTYPE_GAME) @@ -793,21 +793,21 @@ void CGameClient::OnNewSnapshot() s_GameOver = m_Snap.m_pGameobj->m_GameOver; } else if(Item.m_Type == NETOBJTYPE_FLAG) - m_Snap.m_paFlags[Item.m_Id%2] = (const CNetObj_Flag *)pData; + m_Snap.m_paFlags[Item.m_ID%2] = (const CNetObj_Flag *)pData; } } // setup local pointers - if(m_Snap.m_LocalCid >= 0) + if(m_Snap.m_LocalClientID >= 0) { - CSnapState::CCharacterInfo *c = &m_Snap.m_aCharacters[m_Snap.m_LocalCid]; + CSnapState::CCharacterInfo *c = &m_Snap.m_aCharacters[m_Snap.m_LocalClientID]; if(c->m_Active) { m_Snap.m_pLocalCharacter = &c->m_Cur; m_Snap.m_pLocalPrevCharacter = &c->m_Prev; m_LocalCharacterPos = vec2(m_Snap.m_pLocalCharacter->m_X, m_Snap.m_pLocalCharacter->m_Y); } - else if(Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, m_Snap.m_LocalCid)) + else if(Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, m_Snap.m_LocalClientID)) { // player died m_pControls->OnPlayerDeath(); @@ -853,7 +853,7 @@ void CGameClient::OnPredict() CCharacterCore BeforeChar = m_PredictedChar; // we can't predict without our own id or own character - if(m_Snap.m_LocalCid == -1 || !m_Snap.m_aCharacters[m_Snap.m_LocalCid].m_Active) + if(m_Snap.m_LocalClientID == -1 || !m_Snap.m_aCharacters[m_Snap.m_LocalClientID].m_Active) return; // don't predict anything if we are paused @@ -885,8 +885,8 @@ void CGameClient::OnPredict() for(int Tick = Client()->GameTick()+1; Tick <= Client()->PredGameTick(); Tick++) { // fetch the local - if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalCid]) - m_PredictedPrevChar = *World.m_apCharacters[m_Snap.m_LocalCid]; + if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalClientID]) + m_PredictedPrevChar = *World.m_apCharacters[m_Snap.m_LocalClientID]; // first calculate where everyone should move for(int c = 0; c < MAX_CLIENTS; c++) @@ -895,7 +895,7 @@ void CGameClient::OnPredict() continue; mem_zero(&World.m_apCharacters[c]->m_Input, sizeof(World.m_apCharacters[c]->m_Input)); - if(m_Snap.m_LocalCid == c) + if(m_Snap.m_LocalClientID == c) { // apply player input int *pInput = Client()->GetInput(Tick); @@ -924,10 +924,10 @@ void CGameClient::OnPredict() m_LastNewPredictedTick = Tick; m_NewPredictedTick = true; - if(m_Snap.m_LocalCid != -1 && World.m_apCharacters[m_Snap.m_LocalCid]) + if(m_Snap.m_LocalClientID != -1 && World.m_apCharacters[m_Snap.m_LocalClientID]) { - vec2 Pos = World.m_apCharacters[m_Snap.m_LocalCid]->m_Pos; - int Events = World.m_apCharacters[m_Snap.m_LocalCid]->m_TriggeredEvents; + vec2 Pos = World.m_apCharacters[m_Snap.m_LocalClientID]->m_Pos; + int Events = World.m_apCharacters[m_Snap.m_LocalClientID]->m_TriggeredEvents; if(Events&COREEVENT_GROUND_JUMP) g_GameClient.m_pSounds->PlayAndRecord(CSounds::CHN_WORLD, SOUND_PLAYER_JUMP, 1.0f, Pos); /*if(events&COREEVENT_AIR_JUMP) @@ -944,8 +944,8 @@ void CGameClient::OnPredict() } } - if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalCid]) - m_PredictedChar = *World.m_apCharacters[m_Snap.m_LocalCid]; + if(Tick == Client()->PredGameTick() && World.m_apCharacters[m_Snap.m_LocalClientID]) + m_PredictedChar = *World.m_apCharacters[m_Snap.m_LocalClientID]; } if(g_Config.m_Debug && g_Config.m_ClPredict && m_PredictedTick == Client()->PredGameTick()) @@ -987,7 +987,7 @@ void CGameClient::CClientData::UpdateRenderInfo() const int TeamColors[2] = {65387, 10223467}; if(m_Team >= TEAM_RED && m_Team <= TEAM_BLUE) { - m_RenderInfo.m_Texture = g_GameClient.m_pSkins->Get(m_SkinId)->m_ColorTexture; + m_RenderInfo.m_Texture = g_GameClient.m_pSkins->Get(m_SkinID)->m_ColorTexture; m_RenderInfo.m_ColorBody = g_GameClient.m_pSkins->GetColorV4(TeamColors[m_Team]); m_RenderInfo.m_ColorFeet = g_GameClient.m_pSkins->GetColorV4(TeamColors[m_Team]); } @@ -1029,7 +1029,7 @@ void CGameClient::SendInfo(bool Start) } } -void CGameClient::SendKill(int ClientId) +void CGameClient::SendKill(int ClientID) { CNetMsg_Cl_Kill Msg; Client()->SendPackMsg(&Msg, MSGFLAG_VITAL); diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 1e5c4856..35deec7b 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -113,7 +113,7 @@ public: const CNetObj_PlayerInfo *m_paPlayerInfos[MAX_CLIENTS]; const CNetObj_PlayerInfo *m_paInfoByScore[MAX_CLIENTS]; - int m_LocalCid; + int m_LocalClientID; int m_NumPlayers; int m_aTeamSize[2]; bool m_Spectate; @@ -145,7 +145,7 @@ public: char m_aName[64]; char m_aSkinName[64]; - int m_SkinId; + int m_SkinID; int m_SkinColor; int m_Team; int m_Emoticon; @@ -193,7 +193,7 @@ public: // TODO: move these void SendSwitchTeam(int Team); void SendInfo(bool Start); - void SendKill(int ClientId); + void SendKill(int ClientID); // pointers to all systems class CGameConsole *m_pGameConsole; |