Consistently order CDataFileReader and IMap functions

This commit is contained in:
Robert Müller 2023-08-12 12:29:52 +02:00
parent dbd9da3c7b
commit e68caafc07
4 changed files with 16 additions and 16 deletions

View file

@ -15,14 +15,14 @@ class IMap : public IInterface
{
MACRO_INTERFACE("map", 0)
public:
virtual void *GetData(int Index) = 0;
virtual int GetDataSize(int Index) const = 0;
virtual void *GetData(int Index) = 0;
virtual void *GetDataSwapped(int Index) = 0;
virtual void UnloadData(int Index) = 0;
virtual int NumData() const = 0;
virtual void *GetItem(int Index, int *pType = nullptr, int *pID = nullptr) = 0;
virtual int GetItemSize(int Index) = 0;
virtual void *GetItem(int Index, int *pType = nullptr, int *pID = nullptr) = 0;
virtual void GetType(int Type, int *pStart, int *pNum) = 0;
virtual void *FindItem(int Type, int ID) = 0;
virtual int NumItems() const = 0;

View file

@ -42,15 +42,15 @@ public:
bool IsOpen() const { return m_pDataFile != nullptr; }
IOHANDLE File() const;
int GetDataSize(int Index) const;
void *GetData(int Index);
void *GetDataSwapped(int Index); // makes sure that the data is 32bit LE ints when saved
int GetDataSize(int Index) const;
void ReplaceData(int Index, char *pData, size_t Size); // memory for data must have been allocated with malloc
void UnloadData(int Index);
int NumData() const;
void *GetItem(int Index, int *pType = nullptr, int *pID = nullptr);
int GetItemSize(int Index) const;
void *GetItem(int Index, int *pType = nullptr, int *pID = nullptr);
void GetType(int Type, int *pStart, int *pNum);
int FindItemIndex(int Type, int ID);
void *FindItem(int Type, int ID);

View file

@ -10,16 +10,16 @@
CMap::CMap() = default;
void *CMap::GetData(int Index)
{
return m_DataFile.GetData(Index);
}
int CMap::GetDataSize(int Index) const
{
return m_DataFile.GetDataSize(Index);
}
void *CMap::GetData(int Index)
{
return m_DataFile.GetData(Index);
}
void *CMap::GetDataSwapped(int Index)
{
return m_DataFile.GetDataSwapped(Index);
@ -35,16 +35,16 @@ int CMap::NumData() const
return m_DataFile.NumData();
}
void *CMap::GetItem(int Index, int *pType, int *pID)
{
return m_DataFile.GetItem(Index, pType, pID);
}
int CMap::GetItemSize(int Index)
{
return m_DataFile.GetItemSize(Index);
}
void *CMap::GetItem(int Index, int *pType, int *pID)
{
return m_DataFile.GetItem(Index, pType, pID);
}
void CMap::GetType(int Type, int *pStart, int *pNum)
{
m_DataFile.GetType(Type, pStart, pNum);

View file

@ -17,14 +17,14 @@ public:
CDataFileReader *GetReader() { return &m_DataFile; }
void *GetData(int Index) override;
int GetDataSize(int Index) const override;
void *GetData(int Index) 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 *GetItem(int Index, int *pType = nullptr, int *pID = nullptr) override;
void GetType(int Type, int *pStart, int *pNum) override;
void *FindItem(int Type, int ID) override;
int NumItems() const override;