Commit 37c06613 authored by Chen Bill's avatar Chen Bill

Replay: add SkipInfo

parent ce9439c2
......@@ -138,6 +138,8 @@ bool Replay::OpenReplay(const wchar_t* name) {
Reset();
return false;
}
info_offset = data_position;
data_position = 0;
return true;
}
bool Replay::CheckReplay(const wchar_t* name) {
......@@ -218,11 +220,15 @@ void Replay::Reset() {
replay_size = 0;
comp_size = 0;
data_position = 0;
info_offset = 0;
players.clear();
params = { 0 };
decks.clear();
script_name.clear();
}
void Replay::SkipInfo(){
data_position += info_offset;
}
bool Replay::ReadInfo() {
int player_count = (pheader.flag & REPLAY_TAG) ? 4 : 2;
for (int i = 0; i < player_count; ++i) {
......
......@@ -80,6 +80,7 @@ public:
int32_t ReadInt32();
void Rewind();
void Reset();
void SkipInfo();
FILE* fp{ nullptr };
#ifdef _WIN32
......@@ -102,6 +103,7 @@ private:
unsigned char* replay_data;
size_t replay_size{};
size_t data_position{};
size_t info_offset{};
bool is_recording{};
bool is_replaying{};
bool can_read{};
......
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