mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
DiscIO: Use std::function for compression callback
This commit is contained in:
@ -238,7 +238,7 @@ static ConversionResult<OutputParameters> Compress(CompressThreadState* state,
|
||||
|
||||
static ConversionResultCode Output(OutputParameters parameters, File::IOFile* outfile,
|
||||
u64* position, std::vector<u64>* offsets, int progress_monitor,
|
||||
u32 num_blocks, CompressCB callback, void* arg)
|
||||
u32 num_blocks, CompressCB callback)
|
||||
{
|
||||
u64 offset = *position;
|
||||
if (!parameters.compressed)
|
||||
@ -261,7 +261,7 @@ static ConversionResultCode Output(OutputParameters parameters, File::IOFile* ou
|
||||
|
||||
const float completion = static_cast<float>(parameters.block_number) / num_blocks;
|
||||
|
||||
if (!callback(text, completion, arg))
|
||||
if (!callback(text, completion))
|
||||
return ConversionResultCode::Canceled;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ static ConversionResultCode Output(OutputParameters parameters, File::IOFile* ou
|
||||
|
||||
bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path,
|
||||
const std::string& outfile_path, u32 sub_type, int block_size,
|
||||
CompressCB callback, void* arg)
|
||||
CompressCB callback)
|
||||
{
|
||||
ASSERT(infile->IsDataSizeAccurate());
|
||||
|
||||
@ -284,7 +284,7 @@ bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path,
|
||||
return false;
|
||||
}
|
||||
|
||||
callback(Common::GetStringT("Files opened, ready to compress."), 0, arg);
|
||||
callback(Common::GetStringT("Files opened, ready to compress."), 0);
|
||||
|
||||
CompressedBlobHeader header;
|
||||
header.magic_cookie = GCZ_MAGIC;
|
||||
@ -317,7 +317,7 @@ bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path,
|
||||
|
||||
const auto output = [&](OutputParameters parameters) {
|
||||
return Output(std::move(parameters), &outfile, &position, &offsets, progress_monitor,
|
||||
header.num_blocks, callback, arg);
|
||||
header.num_blocks, callback);
|
||||
};
|
||||
|
||||
MultithreadedCompressor<CompressThreadState, CompressParameters, OutputParameters> compressor(
|
||||
@ -364,7 +364,7 @@ bool ConvertToGCZ(BlobReader* infile, const std::string& infile_path,
|
||||
outfile.WriteArray(offsets.data(), header.num_blocks);
|
||||
outfile.WriteArray(hashes.data(), header.num_blocks);
|
||||
|
||||
callback(Common::GetStringT("Done compressing disc image."), 1.0f, arg);
|
||||
callback(Common::GetStringT("Done compressing disc image."), 1.0f);
|
||||
}
|
||||
|
||||
if (result == ConversionResultCode::ReadFailed)
|
||||
|
Reference in New Issue
Block a user