Skip to content

Commit

Permalink
Removed unnecessary virtuals and moved some dtors back to .cpp files.
Browse files Browse the repository at this point in the history
Only the defaulted destructors that previously had their curly braces in
the .h are kept in the .h file. All others have their definition in the
.cpp again (to avoid problems with deleting forward-declared types).
  • Loading branch information
afritz1 committed Apr 10, 2018
1 parent 9d1f758 commit 7864c4a
Show file tree
Hide file tree
Showing 31 changed files with 202 additions and 166 deletions.
18 changes: 9 additions & 9 deletions fileformats/ART_Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ class ART_Reader : public Archive
public:
ART_Reader();

virtual bool Open(const char *pszName) override;
virtual void Close() override;
bool Open(const char *pszName) override;
void Close() override;

virtual bool OpenFile(const char *pszFile) override;
virtual void CloseFile() override;
virtual uint32_t GetFileLen() override;
virtual bool ReadFile(void *pData, uint32_t uLength) override;
bool OpenFile(const char *pszFile) override;
void CloseFile() override;
uint32_t GetFileLen() override;
bool ReadFile(void *pData, uint32_t uLength) override;

virtual int32_t GetFileCount() override;
virtual const char *GetFileName(int32_t nFileIdx) override;
int32_t GetFileCount() override;
const char *GetFileName(int32_t nFileIdx) override;

virtual void *ReadFileInfo() override;
void *ReadFileInfo() override;

private:

Expand Down
22 changes: 11 additions & 11 deletions fileformats/BSA_Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ class BSA_Reader : public Archive
public:
BSA_Reader();

virtual bool Open(const char *pszName) override;
virtual void Close() override;
bool Open(const char *pszName) override;
void Close() override;

virtual bool OpenFile(const char *pszFile) override;
virtual bool OpenFile(const uint32_t uID) override;
virtual bool SearchForFile(const char *pszFileIn, char *pszFileOut) override;
virtual void CloseFile() override;
virtual uint32_t GetFileLen() override;
virtual bool ReadFile(void *pData, uint32_t uLength) override;
bool OpenFile(const char *pszFile) override;
bool OpenFile(const uint32_t uID) override;
bool SearchForFile(const char *pszFileIn, char *pszFileOut) override;
void CloseFile() override;
uint32_t GetFileLen() override;
bool ReadFile(void *pData, uint32_t uLength) override;

virtual int32_t GetFileCount() override;
virtual const char *GetFileName(int32_t nFileIdx) override;
virtual uint32_t GetFileID(int32_t nFileIdx) override;
int32_t GetFileCount() override;
const char *GetFileName(int32_t nFileIdx) override;
uint32_t GetFileID(int32_t nFileIdx) override;

private:

Expand Down
4 changes: 4 additions & 0 deletions fileformats/CellLoader_BloodMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ CellLoader_BloodMap::CellLoader_BloodMap() : CellLoader()
m_pBloodSprites = nullptr;
}

CellLoader_BloodMap::~CellLoader_BloodMap()
{
}

void CellLoader_BloodMap::DecryptBuffer(uint8_t *pBuffer, const uint32_t uDataSize, uint8_t uDecryptKey)
{
// Variables
Expand Down
4 changes: 2 additions & 2 deletions fileformats/CellLoader_BloodMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class CellLoader_BloodMap : public CellLoader
{
public:
CellLoader_BloodMap();
virtual ~CellLoader_BloodMap() = default;
virtual ~CellLoader_BloodMap();

virtual WorldCell *Load( IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY ) override;
WorldCell *Load( IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY ) override;

private:
struct HeaderPart1
Expand Down
4 changes: 4 additions & 0 deletions fileformats/CellLoader_Daggerfall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ WorldCell *CellLoader_Daggerfall::LoadFromLocation( IDriver3D *pDriver, World *p
return pCell;
}

CellLoader_Daggerfall::~CellLoader_Daggerfall()
{
}

WorldCell *CellLoader_Daggerfall::Load( IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY )
{
Location_Daggerfall *pLocation = WorldMap::GetLocation(sFile.c_str());
Expand Down
8 changes: 4 additions & 4 deletions fileformats/CellLoader_Daggerfall.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class CellLoader_Daggerfall : public CellLoader
{
public:
CellLoader_Daggerfall() = default;
virtual ~CellLoader_Daggerfall() = default;
virtual ~CellLoader_Daggerfall();

virtual WorldCell *Load(IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY) override;
virtual WorldCell *LoadFromLocation(IDriver3D *pDriver, World *pWorld, void *pLocPtr) override;
WorldCell *Load(IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY) override;
WorldCell *LoadFromLocation(IDriver3D *pDriver, World *pWorld, void *pLocPtr) override;

//returns true if this CellLoader handles file handling itself.
virtual bool UsesOwnFiles() override { return true; }
bool UsesOwnFiles() override { return true; }

private:
Sector *LoadBlock(IDriver3D *pDriver, uint32_t uLength, int& index, char *pData, const Vector3& vBlockLoc, Vector3& vStartTagLoc, bool bStartBlock, int32_t worldX, int32_t worldY, int blockType);
Expand Down
4 changes: 4 additions & 0 deletions fileformats/CellLoader_OutlawsMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ TextureHandle LoadNWX(uint8_t *pData, uint32_t uLen, const char *pszName, uint32
//CELL_NWX *pCell2 = (CELL_NWX *)&pData[48+sizeof(CELL_NWX)+pCell0->size+4 + sizeof(CELL_NWX)+pCell1->size+4];
}

CellLoader_OutlawsMap::~CellLoader_OutlawsMap()
{
}

WorldCell *CellLoader_OutlawsMap::Load( IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY )
{
WorldCell *pCell = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions fileformats/CellLoader_OutlawsMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class CellLoader_OutlawsMap : public CellLoader
{
public:
CellLoader_OutlawsMap() = default;
virtual ~CellLoader_OutlawsMap() = default;
virtual ~CellLoader_OutlawsMap();

virtual WorldCell *Load( IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY ) override;
WorldCell *Load( IDriver3D *pDriver, World *pWorld, uint8_t *pData, uint32_t uLen, const std::string& sFile, int32_t worldX, int32_t worldY ) override;

private:

Expand Down
16 changes: 8 additions & 8 deletions fileformats/GOB_Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ class GOB_Reader : public Archive
public:
GOB_Reader();

virtual bool Open(const char *pszName) override;
virtual void Close() override;
bool Open(const char *pszName) override;
void Close() override;

virtual bool OpenFile(const char *pszFile) override;
virtual void CloseFile() override;
virtual uint32_t GetFileLen() override;
virtual bool ReadFile(void *pData, uint32_t uLength) override;
bool OpenFile(const char *pszFile) override;
void CloseFile() override;
uint32_t GetFileLen() override;
bool ReadFile(void *pData, uint32_t uLength) override;

virtual int32_t GetFileCount() override;
virtual const char *GetFileName(int32_t nFileIdx) override;
int32_t GetFileCount() override;
const char *GetFileName(int32_t nFileIdx) override;

private:

Expand Down
12 changes: 6 additions & 6 deletions fileformats/LFD_Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class LFD_Reader : public Archive
public:
LFD_Reader();

virtual bool Open(const char *pszName) override;
virtual void Close() override;
bool Open(const char *pszName) override;
void Close() override;

virtual bool OpenFile(const char *pszFile) override;
virtual void CloseFile() override;
virtual uint32_t GetFileLen() override;
virtual bool ReadFile(void *pData, uint32_t uLength) override;
bool OpenFile(const char *pszFile) override;
void CloseFile() override;
uint32_t GetFileLen() override;
bool ReadFile(void *pData, uint32_t uLength) override;

private:

Expand Down
18 changes: 9 additions & 9 deletions fileformats/RFF_Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ class RFF_Reader : public Archive
public:
RFF_Reader();

virtual bool Open(const char *pszName) override;
virtual void Close() override;
bool Open(const char *pszName) override;
void Close() override;

virtual bool OpenFile(const char *pszFile) override;
virtual void CloseFile() override;
virtual uint32_t GetFileLen() override;
virtual bool ReadFile(void *pData, uint32_t uLength) override;
bool OpenFile(const char *pszFile) override;
void CloseFile() override;
uint32_t GetFileLen() override;
bool ReadFile(void *pData, uint32_t uLength) override;

virtual int32_t GetFileCount() override;
virtual const char *GetFileName(int32_t nFileIdx) override;
int32_t GetFileCount() override;
const char *GetFileName(int32_t nFileIdx) override;

virtual void *ReadFileInfo() override;
void *ReadFileInfo() override;

private:

Expand Down
4 changes: 4 additions & 0 deletions fileformats/SkyLoader_Daggerfall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ SkyLoader_Daggerfall::SkyLoader_Daggerfall() : SkyLoader()
}
}

SkyLoader_Daggerfall::~SkyLoader_Daggerfall()
{
}

bool SkyLoader_Daggerfall::LoadSky(int32_t regionID)
{
if ( m_aSkyData[regionID].bLoaded )
Expand Down
6 changes: 3 additions & 3 deletions fileformats/SkyLoader_Daggerfall.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class SkyLoader_Daggerfall : public SkyLoader
{
public:
SkyLoader_Daggerfall();
virtual ~SkyLoader_Daggerfall() = default;
virtual ~SkyLoader_Daggerfall();

virtual bool LoadSky(int32_t regionID) override;
virtual void *GetSkyData(int32_t regionID) override;
bool LoadSky(int32_t regionID) override;
void *GetSkyData(int32_t regionID) override;

private:
enum
Expand Down
4 changes: 4 additions & 0 deletions fileformats/TextureConv_ART.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "TextureConv_ART.h"
#include "ArchiveManager.h"

TextureConv_ART::~TextureConv_ART()
{
}

bool TextureConv_ART::ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID/*=0*/)
{
uint16_t *pSizeInfo = (uint16_t *)ArchiveManager::GameFile_GetFileInfo();
Expand Down
4 changes: 2 additions & 2 deletions fileformats/TextureConv_ART.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class TextureConv_ART : public TextureConverter
{
public:
TextureConv_ART() = default;
virtual ~TextureConv_ART() = default;
virtual ~TextureConv_ART();

virtual bool ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID=0) override;
bool ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID=0) override;
};

#endif //TEXTURECONVERTER_ART_H
4 changes: 4 additions & 0 deletions fileformats/TextureConv_IMG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ struct ImageHeader

#pragma pack(pop)

TextureConv_IMG::~TextureConv_IMG()
{
}

uint32_t TextureConv_IMG::GetHackID(const char *pszImage)
{
uint32_t uHackID = 0;
Expand Down
14 changes: 7 additions & 7 deletions fileformats/TextureConv_IMG.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ class TextureConv_IMG : public TextureConverter
{
public:
TextureConv_IMG() = default;
virtual ~TextureConv_IMG() = default;
virtual ~TextureConv_IMG();

virtual uint32_t GetHackID(const char *pszImage) override;
virtual bool ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID=0) override;
virtual bool ConvertTexture_Pal8_TexList(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, int nRecord, uint32_t uHackID=0) override;
uint32_t GetHackID(const char *pszImage) override;
bool ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID=0) override;
bool ConvertTexture_Pal8_TexList(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, int nRecord, uint32_t uHackID=0) override;

virtual bool ConvertTexture_8bpp(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, uint32_t uHackID=0) override;
virtual uint32_t ConvertTexture_8bpp_TexList(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, int nRecord, uint32_t uHackID=0) override;
bool ConvertTexture_8bpp(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, uint32_t uHackID=0) override;
uint32_t ConvertTexture_8bpp_TexList(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, int nRecord, uint32_t uHackID=0) override;
//Get extra game/format specific data.
virtual void *GetExtraTexData(uint32_t& uDataSize) override { uDataSize=4; return m_aExtraData; }
void *GetExtraTexData(uint32_t& uDataSize) override { uDataSize=4; return m_aExtraData; }
private:
int16_t m_aExtraData[2];
};
Expand Down
4 changes: 4 additions & 0 deletions fileformats/TextureConv_PCX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ struct PCX_Header
uint8_t Filler[56]; //128
};

TextureConv_PCX::~TextureConv_PCX()
{
}

bool TextureConv_PCX::ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID/*=0*/)
{
PCX_Header *pHeader = (PCX_Header *)pSourceData;
Expand Down
4 changes: 2 additions & 2 deletions fileformats/TextureConv_PCX.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class TextureConv_PCX : public TextureConverter
{
public:
TextureConv_PCX() = default;
virtual ~TextureConv_PCX() = default;
virtual ~TextureConv_PCX();

virtual bool ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID=0) override;
bool ConvertTexture_Pal8(uint8_t *pConvertedData, int32_t& nOffsX, int32_t& nOffsY, uint32_t& uWidth, uint32_t& uHeight, const uint8_t *pSourceData, uint32_t uLen, const uint8_t *pPalette, bool bCopyPal, uint32_t uHackID=0) override;
};

#endif //TEXTURECONVERTER_PCX_H
8 changes: 4 additions & 4 deletions movieplayback/LFD_Film.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class LFD_Film : public MoviePlayer
public:
LFD_Film(IDriver3D *pDriver);

virtual bool Start(Archive *pRes0, Archive *pRes1, const char *pszFile, uint32_t uFlags, int32_t nSpeed) override;
virtual void Stop() override;
bool Start(Archive *pRes0, Archive *pRes1, const char *pszFile, uint32_t uFlags, int32_t nSpeed) override;
void Stop() override;

virtual bool Update() override;
virtual void Render(float fDeltaTime) override;
bool Update() override;
void Render(float fDeltaTime) override;

private:
struct FilmEntry
Expand Down
Loading

0 comments on commit 7864c4a

Please sign in to comment.