MCPcopy Create free account
hub / github.com/ddnet/ddnet / Load

Method Load

src/engine/client/ghost.cpp:342–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342bool CGhostLoader::Load(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc)
343{
344 dbg_assert(!m_File, "File already open");
345
346 CGhostHeader Header;
347 IOHANDLE File = ReadHeader(Header, pFilename, pMap, MapSha256, MapCrc, true);
348 if(!File)
349 {
350 return false;
351 }
352
353 if(Header.m_Version < 6)
354 {
355 io_skip(File, -(int)sizeof(SHA256_DIGEST));
356 }
357
358 m_File = File;
359 str_copy(m_aFilename, pFilename);
360 m_Header = Header;
361 m_Info = m_Header.ToGhostInfo();
362 m_LastItem.Reset();
363 ResetBuffer();
364 return true;
365}
366
367bool CGhostLoader::ReadChunk(int *pType)
368{

Callers 3

LoadMapMethod · 0.45
DemoPlayer_PlayMethod · 0.45
RefreshMethod · 0.45

Calls 4

io_skipFunction · 0.85
ToGhostInfoMethod · 0.80
str_copyFunction · 0.50
ResetMethod · 0.45

Tested by

no test coverage detected