diff options
| author | oy <tom_adams@web.de> | 2012-01-03 15:40:30 -0800 |
|---|---|---|
| committer | oy <tom_adams@web.de> | 2012-01-03 15:40:30 -0800 |
| commit | 7328098f8d03e65975ec82162d2049f46fed223d (patch) | |
| tree | 1c42d719df3971a3a8558a6a1a30c68b4b6f574e /src/game/client/components | |
| parent | c975390195eed17c615bbebfab981a2394dec424 (diff) | |
| parent | 7393151b6d4cbfd8c4be29145344dcce22aa47d7 (diff) | |
| download | zcatch-7328098f8d03e65975ec82162d2049f46fed223d.tar.gz zcatch-7328098f8d03e65975ec82162d2049f46fed223d.zip | |
Merge pull request #912 from matricks/threadedflip
Threadedflip
Diffstat (limited to 'src/game/client/components')
| -rw-r--r-- | src/game/client/components/damageind.cpp | 17 | ||||
| -rw-r--r-- | src/game/client/components/damageind.h | 2 | ||||
| -rw-r--r-- | src/game/client/components/hud.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/components/items.cpp | 3 | ||||
| -rw-r--r-- | src/game/client/components/menus.cpp | 2 |
5 files changed, 14 insertions, 12 deletions
diff --git a/src/game/client/components/damageind.cpp b/src/game/client/components/damageind.cpp index cba47666..9be6722a 100644 --- a/src/game/client/components/damageind.cpp +++ b/src/game/client/components/damageind.cpp @@ -38,7 +38,7 @@ void CDamageInd::Create(vec2 Pos, vec2 Dir) if (i) { i->m_Pos = Pos; - i->m_Life = 0.75f; + i->m_StartTime = Client()->LocalTime(); i->m_Dir = Dir*-1; i->m_StartAngle = (( (float)rand()/(float)RAND_MAX) - 1.0f) * 2.0f * pi; } @@ -46,19 +46,19 @@ void CDamageInd::Create(vec2 Pos, vec2 Dir) void CDamageInd::OnRender() { + Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id); Graphics()->QuadsBegin(); for(int i = 0; i < m_NumItems;) { - vec2 Pos = mix(m_aItems[i].m_Pos+m_aItems[i].m_Dir*75.0f, m_aItems[i].m_Pos, clamp((m_aItems[i].m_Life-0.60f)/0.15f, 0.0f, 1.0f)); - - m_aItems[i].m_Life -= Client()->FrameTime(); - if(m_aItems[i].m_Life < 0.0f) + float Life = 0.75f - (Client()->LocalTime() - m_aItems[i].m_StartTime); + if(Life < 0.0f) DestroyI(&m_aItems[i]); else { - Graphics()->SetColor(1.0f,1.0f,1.0f, m_aItems[i].m_Life/0.1f); - Graphics()->QuadsSetRotation(m_aItems[i].m_StartAngle + m_aItems[i].m_Life * 2.0f); + vec2 Pos = mix(m_aItems[i].m_Pos+m_aItems[i].m_Dir*75.0f, m_aItems[i].m_Pos, clamp((Life-0.60f)/0.15f, 0.0f, 1.0f)); + Graphics()->SetColor(1.0f,1.0f,1.0f, Life/0.1f); + Graphics()->QuadsSetRotation(m_aItems[i].m_StartAngle + Life * 2.0f); RenderTools()->SelectSprite(SPRITE_STAR1); RenderTools()->DrawSprite(Pos.x, Pos.y, 48.0f); i++; @@ -66,3 +66,6 @@ void CDamageInd::OnRender() } Graphics()->QuadsEnd(); } + + + diff --git a/src/game/client/components/damageind.h b/src/game/client/components/damageind.h index 2f89e422..4a5975a8 100644 --- a/src/game/client/components/damageind.h +++ b/src/game/client/components/damageind.h @@ -12,7 +12,7 @@ class CDamageInd : public CComponent { vec2 m_Pos; vec2 m_Dir; - float m_Life; + float m_StartTime; float m_StartAngle; }; 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)); diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index a39139c8..0e61ec6e 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -627,6 +627,8 @@ int CMenus::RenderMenubar(CUIRect r) void CMenus::RenderLoading() { + // TODO: not supported right now due to separate render thread + static int64 LastLoadRender = 0; float Percent = m_LoadCurrent++/(float)m_LoadTotal; |