mirror of
https://github.com/ddnet/ddnet.git
synced 2024-10-19 23:38:19 +00:00
32f2fe936a
To reduce duplicate code and to add validation for tile skip everywhere. Add separate `CMapItemLayerTilemap::TILE_SKIP_MIN_VERSION` constant and change `CMapItemVersion::CURRENT_VERSION` back to the previous version, as maps with tile skip can be loaded but skip is not used when saving.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
/* (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();
|
|
|
|
void *GetData(int Index) override;
|
|
int GetDataSize(int Index) const override;
|
|
void *GetDataSwapped(int Index) override;
|
|
void UnloadData(int Index) override;
|
|
int NumData() const override;
|
|
|
|
void *GetItem(int Index, int *pType = nullptr, int *pID = nullptr) override;
|
|
int GetItemSize(int Index) override;
|
|
void GetType(int Type, int *pStart, int *pNum) override;
|
|
void *FindItem(int Type, int ID) override;
|
|
int NumItems() const override;
|
|
|
|
bool Load(const char *pMapName) override;
|
|
void Unload() override;
|
|
bool IsLoaded() const override;
|
|
IOHANDLE File() const override;
|
|
|
|
SHA256_DIGEST Sha256() const override;
|
|
unsigned Crc() const override;
|
|
int MapSize() const override;
|
|
|
|
static void ExtractTiles(class CTile *pDest, size_t DestSize, const class CTile *pSrc, size_t SrcSize);
|
|
};
|
|
|
|
#endif
|