Merge pull request #1566 from def-/pr-demo-speed

Demo speed improvements
This commit is contained in:
Dennis Felsing 2019-04-03 19:02:42 +02:00 committed by GitHub
commit fc76c2219f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@ enum
MAX_TIMELINE_MARKERS=64
};
const double g_aSpeeds[] = {0.1, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 4.0, 8.0};
const double g_aSpeeds[] = {0.1, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 3.0, 4.0, 6.0, 8.0, 12.0, 16.0, 20.0, 24.0, 28.0, 32.0, 40.0, 48.0, 56.0, 64.0};
typedef bool (*DEMOFUNC_FILTER)(const void *pData, int DataSize, void *pUser);

View file

@ -820,7 +820,7 @@ int CDemoPlayer::SetPos(float Percent)
void CDemoPlayer::SetSpeed(float Speed)
{
m_Info.m_Info.m_Speed = clamp(Speed, 0.f, 64.f);
m_Info.m_Info.m_Speed = clamp(Speed, 0.f, 256.f);
}
void CDemoPlayer::SetSpeedIndex(int Offset)

View file

@ -15,7 +15,7 @@
void CBroadcast::OnReset()
{
m_BroadcastTime = 0;
m_BroadcastTick = 0;
}
void CBroadcast::OnRender()
@ -25,7 +25,7 @@ void CBroadcast::OnRender()
Graphics()->MapScreen(0, 0, 300*Graphics()->ScreenAspect(), 300);
if(time_get() < m_BroadcastTime)
if(Client()->GameTick() < m_BroadcastTick)
{
CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, m_BroadcastRenderOffset, 40.0f, 12.0f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
@ -45,7 +45,7 @@ void CBroadcast::OnMessage(int MsgType, void *pRawMsg)
Cursor.m_LineWidth = 300*Graphics()->ScreenAspect();
TextRender()->TextEx(&Cursor, m_aBroadcastText, -1);
m_BroadcastRenderOffset = 150*Graphics()->ScreenAspect()-Cursor.m_X/2;
m_BroadcastTime = time_get()+time_freq()*10;
m_BroadcastTick = Client()->GameTick()+Client()->GameTickSpeed()*10;
if (g_Config.m_ClPrintBroadcasts)
{
char aBuf[1024];

View file

@ -8,7 +8,7 @@ class CBroadcast : public CComponent
{
// broadcasts
char m_aBroadcastText[1024];
int64 m_BroadcastTime;
int m_BroadcastTick;
float m_BroadcastRenderOffset;
public: