- Added the CCMD listsnapshots to show which maps have savedata stored.

SVN r3690 (trunk)
This commit is contained in:
Randy Heit 2012-06-16 04:05:31 +00:00
parent 08272a29ad
commit 661e33f364
3 changed files with 30 additions and 0 deletions

View file

@ -575,6 +575,20 @@ bool FCompressedMemFile::IsOpen () const
return !!m_Buffer; 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) FPNGChunkFile::FPNGChunkFile (FILE *file, DWORD id)
: FCompressedFile (file, EWriting, true, false), m_ChunkID (id) : FCompressedFile (file, EWriting, true, false), m_ChunkID (id)
{ {

View file

@ -124,6 +124,7 @@ public:
bool Reopen (); // Re-opens imploded file for reading only bool Reopen (); // Re-opens imploded file for reading only
void Close (); void Close ();
bool IsOpen () const; bool IsOpen () const;
void GetSizes(unsigned int &one, unsigned int &two) const;
void Serialize (FArchive &arc); void Serialize (FArchive &arc);

View file

@ -1757,6 +1757,21 @@ void G_ReadSnapshots (PNGHandle *png)
png->File->ResetFilePtr(); 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);
}
}
}
//========================================================================== //==========================================================================
// //