mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
- Added the CCMD listsnapshots to show which maps have savedata stored.
SVN r3690 (trunk)
This commit is contained in:
parent
08272a29ad
commit
661e33f364
3 changed files with 30 additions and 0 deletions
|
@ -575,6 +575,20 @@ bool FCompressedMemFile::IsOpen () const
|
|||
return !!m_Buffer;
|
||||
}
|
||||
|
||||
void FCompressedMemFile::GetSizes(unsigned int &compressed, unsigned int &uncompressed) const
|
||||
{
|
||||
if (m_ImplodedBuffer != NULL)
|
||||
{
|
||||
compressed = BigLong(*(unsigned int *)m_ImplodedBuffer);
|
||||
uncompressed = BigLong(*(unsigned int *)(m_ImplodedBuffer + 4));
|
||||
}
|
||||
else
|
||||
{
|
||||
compressed = 0;
|
||||
uncompressed = m_BufferSize;
|
||||
}
|
||||
}
|
||||
|
||||
FPNGChunkFile::FPNGChunkFile (FILE *file, DWORD id)
|
||||
: FCompressedFile (file, EWriting, true, false), m_ChunkID (id)
|
||||
{
|
||||
|
|
|
@ -124,6 +124,7 @@ public:
|
|||
bool Reopen (); // Re-opens imploded file for reading only
|
||||
void Close ();
|
||||
bool IsOpen () const;
|
||||
void GetSizes(unsigned int &one, unsigned int &two) const;
|
||||
|
||||
void Serialize (FArchive &arc);
|
||||
|
||||
|
|
|
@ -1757,6 +1757,21 @@ void G_ReadSnapshots (PNGHandle *png)
|
|||
png->File->ResetFilePtr();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
||||
CCMD(listsnapshots)
|
||||
{
|
||||
for (unsigned i = 0; i < wadlevelinfos.Size(); ++i)
|
||||
{
|
||||
FCompressedMemFile *snapshot = wadlevelinfos[i].snapshot;
|
||||
if (snapshot != NULL)
|
||||
{
|
||||
unsigned int comp, uncomp;
|
||||
snapshot->GetSizes(comp, uncomp);
|
||||
Printf("%s (%u -> %u bytes)\n", wadlevelinfos[i].mapname, comp, uncomp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue