mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Remove unused IDemoPlayer::GetDemoType
and enum literals
We only show the string value directly in the UI instead of using the demotype enum literals. There also should not be any reason to change any logic depending on whether the current demo is a server- or client-demo.
This commit is contained in:
parent
af4b1c9c97
commit
f1e74c12e9
|
@ -80,13 +80,6 @@ public:
|
|||
int m_aTimelineMarkers[MAX_TIMELINE_MARKERS];
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
DEMOTYPE_INVALID = 0,
|
||||
DEMOTYPE_CLIENT,
|
||||
DEMOTYPE_SERVER,
|
||||
};
|
||||
|
||||
enum ETickOffset
|
||||
{
|
||||
TICK_CURRENT, // update the current tick again
|
||||
|
@ -108,7 +101,6 @@ public:
|
|||
virtual const CInfo *BaseInfo() const = 0;
|
||||
virtual void GetDemoName(char *pBuffer, size_t BufferSize) const = 0;
|
||||
virtual bool GetDemoInfo(class IStorage *pStorage, const char *pFilename, int StorageType, CDemoHeader *pDemoHeader, CTimelineMarkers *pTimelineMarkers, CMapInfo *pMapInfo) const = 0;
|
||||
virtual int GetDemoType() const = 0;
|
||||
};
|
||||
|
||||
class IDemoRecorder : public IInterface
|
||||
|
|
|
@ -759,14 +759,6 @@ int CDemoPlayer::Load(class IStorage *pStorage, class IConsole *pConsole, const
|
|||
}
|
||||
}
|
||||
|
||||
// get demo type
|
||||
if(!str_comp(m_Info.m_Header.m_aType, "client"))
|
||||
m_DemoType = DEMOTYPE_CLIENT;
|
||||
else if(!str_comp(m_Info.m_Header.m_aType, "server"))
|
||||
m_DemoType = DEMOTYPE_SERVER;
|
||||
else
|
||||
m_DemoType = DEMOTYPE_INVALID;
|
||||
|
||||
// save byte offset of map for later use
|
||||
const unsigned MapSize = bytes_be_to_uint(m_Info.m_Header.m_aMapSize);
|
||||
m_MapOffset = io_tell(m_File);
|
||||
|
@ -1092,13 +1084,6 @@ bool CDemoPlayer::GetDemoInfo(class IStorage *pStorage, const char *pFilename, i
|
|||
return true;
|
||||
}
|
||||
|
||||
int CDemoPlayer::GetDemoType() const
|
||||
{
|
||||
if(m_File)
|
||||
return m_DemoType;
|
||||
return DEMOTYPE_INVALID;
|
||||
}
|
||||
|
||||
class CDemoRecordingListener : public CDemoPlayer::IListener
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -112,7 +112,6 @@ private:
|
|||
int m_SpeedIndex;
|
||||
|
||||
CPlaybackInfo m_Info;
|
||||
int m_DemoType;
|
||||
unsigned char m_aCompressedSnapshotData[CSnapshot::MAX_SIZE];
|
||||
unsigned char m_aDecompressedSnapshotData[CSnapshot::MAX_SIZE];
|
||||
unsigned char m_aCurrentSnapshotData[CSnapshot::MAX_SIZE];
|
||||
|
@ -157,7 +156,6 @@ public:
|
|||
void GetDemoName(char *pBuffer, size_t BufferSize) const override;
|
||||
bool GetDemoInfo(class IStorage *pStorage, const char *pFilename, int StorageType, CDemoHeader *pDemoHeader, CTimelineMarkers *pTimelineMarkers, CMapInfo *pMapInfo) const override;
|
||||
const char *GetDemoFileName() { return m_aFilename; }
|
||||
int GetDemoType() const override;
|
||||
|
||||
int Update(bool RealTime = true);
|
||||
|
||||
|
|
Loading…
Reference in a new issue