Commit 392def1e authored by Chen Bill's avatar Chen Bill

Replay: remove WriteInt8, WriteInt16

parent 80187919
...@@ -63,12 +63,6 @@ void Replay::WriteData(const void* data, size_t length, bool flush) { ...@@ -63,12 +63,6 @@ void Replay::WriteData(const void* data, size_t length, bool flush) {
void Replay::WriteInt32(int data, bool flush) { void Replay::WriteInt32(int data, bool flush) {
WriteData(&data, sizeof data, flush); WriteData(&data, sizeof data, flush);
} }
void Replay::WriteInt16(short data, bool flush) {
WriteData(&data, sizeof data, flush);
}
void Replay::WriteInt8(char data, bool flush) {
WriteData(&data, sizeof data, flush);
}
void Replay::Flush() { void Replay::Flush() {
if(!is_recording) if(!is_recording)
return; return;
......
...@@ -40,8 +40,6 @@ public: ...@@ -40,8 +40,6 @@ public:
WriteData(&data, sizeof(T), flush); WriteData(&data, sizeof(T), flush);
} }
void WriteInt32(int data, bool flush = true); void WriteInt32(int data, bool flush = true);
void WriteInt16(short data, bool flush = true);
void WriteInt8(char data, bool flush = true);
void Flush(); void Flush();
void EndRecord(); void EndRecord();
void SaveReplay(const wchar_t* name); void SaveReplay(const wchar_t* name);
......
...@@ -1413,7 +1413,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int ...@@ -1413,7 +1413,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int
if (len > SIZE_RETURN_VALUE) if (len > SIZE_RETURN_VALUE)
len = SIZE_RETURN_VALUE; len = SIZE_RETURN_VALUE;
std::memcpy(resb, pdata, len); std::memcpy(resb, pdata, len);
last_replay.WriteInt8(len); last_replay.Write<uint8_t>(len);
last_replay.WriteData(resb, len); last_replay.WriteData(resb, len);
set_responseb(pduel, resb); set_responseb(pduel, resb);
players[dp->type]->state = 0xff; players[dp->type]->state = 0xff;
......
...@@ -25,7 +25,7 @@ void SingleMode::StopPlay(bool is_exiting) { ...@@ -25,7 +25,7 @@ void SingleMode::StopPlay(bool is_exiting) {
void SingleMode::SetResponse(unsigned char* resp, unsigned int len) { void SingleMode::SetResponse(unsigned char* resp, unsigned int len) {
if(!pduel) if(!pduel)
return; return;
last_replay.WriteInt8(len); last_replay.Write<uint8_t>(len);
last_replay.WriteData(resp, len); last_replay.WriteData(resp, len);
set_responseb(pduel, resp); set_responseb(pduel, resp);
} }
...@@ -119,7 +119,7 @@ int SingleMode::SinglePlayThread() { ...@@ -119,7 +119,7 @@ int SingleMode::SinglePlayThread() {
last_replay.WriteInt32(start_hand, false); last_replay.WriteInt32(start_hand, false);
last_replay.WriteInt32(draw_count, false); last_replay.WriteInt32(draw_count, false);
last_replay.WriteInt32(opt, false); last_replay.WriteInt32(opt, false);
last_replay.WriteInt16(slen, false); last_replay.Write<uint16_t>(slen, false);
last_replay.WriteData(filename, slen, false); last_replay.WriteData(filename, slen, false);
last_replay.Flush(); last_replay.Flush();
start_duel(pduel, opt); start_duel(pduel, opt);
......
...@@ -1515,7 +1515,7 @@ void TagDuel::GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len ...@@ -1515,7 +1515,7 @@ void TagDuel::GetResponse(DuelPlayer* dp, unsigned char* pdata, unsigned int len
if (len > SIZE_RETURN_VALUE) if (len > SIZE_RETURN_VALUE)
len = SIZE_RETURN_VALUE; len = SIZE_RETURN_VALUE;
std::memcpy(resb, pdata, len); std::memcpy(resb, pdata, len);
last_replay.WriteInt8(len); last_replay.Write<uint8_t>(len);
last_replay.WriteData(resb, len); last_replay.WriteData(resb, len);
set_responseb(pduel, resb); set_responseb(pduel, resb);
players[dp->type]->state = 0xff; players[dp->type]->state = 0xff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment