Renamed parameters in Read/WriteUserCmd and ReadRawData

This commit is contained in:
Jordan Cristiano 2015-06-14 17:03:19 -04:00
parent 569a482549
commit 284a99fff7
2 changed files with 10 additions and 10 deletions

View File

@ -10,14 +10,14 @@ DemoFileReader::DemoFileReader(FILE* fp):
{
}
int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t length)
int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t maxLength)
{
FILE* fp = m_demoFp;
int32_t size;
fread(&size, sizeof(int32_t), 1, fp);
if (buffer && (length < size))
if (buffer && (maxLength < size))
{
return -1;
}
@ -60,10 +60,10 @@ void DemoFileReader::ReadCmdHeader(unsigned char& cmd, int32_t& tick)
}
}
int32_t DemoFileReader::ReadUserCmd(int32_t& sequenceNum, uint8_t* buffer, int32_t length)
int32_t DemoFileReader::ReadUserCmd(int32_t& cmdNum, uint8_t* buffer, int32_t maxLength)
{
fread(&sequenceNum, sizeof(int32_t), 1, m_demoFp);
return ReadRawData(buffer, length);
fread(&cmdNum, sizeof(int32_t), 1, m_demoFp);
return ReadRawData(buffer, maxLength);
}
// DemoFileWriter
@ -109,8 +109,8 @@ void DemoFileWriter::WriteCmdHeader(unsigned char cmd, int32_t tick)
fwrite(&tick, sizeof(int32_t), 1, fp);
}
void DemoFileWriter::WriteUserCmd(int32_t sequenceNum, const uint8_t* buffer, int32_t length)
void DemoFileWriter::WriteUserCmd(int32_t cmdNum, const uint8_t* buffer, int32_t length)
{
fwrite(&sequenceNum, sizeof(int32_t), 1, m_demoFp);
fwrite(&cmdNum, sizeof(int32_t), 1, m_demoFp);
WriteRawData(buffer, length);
}

View File

@ -13,11 +13,11 @@ public:
DemoFileReader(FILE* fp);
void ReadDemoHeader(demoheader_t& header);
int32_t ReadRawData(uint8_t* buffer, int32_t length);
int32_t ReadRawData(uint8_t* buffer, int32_t maxLength);
void ReadSequenceInfo(int32_t& seqNum1, int32_t& seqNum2);
void ReadCmdInfo(democmdinfo_t& info);
void ReadCmdHeader(unsigned char& cmd, int32_t& tick);
int32_t ReadUserCmd(int32_t& sequenceNum, uint8_t* buffer, int32_t length);
int32_t ReadUserCmd(int32_t& cmdNum, uint8_t* buffer, int32_t maxLength);
private:
FILE* m_demoFp;
@ -33,7 +33,7 @@ public:
void WriteSequenceInfo(int32_t seqNum1, int32_t seqNum2);
void WriteCmdInfo(const democmdinfo_t& info);
void WriteCmdHeader(unsigned char cmd, int32_t tick);
void WriteUserCmd(int32_t sequenceNum, const uint8_t* buffer, int32_t length);
void WriteUserCmd(int32_t cmdNum, const uint8_t* buffer, int32_t length);
private:
FILE* m_demoFp;