mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
The slicing is now done with a new demoeditor each time we save a replay
This commit is contained in:
parent
e35951dedc
commit
cbcb8d4830
|
@ -3325,8 +3325,12 @@ void CClient::SaveReplay()
|
|||
const int EndTick = GameTick();
|
||||
const int StartTick = EndTick - g_Config.m_ClReplayLength * GameTickSpeed();
|
||||
|
||||
// Create a DemoEditor to do the job
|
||||
CDemoEditor *DemoEditor = new CDemoEditor();
|
||||
DemoEditor->Init(m_pGameClient->NetVersion(), &m_SnapshotDelta, m_pConsole, m_pStorage);
|
||||
|
||||
// Create a job to do this slicing in background because it can be a bit long depending on the file size
|
||||
std::shared_ptr<CDemoEdit> pDemoEditTask = std::make_shared<CDemoEdit>(this, m_pConsole, &m_DemoEditor, pSrc, aFilename, StartTick, EndTick);
|
||||
std::shared_ptr<CDemoEdit> pDemoEditTask = std::make_shared<CDemoEdit>(this, m_pConsole, DemoEditor, pSrc, aFilename, StartTick, EndTick);
|
||||
Engine()->AddJob(pDemoEditTask);
|
||||
}
|
||||
}
|
||||
|
@ -3989,6 +3993,11 @@ void CClient::GetSmoothTick(int *pSmoothTick, float *pSmoothIntraTick, float Mix
|
|||
*pSmoothIntraTick = (SmoothTime - (*pSmoothTick-1)*time_freq()/50) / (float)(time_freq()/50);
|
||||
}
|
||||
|
||||
CDemoEdit::~CDemoEdit()
|
||||
{
|
||||
delete m_pDemoEditor;
|
||||
}
|
||||
|
||||
CDemoEdit::CDemoEdit(CClient *pClient, IConsole *pConsole, CDemoEditor *pDemoEditor, const char *pDemo, const char *pDst, int StartTick, int EndTick) :
|
||||
m_pClient(pClient),
|
||||
m_pConsole(pConsole),
|
||||
|
@ -4019,4 +4028,4 @@ void CDemoEdit::Run()
|
|||
|
||||
// And we restart the recorder
|
||||
m_pClient->DemoRecorder_StartReplayRecorder();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -437,6 +437,7 @@ class CDemoEdit : public IJob
|
|||
|
||||
public:
|
||||
CDemoEdit(CClient *pClient, IConsole *pConsole, CDemoEditor *pDemoEditor, const char *pDemo, const char *pDst, int StartTick, int EndTick);
|
||||
~CDemoEdit();
|
||||
void Run();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue