| 881 | } |
| 882 | |
| 883 | unsigned 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 | |
| 901 | bool CDemoPlayer::ExtractMap(class IStorage *pStorage) |
| 902 | { |