diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2010-05-04 18:15:22 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2010-05-04 18:15:22 +0000 |
| commit | 6c934f79515c4a0bd221226ac44fd81d22f0a23e (patch) | |
| tree | 92b31ae7645d12d2bcbe9b92064afc9bf3486632 /Source/Core/DiscIO/Src/CompressedBlob.cpp | |
| parent | 0ea01d84628c4779a801d74bd01ce9006fe0372a (diff) | |
lpfaint's fix for compressing small disc images. Fixes issue 2569
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5433 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/CompressedBlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Src/CompressedBlob.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/Src/CompressedBlob.cpp b/Source/Core/DiscIO/Src/CompressedBlob.cpp index f28913c151..9523115bd7 100644 --- a/Source/Core/DiscIO/Src/CompressedBlob.cpp +++ b/Source/Core/DiscIO/Src/CompressedBlob.cpp @@ -216,10 +216,11 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type, u64 position = 0; int num_compressed = 0; int num_stored = 0; + int progress_monitor = max<int>(1, header.num_blocks / 1000); for (u32 i = 0; i < header.num_blocks; i++) { - if (i % (header.num_blocks / 1000) == 0) + if (i % progress_monitor == 0) { u64 inpos = ftell(inf); int ratio = 0; @@ -315,10 +316,11 @@ bool DecompressBlobToFile(const char* infile, const char* outfile, CompressCB ca FILE* f = fopen(outfile, "wb"); const CompressedBlobHeader &header = reader->GetHeader(); u8* buffer = new u8[header.block_size]; + int progress_monitor = max<int>(1, header.num_blocks / 100); for (u64 i = 0; i < header.num_blocks; i++) { - if (i % (header.num_blocks / 100) == 0) + if (i % progress_monitor == 0) { callback("Unpacking", (float)i / (float)header.num_blocks, arg); } |
