From c6fd4a2cc57f8d9dec7164aff98f5a73abc9698d Mon Sep 17 00:00:00 2001 From: Shereef Marzouk Date: Thu, 11 Aug 2011 10:59:14 +0200 Subject: General whitespace and tab cleanup --- src/game/client/components/hud.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game/client/components/hud.cpp') diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 11343912..17365116 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -108,7 +108,7 @@ void CHud::RenderScoreHud() if(GameFlags&GAMEFLAG_FLAGS) { - int BlinkTimer = (m_pClient->m_FlagDropTick[t] != 0 && + int BlinkTimer = (m_pClient->m_FlagDropTick[t] != 0 && (Client()->GameTick()-m_pClient->m_FlagDropTick[t])/Client()->GameTickSpeed() >= 25) ? 10 : 20; if(FlagCarrier[t] == FLAG_ATSTAND || (FlagCarrier[t] == FLAG_TAKEN && ((Client()->GameTick()/BlinkTimer)&1))) { -- cgit 1.4.1 From c1942ca6cbafb605e3ebc8e8cfabf982144f388f Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 1 Jan 2012 13:38:46 +0100 Subject: fixed the render frame time and cleaned up some more code --- src/engine/client.h | 4 +- src/engine/client/client.cpp | 60 ++++++++------- src/engine/client/client.h | 9 ++- src/engine/client/graphics_threaded.cpp | 132 +------------------------------- src/engine/client/graphics_threaded.h | 10 +++ src/game/client/components/hud.cpp | 2 +- src/game/client/components/items.cpp | 3 - 7 files changed, 54 insertions(+), 166 deletions(-) (limited to 'src/game/client/components/hud.cpp') diff --git a/src/engine/client.h b/src/engine/client.h index 966e8f61..e9076b76 100644 --- a/src/engine/client.h +++ b/src/engine/client.h @@ -23,7 +23,7 @@ protected: float m_PredIntraTick; float m_LocalTime; - float m_FrameTime; + float m_RenderFrameTime; int m_GameTickSpeed; public: @@ -68,7 +68,7 @@ public: inline int GameTickSpeed() const { return m_GameTickSpeed; } // other time access - inline float FrameTime() const { return m_FrameTime; } + inline float RenderFrameTime() const { return m_RenderFrameTime; } inline float LocalTime() const { return m_LocalTime; } // actions diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index b54b9084..b7244db4 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -244,10 +244,11 @@ CClient::CClient() : m_DemoPlayer(&m_SnapshotDelta), m_DemoRecorder(&m_SnapshotD m_pMap = 0; m_pConsole = 0; - m_FrameTime = 0.0001f; - m_FrameTimeLow = 1.0f; - m_FrameTimeHigh = 0.0f; - m_Frames = 0; + m_RenderFrameTime = 0.0001f; + m_RenderFrameTimeLow = 1.0f; + m_RenderFrameTimeHigh = 0.0f; + m_RenderFrames = 0; + m_LastRenderTime = time_get(); m_GameTickSpeed = SERVER_TICK_SPEED; @@ -681,13 +682,13 @@ void CClient::DebugRender() udp = 8 total = 42 */ - FrameTimeAvg = FrameTimeAvg*0.9f + m_FrameTime*0.1f; + FrameTimeAvg = FrameTimeAvg*0.9f + m_RenderFrameTime*0.1f; str_format(aBuffer, sizeof(aBuffer), "ticks: %8d %8d mem %dk %d gfxmem: %dk fps: %3d", m_CurGameTick, m_PredTick, mem_stats()->allocated/1024, mem_stats()->total_allocations, Graphics()->MemoryUsage()/1024, - (int)(1.0f/FrameTimeAvg)); + (int)(1.0f/FrameTimeAvg + 0.5f)); Graphics()->QuadsText(2, 2, 16, 1,1,1,1, aBuffer); @@ -1691,9 +1692,6 @@ void CClient::InitInterfaces() void CClient::Run() { - int64 ReportTime = time_get(); - int64 ReportInterval = time_freq()*1; - m_LocalStartTime = time_get(); m_SnapshotParts = 0; @@ -1772,9 +1770,6 @@ void CClient::Run() while (1) { - int64 FrameStartTime = time_get(); - m_Frames++; - // VersionUpdate(); @@ -1866,9 +1861,22 @@ void CClient::Run() if(!g_Config.m_GfxAsyncRender || m_pGraphics->IsIdle()) { + m_RenderFrames++; + + // update frametime + int64 Now = time_get(); + m_RenderFrameTime = (Now - m_LastRenderTime) / (float)time_freq(); + if(m_RenderFrameTime < m_RenderFrameTimeLow) + m_RenderFrameTimeLow = m_RenderFrameTime; + if(m_RenderFrameTime > m_RenderFrameTimeHigh) + m_RenderFrameTimeHigh = m_RenderFrameTime; + m_FpsGraph.Add(1.0f/m_RenderFrameTime, 1,1,1); + + m_LastRenderTime = Now; + if(g_Config.m_DbgStress) { - if((m_Frames%10) == 0) + if((m_RenderFrames%10) == 0) { Render(); m_pGraphics->Swap(); @@ -1879,6 +1887,9 @@ void CClient::Run() Render(); m_pGraphics->Swap(); } + + + } } @@ -1900,32 +1911,25 @@ void CClient::Run() g_Config.m_DbgHitch = 0; } + /* if(ReportTime < time_get()) { if(0 && g_Config.m_Debug) { dbg_msg("client/report", "fps=%.02f (%.02f %.02f) netstate=%d", m_Frames/(float)(ReportInterval/time_freq()), - 1.0f/m_FrameTimeHigh, - 1.0f/m_FrameTimeLow, + 1.0f/m_RenderFrameTimeHigh, + 1.0f/m_RenderFrameTimeLow, m_NetClient.State()); } - m_FrameTimeLow = 1; - m_FrameTimeHigh = 0; - m_Frames = 0; + m_RenderFrameTimeLow = 1; + m_RenderFrameTimeHigh = 0; + m_RenderFrames = 0; ReportTime += ReportInterval; - } - - // update frametime - m_FrameTime = (time_get()-FrameStartTime)/(float)time_freq(); - if(m_FrameTime < m_FrameTimeLow) - m_FrameTimeLow = m_FrameTime; - if(m_FrameTime > m_FrameTimeHigh) - m_FrameTimeHigh = m_FrameTime; + }*/ + // update local time m_LocalTime = (time_get()-m_LocalStartTime)/(float)time_freq(); - - m_FpsGraph.Add(1.0f/m_FrameTime, 1,1,1); } GameClient()->OnShutdown(); diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 83553eb4..1849830c 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -84,9 +84,12 @@ class CClient : public IClient, public CDemoPlayer::IListner int64 m_LocalStartTime; int m_DebugFont; - float m_FrameTimeLow; - float m_FrameTimeHigh; - int m_Frames; + + int64 m_LastRenderTime; + float m_RenderFrameTimeLow; + float m_RenderFrameTimeHigh; + int m_RenderFrames; + NETADDR m_ServerAddress; int m_WindowMustRefocus; int m_SnapCrcErrors; diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index febb3b28..694ecc71 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -230,130 +230,6 @@ class CCommandProcessorFragment_SDL // SDL stuff SDL_Surface *m_pScreenSurface; bool m_SystemInited; - /* - int TryInit() - { - const SDL_VideoInfo *pInfo = SDL_GetVideoInfo(); - SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE); - - // set flags - int Flags = SDL_OPENGL; - if(g_Config.m_DbgResizable) - Flags |= SDL_RESIZABLE; - - if(pInfo->hw_available) // ignore_convention - Flags |= SDL_HWSURFACE; - else - Flags |= SDL_SWSURFACE; - - if(pInfo->blit_hw) // ignore_convention - Flags |= SDL_HWACCEL; - - if(g_Config.m_GfxFullscreen) - Flags |= SDL_FULLSCREEN; - - // set gl attributes - if(g_Config.m_GfxFsaaSamples) - { - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, g_Config.m_GfxFsaaSamples); - } - else - { - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); - } - - SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, g_Config.m_GfxVsync); - - // set caption - SDL_WM_SetCaption("Teeworlds", "Teeworlds"); - - // create window - m_pScreenSurface = SDL_SetVideoMode(g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight, 0, Flags); - if(m_pScreenSurface == NULL) - { - dbg_msg("gfx", "unable to set video mode: %s", SDL_GetError()); - return -1; - } - - return 0; - } - - - int InitWindow() - { - if(TryInit() == 0) - return 0; - - // try disabling fsaa - while(g_Config.m_GfxFsaaSamples) - { - g_Config.m_GfxFsaaSamples--; - - if(g_Config.m_GfxFsaaSamples) - dbg_msg("gfx", "lowering FSAA to %d and trying again", g_Config.m_GfxFsaaSamples); - else - dbg_msg("gfx", "disabling FSAA and trying again"); - - if(TryInit() == 0) - return 0; - } - - // try lowering the resolution - if(g_Config.m_GfxScreenWidth != 640 || g_Config.m_GfxScreenHeight != 480) - { - dbg_msg("gfx", "setting resolution to 640x480 and trying again"); - g_Config.m_GfxScreenWidth = 640; - g_Config.m_GfxScreenHeight = 480; - - if(TryInit() == 0) - return 0; - } - - dbg_msg("gfx", "out of ideas. failed to init graphics"); - - return -1; - } - - int Init() - { - { - int Systems = SDL_INIT_VIDEO; - - if(g_Config.m_SndEnable) - Systems |= SDL_INIT_AUDIO; - - if(g_Config.m_ClEventthread) - Systems |= SDL_INIT_EVENTTHREAD; - - if(SDL_Init(Systems) < 0) - { - dbg_msg("gfx", "unable to init SDL: %s", SDL_GetError()); - return -1; - } - } - - - if(InitWindow() != 0) - return -1; - - SDL_ShowCursor(0); - - // set some default settings - glEnable(GL_BLEND); - glDisable(GL_CULL_FACE); - glDisable(GL_DEPTH_TEST); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - glAlphaFunc(GL_GREATER, 0); - glEnable(GL_ALPHA_TEST); - glDepthMask(0); - - return 0; - }*/ void Cmd_Init(const CCommandBuffer::SCommand_Init *pCommand) { @@ -445,14 +321,11 @@ class CCommandProcessorFragment_SDL dbg_msg("gfx", "unable to set video mode: %s", SDL_GetError()); *pCommand->m_pResult = -1; } - - - //*pCommand->m_pResult = Init(); } void Cmd_Shutdown(const CCommandBuffer::SCommand_Shutdown *pCommand) { - + SDL_Quit(); } void Cmd_Swap(const CCommandBuffer::SCommand_Swap *pCommand) @@ -1312,7 +1185,8 @@ bool CGraphics_Threaded::Init() void CGraphics_Threaded::Shutdown() { // TODO: SDL, is this correct? - SDL_Quit(); + + // } void CGraphics_Threaded::Minimize() diff --git a/src/engine/client/graphics_threaded.h b/src/engine/client/graphics_threaded.h index 54455d6d..1ea84ea9 100644 --- a/src/engine/client/graphics_threaded.h +++ b/src/engine/client/graphics_threaded.h @@ -78,6 +78,9 @@ public: // swap CMD_SWAP, + + // + CMD_SCREENSHOT, }; enum @@ -192,6 +195,13 @@ public: SVertex *m_pVertices; }; + struct SCommand_Screenshot : public SCommand + { + SCommand_Screenshot() : SCommand(CMD_SCREENSHOT) {} + + CImageInfo *m_pImage; // processor will fill this out + }; + struct SCommand_Swap : public SCommand { SCommand_Swap() : SCommand(CMD_SWAP) {} diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 17365116..df3afdea 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -248,7 +248,7 @@ void CHud::RenderFps() if(g_Config.m_ClShowfps) { // calculate avg. fps - float FPS = 1.0f / Client()->FrameTime(); + float FPS = 1.0f / Client()->RenderFrameTime(); m_AverageFPS = (m_AverageFPS*(1.0f-(1.0f/m_AverageFPS))) + (FPS*(1.0f/m_AverageFPS)); char Buf[512]; str_format(Buf, sizeof(Buf), "%d", (int)m_AverageFPS); diff --git a/src/game/client/components/items.cpp b/src/game/client/components/items.cpp index 1c338994..9f787a4b 100644 --- a/src/game/client/components/items.cpp +++ b/src/game/client/components/items.cpp @@ -22,7 +22,6 @@ void CItems::OnReset() void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID) { - // get positions float Curvature = 0; float Speed = 0; @@ -64,7 +63,6 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID) if(pCurrent->m_Type == WEAPON_GRENADE) { m_pClient->m_pEffects->SmokeTrail(Pos, Vel*-1); - m_pClient->m_pFlow->Add(Pos, Vel*1000*Client()->FrameTime(), 10.0f); if(Client()->State() == IClient::STATE_DEMOPLAYBACK) { @@ -85,7 +83,6 @@ void CItems::RenderProjectile(const CNetObj_Projectile *pCurrent, int ItemID) else { m_pClient->m_pEffects->BulletTrail(Pos); - m_pClient->m_pFlow->Add(Pos, Vel*1000*Client()->FrameTime(), 10.0f); if(length(Vel) > 0.00001f) Graphics()->QuadsSetRotation(GetAngle(Vel)); -- cgit 1.4.1 From 7c300ccc7b3b4139219282acc4f18aad5ad438e9 Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 9 Jan 2012 00:28:42 +0100 Subject: added player names to dm score hud and repositioned the player name in team games. Closes #871 --- src/game/client/components/hud.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'src/game/client/components/hud.cpp') diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index df3afdea..c8e0a903 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -78,6 +78,7 @@ void CHud::RenderScoreHud() { int GameFlags = m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags; float Whole = 300*Graphics()->ScreenAspect(); + float StartY = 229.0f; if(GameFlags&GAMEFLAG_TEAMS && m_pClient->m_Snap.m_pGameDataObj) { @@ -100,11 +101,11 @@ void CHud::RenderScoreHud() Graphics()->SetColor(1.0f, 0.0f, 0.0f, 0.25f); else Graphics()->SetColor(0.0f, 0.0f, 1.0f, 0.25f); - RenderTools()->DrawRoundRectExt(Whole-ScoreWidthMax-ImageSize-2*Split, 245.0f+t*20, ScoreWidthMax+ImageSize+2*Split, 18.0f, 5.0f, CUI::CORNER_L); + RenderTools()->DrawRoundRectExt(Whole-ScoreWidthMax-ImageSize-2*Split, StartY+t*20, ScoreWidthMax+ImageSize+2*Split, 18.0f, 5.0f, CUI::CORNER_L); Graphics()->QuadsEnd(); // draw score - TextRender()->Text(0, Whole-ScoreWidthMax+(ScoreWidthMax-aScoreTeamWidth[t])/2-Split, 245.0f+t*20, 14.0f, aScoreTeam[t], -1); + TextRender()->Text(0, Whole-ScoreWidthMax+(ScoreWidthMax-aScoreTeamWidth[t])/2-Split, StartY+t*20, 14.0f, aScoreTeam[t], -1); if(GameFlags&GAMEFLAG_FLAGS) { @@ -117,7 +118,7 @@ void CHud::RenderScoreHud() Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id); Graphics()->QuadsBegin(); RenderTools()->SelectSprite(t==0?SPRITE_FLAG_RED:SPRITE_FLAG_BLUE); - IGraphics::CQuadItem QuadItem(Whole-ScoreWidthMax-ImageSize, 246.0f+t*20, ImageSize/2, ImageSize); + IGraphics::CQuadItem QuadItem(Whole-ScoreWidthMax-ImageSize, StartY+1.0f+t*20, ImageSize/2, ImageSize); Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsEnd(); } @@ -126,16 +127,17 @@ void CHud::RenderScoreHud() // draw name of the flag holder int ID = FlagCarrier[t]%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); + float w = TextRender()->TextWidth(0, 8.0f, pName, -1); + TextRender()->Text(0, min(Whole-w-1.0f, Whole-ScoreWidthMax-ImageSize-2*Split), StartY+(t+1)*20.0f-3.0f, 8.0f, pName, -1); // draw tee of the flag holder 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)); + vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, StartY+1.0f+Info.m_Size/2+t*20)); } } + StartY += 8.0f; } } else @@ -191,25 +193,33 @@ void CHud::RenderScoreHud() Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.25f); else Graphics()->SetColor(0.0f, 0.0f, 0.0f, 0.25f); - RenderTools()->DrawRoundRectExt(Whole-ScoreWidthMax-ImageSize-2*Split-PosSize, 245.0f+t*20, ScoreWidthMax+ImageSize+2*Split+PosSize, 18.0f, 5.0f, CUI::CORNER_L); + RenderTools()->DrawRoundRectExt(Whole-ScoreWidthMax-ImageSize-2*Split-PosSize, StartY+t*20, ScoreWidthMax+ImageSize+2*Split+PosSize, 18.0f, 5.0f, CUI::CORNER_L); Graphics()->QuadsEnd(); // draw score - TextRender()->Text(0, Whole-ScoreWidthMax+(ScoreWidthMax-aScoreWidth[t])/2-Split, 245.0f+t*20, 14.0f, aScore[t], -1); + TextRender()->Text(0, Whole-ScoreWidthMax+(ScoreWidthMax-aScoreWidth[t])/2-Split, StartY+t*20, 14.0f, aScore[t], -1); - // draw tee if(apPlayerInfo[t]) { - CTeeRenderInfo Info = m_pClient->m_aClients[apPlayerInfo[t]->m_ClientID].m_RenderInfo; + // draw name + int ID = apPlayerInfo[t]->m_ClientID; + const char *pName = m_pClient->m_aClients[ID].m_aName; + float w = TextRender()->TextWidth(0, 8.0f, pName, -1); + TextRender()->Text(0, min(Whole-w-1.0f, Whole-ScoreWidthMax-ImageSize-2*Split-PosSize), StartY+(t+1)*20.0f-3.0f, 8.0f, pName, -1); + + // draw tee + 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)); + vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, StartY+1.0f+Info.m_Size/2+t*20)); } // draw position char aBuf[32]; str_format(aBuf, sizeof(aBuf), "%d.", aPos[t]); - TextRender()->Text(0, Whole-ScoreWidthMax-ImageSize-Split-PosSize, 247.0f+t*20, 10.0f, aBuf, -1); + TextRender()->Text(0, Whole-ScoreWidthMax-ImageSize-Split-PosSize, StartY+2.0f+t*20, 10.0f, aBuf, -1); + + StartY += 8.0f; } } } -- cgit 1.4.1 From 4efd65359e1073b673f8f5b16bb48f3a0754a4b9 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 10 Jan 2012 22:40:48 +0100 Subject: show notification when game is paused --- data/languages/belarusian.txt | 3 +++ data/languages/bosnian.txt | 3 +++ data/languages/brazilian_portuguese.txt | 3 +++ data/languages/bulgarian.txt | 3 +++ data/languages/czech.txt | 3 +++ data/languages/danish.txt | 3 +++ data/languages/dutch.txt | 3 +++ data/languages/finnish.txt | 3 +++ data/languages/french.txt | 3 +++ data/languages/german.txt | 3 +++ data/languages/hungarian.txt | 3 +++ data/languages/italian.txt | 3 +++ data/languages/norwegian.txt | 3 +++ data/languages/polish.txt | 3 +++ data/languages/portuguese.txt | 3 +++ data/languages/romanian.txt | 3 +++ data/languages/russian.txt | 3 +++ data/languages/serbian.txt | 3 +++ data/languages/slovak.txt | 3 +++ data/languages/spanish.txt | 3 +++ data/languages/swedish.txt | 3 +++ data/languages/turkish.txt | 3 +++ data/languages/ukrainian.txt | 3 +++ src/game/client/components/hud.cpp | 13 +++++++++++++ src/game/client/components/hud.h | 1 + 25 files changed, 83 insertions(+) (limited to 'src/game/client/components/hud.cpp') diff --git a/data/languages/belarusian.txt b/data/languages/belarusian.txt index 9bceccaa..47f3aa8a 100644 --- a/data/languages/belarusian.txt +++ b/data/languages/belarusian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/bosnian.txt b/data/languages/bosnian.txt index d6f06d26..85f2e0c6 100644 --- a/data/languages/bosnian.txt +++ b/data/languages/bosnian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/brazilian_portuguese.txt b/data/languages/brazilian_portuguese.txt index 19e85dff..5bb3f730 100644 --- a/data/languages/brazilian_portuguese.txt +++ b/data/languages/brazilian_portuguese.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/bulgarian.txt b/data/languages/bulgarian.txt index 079dfa4a..83c674b9 100644 --- a/data/languages/bulgarian.txt +++ b/data/languages/bulgarian.txt @@ -672,6 +672,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/czech.txt b/data/languages/czech.txt index 0a273fe3..dd18d676 100644 --- a/data/languages/czech.txt +++ b/data/languages/czech.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/danish.txt b/data/languages/danish.txt index 95483954..6f82249e 100644 --- a/data/languages/danish.txt +++ b/data/languages/danish.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/dutch.txt b/data/languages/dutch.txt index 92a57dd8..11e5559f 100644 --- a/data/languages/dutch.txt +++ b/data/languages/dutch.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/finnish.txt b/data/languages/finnish.txt index 772eb852..f9586c11 100644 --- a/data/languages/finnish.txt +++ b/data/languages/finnish.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/french.txt b/data/languages/french.txt index 5f20a3bb..846f4ed4 100644 --- a/data/languages/french.txt +++ b/data/languages/french.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/german.txt b/data/languages/german.txt index b6bc5a26..a04e2bde 100644 --- a/data/languages/german.txt +++ b/data/languages/german.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/hungarian.txt b/data/languages/hungarian.txt index a9bfa978..97001d17 100644 --- a/data/languages/hungarian.txt +++ b/data/languages/hungarian.txt @@ -660,6 +660,9 @@ no limit Demofile: %s == +Game paused +== + Play background music == diff --git a/data/languages/italian.txt b/data/languages/italian.txt index d34e3338..5187985d 100644 --- a/data/languages/italian.txt +++ b/data/languages/italian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/norwegian.txt b/data/languages/norwegian.txt index a8ede600..3f284814 100644 --- a/data/languages/norwegian.txt +++ b/data/languages/norwegian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/polish.txt b/data/languages/polish.txt index fabde4c9..67d63d7c 100644 --- a/data/languages/polish.txt +++ b/data/languages/polish.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/portuguese.txt b/data/languages/portuguese.txt index 307458ac..e99e063e 100644 --- a/data/languages/portuguese.txt +++ b/data/languages/portuguese.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/romanian.txt b/data/languages/romanian.txt index 224540cb..73328399 100644 --- a/data/languages/romanian.txt +++ b/data/languages/romanian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/russian.txt b/data/languages/russian.txt index f2142028..067a205a 100644 --- a/data/languages/russian.txt +++ b/data/languages/russian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/serbian.txt b/data/languages/serbian.txt index 228d58e0..0abc7031 100644 --- a/data/languages/serbian.txt +++ b/data/languages/serbian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/slovak.txt b/data/languages/slovak.txt index a3e4180e..e22d5d21 100644 --- a/data/languages/slovak.txt +++ b/data/languages/slovak.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/spanish.txt b/data/languages/spanish.txt index 3b19e994..de2ca3a6 100644 --- a/data/languages/spanish.txt +++ b/data/languages/spanish.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/swedish.txt b/data/languages/swedish.txt index b7ce150c..23e42d94 100644 --- a/data/languages/swedish.txt +++ b/data/languages/swedish.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Game paused +== + Respawn == diff --git a/data/languages/turkish.txt b/data/languages/turkish.txt index 135bc6d9..2273c23d 100644 --- a/data/languages/turkish.txt +++ b/data/languages/turkish.txt @@ -672,6 +672,9 @@ no limit ##### needs translation ##### +Game paused +== + Player country: == diff --git a/data/languages/ukrainian.txt b/data/languages/ukrainian.txt index 7944e183..aaf4a4cc 100644 --- a/data/languages/ukrainian.txt +++ b/data/languages/ukrainian.txt @@ -558,6 +558,9 @@ Free-View Friends == +Game paused +== + Kick player == diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index c8e0a903..6881728c 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -59,6 +59,18 @@ void CHud::RenderGameTimer() } } +void CHud::RenderPauseNotification() +{ + if(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_PAUSED && + !(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER)) + { + const char *pText = Localize("Game paused"); + float FontSize = 20.0f; + float w = TextRender()->TextWidth(0, FontSize,pText, -1); + TextRender()->Text(0, 150.0f*Graphics()->ScreenAspect()+-w/2.0f, 50.0f, FontSize, pText, -1); + } +} + void CHud::RenderSuddenDeath() { if(m_pClient->m_Snap.m_pGameInfoObj->m_GameStateFlags&GAMESTATEFLAG_SUDDENDEATH) @@ -450,6 +462,7 @@ void CHud::OnRender() } RenderGameTimer(); + RenderPauseNotification(); RenderSuddenDeath(); RenderScoreHud(); RenderWarmupTimer(); diff --git a/src/game/client/components/hud.h b/src/game/client/components/hud.h index f0250c7b..34720854 100644 --- a/src/game/client/components/hud.h +++ b/src/game/client/components/hud.h @@ -17,6 +17,7 @@ class CHud : public CComponent void RenderVoting(); void RenderHealthAndAmmo(const CNetObj_Character *pCharacter); void RenderGameTimer(); + void RenderPauseNotification(); void RenderSuddenDeath(); void RenderScoreHud(); void RenderSpectatorHud(); -- cgit 1.4.1