2020-09-18 16:45:42 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
|
|
|
#ifndef ENGINE_SHARED_MAP_H
|
|
|
|
#define ENGINE_SHARED_MAP_H
|
|
|
|
|
|
|
|
#include <base/system.h>
|
|
|
|
|
|
|
|
#include "datafile.h"
|
|
|
|
#include <engine/map.h>
|
|
|
|
|
|
|
|
class CMap : public IEngineMap
|
|
|
|
{
|
|
|
|
CDataFileReader m_DataFile;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CMap();
|
|
|
|
|
2023-04-24 21:21:44 +00:00
|
|
|
CDataFileReader *GetReader() { return &m_DataFile; }
|
|
|
|
|
2023-05-15 16:15:17 +00:00
|
|
|
int GetDataSize(int Index) const override;
|
2023-08-12 10:29:52 +00:00
|
|
|
void *GetData(int Index) override;
|
2022-05-17 20:13:44 +00:00
|
|
|
void *GetDataSwapped(int Index) override;
|
2023-08-13 09:50:35 +00:00
|
|
|
const char *GetDataString(int Index) override;
|
2022-05-17 20:13:44 +00:00
|
|
|
void UnloadData(int Index) override;
|
2023-05-15 16:17:56 +00:00
|
|
|
int NumData() const override;
|
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
int GetItemSize(int Index) override;
|
2023-08-12 10:29:52 +00:00
|
|
|
void *GetItem(int Index, int *pType = nullptr, int *pID = nullptr) override;
|
2022-05-17 20:13:44 +00:00
|
|
|
void GetType(int Type, int *pStart, int *pNum) override;
|
2023-08-13 10:03:31 +00:00
|
|
|
int FindItemIndex(int Type, int ID) override;
|
2022-05-17 20:13:44 +00:00
|
|
|
void *FindItem(int Type, int ID) override;
|
2023-05-15 16:15:17 +00:00
|
|
|
int NumItems() const override;
|
2020-09-18 16:45:42 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
bool Load(const char *pMapName) override;
|
2023-05-15 16:04:58 +00:00
|
|
|
void Unload() override;
|
2023-05-15 16:15:17 +00:00
|
|
|
bool IsLoaded() const override;
|
|
|
|
IOHANDLE File() const override;
|
2020-09-18 16:45:42 +00:00
|
|
|
|
2023-05-15 16:15:17 +00:00
|
|
|
SHA256_DIGEST Sha256() const override;
|
|
|
|
unsigned Crc() const override;
|
|
|
|
int MapSize() const override;
|
2022-08-14 14:02:15 +00:00
|
|
|
|
|
|
|
static void ExtractTiles(class CTile *pDest, size_t DestSize, const class CTile *pSrc, size_t SrcSize);
|
2020-09-18 16:45:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|