This commit is contained in:
lzwdgc 2018-02-10 01:10:23 +03:00
parent 13be828ef6
commit 065732bcb6
2 changed files with 19 additions and 10 deletions

View file

@ -140,18 +140,27 @@ void segment::decompress(int segment_id)
{
if (algorithm & RLE_2_bytes)
{
//static std::vector<uint8_t> buf(4194432);
decode_f3((char*)encoded, size1, (char*)decoded/*buf.data()*/);
//decode_rle((short*)encoded, size1, (short*)decoded);
//assert(memcmp(decoded, buf.data(), size1) == 0);
decode_f3((char*)encoded, size1, (char*)decoded);
/*static std::vector<uint8_t> buf(4194432);
decode_f3((char*)encoded, size1, (char*)buf.data());
decode_rle((short*)encoded, size1, (short*)decoded);
auto sz = 0;
while (sz++ < size1 - 1 && decoded[sz] == buf[sz]);
std::cout << "len = " << sz << "\n";
assert(memcmp(decoded, buf.data(), size1) == 0);*/
}
else
{
//static std::vector<uint8_t> buf(4194432);
//const int header_size = 0xC;
//decode_f4((char*)encoded, size1, (char*)buf.data(), segment_id * header_size);
//decode_f4((char*)encoded, size1, (char*)decoded);
/*static std::vector<uint8_t> buf(4194432);
const int header_size = 0xC;
decode_f4((char*)encoded, size1, (char*)buf.data(), segment_id * header_size);
decode_rle((char*)encoded, size1, (char*)decoded);
assert(memcmp(decoded, buf.data(), size1) == 0);*/
decode_rle((char*)encoded, size1, (char*)decoded);
//assert(memcmp(decoded, buf.data(), size1) == 0);
}
}
}

View file

@ -55,7 +55,7 @@ struct record
struct segment
{
enum decode_algorithm
enum decode_algorithm : uint32_t
{
RLE_2_bytes = 0x1,
RLE_1_byte = 0x2,
@ -63,7 +63,7 @@ struct segment
DA_2 = 0x8,
};
uint32_t unk1;
uint32_t unk1; // some file offset? trash?
decode_algorithm algorithm;
uint32_t offset;