1
0
forked from 0ad/0ad

Add some (disabled) code to help debug OOS

This was SVN commit r7569.
This commit is contained in:
Ykkrosh 2010-05-22 16:58:08 +00:00
parent 1e228d8c17
commit 0fa4bc9b21
2 changed files with 12 additions and 2 deletions

View File

@ -209,7 +209,8 @@ void CSimulation2Impl::DumpState()
file << "\n"; file << "\n";
m_ComponentManager.DumpDebugState(file); // m_ComponentManager.DumpDebugState(file);
m_ComponentManager.SerializeState(file);
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////

View File

@ -20,13 +20,22 @@
#include "StdSerializer.h" #include "StdSerializer.h"
#include <ostream> #include <ostream>
#include <cstring>
CStdSerializer::CStdSerializer(ScriptInterface& scriptInterface, std::ostream& stream) : CStdSerializer::CStdSerializer(ScriptInterface& scriptInterface, std::ostream& stream) :
CBinarySerializer(scriptInterface), m_Stream(stream) CBinarySerializer(scriptInterface), m_Stream(stream)
{ {
} }
void CStdSerializer::Put(const char* UNUSED(name), const u8* data, size_t len) void CStdSerializer::Put(const char* name, const u8* data, size_t len)
{ {
#if 0 // annotate the stream to help debugging if you're reading the output in a hex editor
m_Stream.put('[');
m_Stream.write(name, strlen(name));
m_Stream.put(']');
#else
UNUSED2(name);
#endif
m_Stream.write((const char*)data, len); m_Stream.write((const char*)data, len);
} }