From d009d019d26dea617adbf33e55637d1bcfd8f482 Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Sun, 3 May 2015 22:46:04 -0400 Subject: [PATCH] Added dummy handling of consolecmd, usercmd, datatables, stringtables --- demboyz/demboyz.cpp | 6 ++++-- demboyz/demofile.cpp | 5 +++-- demboyz/demofile.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/demboyz/demboyz.cpp b/demboyz/demboyz.cpp index 88c30db..0e9638a 100644 --- a/demboyz/demboyz.cpp +++ b/demboyz/demboyz.cpp @@ -44,13 +44,14 @@ void ParseDemoSequence(const std::vector& sequenceData) // nothing break; case dem_consolecmd: + reader.ReadRawData(nullptr, 1024); break; case dem_usercmd: - reader.ReadUserCmd(buffer); + reader.ReadUserCmd(buffer, 256); break; case dem_datatables: // TODO: datatables - reader.ReadRawData(nullptr, 0); + reader.ReadRawData(nullptr, 64*1024); break; case dem_stop: // TODO assert frame and tick numbers @@ -59,6 +60,7 @@ void ParseDemoSequence(const std::vector& sequenceData) reader.ReadRawData(nullptr, 0); break; case dem_stringtables: + reader.ReadRawData(nullptr, 0); break; default: assert(false); diff --git a/demboyz/demofile.cpp b/demboyz/demofile.cpp index 4f3d8b5..bbc9649 100644 --- a/demboyz/demofile.cpp +++ b/demboyz/demofile.cpp @@ -163,7 +163,8 @@ void DemoSequenceReader::ReadCmdHeader(unsigned char& cmd, int32& tick) m_dataReadOffset = currentReadOffset; } -int32 DemoSequenceReader::ReadUserCmd(std::vector& buf) +int32 DemoSequenceReader::ReadUserCmd(std::vector& buf, + const int32 maxReadSize /*= MAX_READ_SIZE*/) { if (m_sequenceData.empty()) { @@ -173,7 +174,7 @@ int32 DemoSequenceReader::ReadUserCmd(std::vector& buf) const int32 outgoing_sequence = *reinterpret_cast(m_sequenceData.data() + m_dataReadOffset); m_dataReadOffset += sizeof(int32); - if (!ReadRawData(buf)) + if (!ReadRawData(buf, maxReadSize)) { return 0; } diff --git a/demboyz/demofile.h b/demboyz/demofile.h index 6bdc400..393248d 100644 --- a/demboyz/demofile.h +++ b/demboyz/demofile.h @@ -234,7 +234,7 @@ public: void ReadCmdHeader(unsigned char &cmd, int32 &tick); - int32 ReadUserCmd(std::vector& buf); + int32 ReadUserCmd(std::vector& buf, const int32 maxReadSize = MAX_READ_SIZE); private: const std::vector& m_sequenceData;