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

Method GetMapData

src/engine/shared/demo.cpp:883–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883unsigned char *CDemoPlayer::GetMapData(class IStorage *pStorage)
884{
885 if(!m_MapInfo.m_Size)
886 return nullptr;
887
888 const int64_t CurSeek = io_tell(m_File);
889 if(CurSeek < 0 || io_seek(m_File, m_MapOffset, IOSEEK_START) != 0)
890 return nullptr;
891 unsigned char *pMapData = (unsigned char *)malloc(m_MapInfo.m_Size);
892 if(io_read(m_File, pMapData, m_MapInfo.m_Size) != m_MapInfo.m_Size ||
893 io_seek(m_File, CurSeek, IOSEEK_START) != 0)
894 {
895 free(pMapData);
896 return nullptr;
897 }
898 return pMapData;
899}
900
901bool CDemoPlayer::ExtractMap(class IStorage *pStorage)
902{

Callers 1

SliceMethod · 0.80

Calls 3

io_tellFunction · 0.85
io_seekFunction · 0.85
io_readFunction · 0.85

Tested by

no test coverage detected