Commit 39327771 authored by edo9300's avatar edo9300

Custom compressing size and single mode cleanup

parent d1c4b218
...@@ -129,7 +129,7 @@ void Replay::Flush() { ...@@ -129,7 +129,7 @@ void Replay::Flush() {
fflush(fp); fflush(fp);
#endif #endif
} }
void Replay::EndRecord() { void Replay::EndRecord(size_t size) {
if(!is_recording) if(!is_recording)
return; return;
if(is_writing) if(is_writing)
...@@ -141,7 +141,7 @@ void Replay::EndRecord() { ...@@ -141,7 +141,7 @@ void Replay::EndRecord() {
pheader.datasize = pdata - replay_data; pheader.datasize = pdata - replay_data;
pheader.flag |= REPLAY_COMPRESSED; pheader.flag |= REPLAY_COMPRESSED;
size_t propsize = 5; size_t propsize = 5;
comp_size = 0x20000; comp_size = size;
LzmaCompress(comp_data, &comp_size, replay_data, pdata - replay_data, pheader.props, &propsize, 5, 1 << 24, 3, 0, 2, 32, 1); LzmaCompress(comp_data, &comp_size, replay_data, pdata - replay_data, pheader.props, &propsize, 5, 1 << 24, 3, 0, 2, 32, 1);
is_recording = false; is_recording = false;
} }
......
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
void WriteInt16(short data, bool flush = true); void WriteInt16(short data, bool flush = true);
void WriteInt8(char data, bool flush = true); void WriteInt8(char data, bool flush = true);
void Flush(); void Flush();
void EndRecord(); void EndRecord(size_t size = 0x20000);
void SaveReplay(const wchar_t* name); void SaveReplay(const wchar_t* name);
bool OpenReplay(const wchar_t* name); bool OpenReplay(const wchar_t* name);
static bool CheckReplay(const wchar_t* name); static bool CheckReplay(const wchar_t* name);
......
...@@ -246,7 +246,7 @@ bool ReplayMode::ReplayAnalyze(BufferIO::ReplayPacket p) { ...@@ -246,7 +246,7 @@ bool ReplayMode::ReplayAnalyze(BufferIO::ReplayPacket p) {
break; break;
} }
case OLD_REPLAY_MODE: case OLD_REPLAY_MODE:
break; return true;
} }
DuelClient::ClientAnalyze((char*)p.data, p.length); DuelClient::ClientAnalyze((char*)p.data, p.length);
if(pauseable) { if(pauseable) {
......
...@@ -1489,7 +1489,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) { ...@@ -1489,7 +1489,7 @@ void SingleDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
void SingleDuel::EndDuel() { void SingleDuel::EndDuel() {
if(!pduel) if(!pduel)
return; return;
last_replay.EndRecord(); last_replay.EndRecord(0x1000);
char replaybuf[0x2000], *pbuf = replaybuf; char replaybuf[0x2000], *pbuf = replaybuf;
memcpy(pbuf, &last_replay.pheader, sizeof(ReplayHeader)); memcpy(pbuf, &last_replay.pheader, sizeof(ReplayHeader));
pbuf += sizeof(ReplayHeader); pbuf += sizeof(ReplayHeader);
......
This diff is collapsed.
...@@ -18,11 +18,8 @@ public: ...@@ -18,11 +18,8 @@ public:
static int SinglePlayThread(void* param); static int SinglePlayThread(void* param);
static bool SinglePlayAnalyze(char* msg, unsigned int len); static bool SinglePlayAnalyze(char* msg, unsigned int len);
static void SinglePlayRefresh(int player, int location, int flag = 0xf81fff);
static void SinglePlayRefresh(int flag = 0xf81fff); static void SinglePlayRefresh(int flag = 0xf81fff);
static void SinglePlayRefreshHand(int player, int flag = 0x781fff);
static void SinglePlayRefreshGrave(int player, int flag = 0x181fff);
static void SinglePlayRefreshDeck(int player, int flag = 0x181fff);
static void SinglePlayRefreshExtra(int player, int flag = 0x181fff);
static void SinglePlayRefreshSingle(int player, int location, int sequence, int flag = 0xf81fff); static void SinglePlayRefreshSingle(int player, int location, int sequence, int flag = 0xf81fff);
static void SinglePlayReload(); static void SinglePlayReload();
......
...@@ -1572,7 +1572,7 @@ void TagDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) { ...@@ -1572,7 +1572,7 @@ void TagDuel::GetResponse(DuelPlayer* dp, void* pdata, unsigned int len) {
void TagDuel::EndDuel() { void TagDuel::EndDuel() {
if(!pduel) if(!pduel)
return; return;
last_replay.EndRecord(); last_replay.EndRecord(0x1000);
char replaybuf[0x2000], *pbuf = replaybuf; char replaybuf[0x2000], *pbuf = replaybuf;
memcpy(pbuf, &last_replay.pheader, sizeof(ReplayHeader)); memcpy(pbuf, &last_replay.pheader, sizeof(ReplayHeader));
pbuf += sizeof(ReplayHeader); pbuf += sizeof(ReplayHeader);
......
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