summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-05-25 04:15:43 +0000
committerPixel <pixel@nobis-crew.org>2009-05-25 04:15:43 +0000
commit2f6b22ede60a89cced23d499cd77413b9301a16d (patch)
treef57ed14d093f943d64a93c039604313392e0aa84
parent4984ff4a7cdc181aa8d4ff913ddc4323e77f4bca (diff)
Adding the option to read or not the size in the lzss_decomp routine.
-rw-r--r--includes/lzss.h2
-rw-r--r--lib/lzss.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/includes/lzss.h b/includes/lzss.h
index 14aa345..8ba3fb5 100644
--- a/includes/lzss.h
+++ b/includes/lzss.h
@@ -59,7 +59,7 @@ class lzss : public Base {
int tolerate, blockb;
int blk, bitmap_count;
- unsigned int lzss_decomp(Handle * f_source, Handle * f_cible, int true_length = -1);
+ unsigned int lzss_decomp(Handle * f_source, Handle * f_cible, int true_length = -1, bool read_length = true);
void lzss_comp(Handle * f_source, Handle * f_cible, int * delta = NULL);
Byte swap_bits(Byte);
diff --git a/lib/lzss.cpp b/lib/lzss.cpp
index 1d7ecfb..7d86a32 100644
--- a/lib/lzss.cpp
+++ b/lib/lzss.cpp
@@ -105,7 +105,7 @@ void lzss::compute_limits(void) {
printm(M_INFO, "Computed values: maxsize = %i, maxptr = 0x%06x\n", lzss_maxsize, lzss_maxptr);
}
-unsigned int lzss::lzss_decomp(Handle * f_source, Handle * f_cible, int true_length)
+unsigned int lzss::lzss_decomp(Handle * f_source, Handle * f_cible, int true_length, bool read_length)
{
unsigned char bitmap, fbitmap;
unsigned char valeur;
@@ -125,7 +125,8 @@ unsigned int lzss::lzss_decomp(Handle * f_source, Handle * f_cible, int true_len
compute_limits();
- f_source->read(&length, 4);
+ if (read_length)
+ f_source->read(&length, 4);
if (true_length >= 0) {
length = true_length;
}