mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-17 22:25:37 +00:00
Fix progress bar not starting from 0 when verifying the data track
This commit is contained in:
parent
764c6e4a72
commit
e38ee512f3
|
@ -46,15 +46,19 @@ static bool ReadTrack(CDImage* image, u8 track, MD5Digest* digest, ProgressCallb
|
|||
|
||||
progress_callback->PushState();
|
||||
|
||||
progress_callback->SetProgressRange(2);
|
||||
const bool dataTrack = track == 1;
|
||||
progress_callback->SetProgressRange(dataTrack ? 1 : 2);
|
||||
|
||||
u8 progress = 0;
|
||||
for (u8 index = 0; index < INDICES_TO_READ; index++)
|
||||
{
|
||||
progress_callback->SetProgressValue(index);
|
||||
progress_callback->SetProgressValue(progress);
|
||||
|
||||
// skip index 0 if data track
|
||||
if (track == 1 && index == 0)
|
||||
if (dataTrack && index == 0)
|
||||
continue;
|
||||
|
||||
progress++;
|
||||
progress_callback->PushState();
|
||||
if (!ReadIndex(image, track, index, digest, progress_callback))
|
||||
{
|
||||
|
@ -66,7 +70,7 @@ static bool ReadTrack(CDImage* image, u8 track, MD5Digest* digest, ProgressCallb
|
|||
progress_callback->PopState();
|
||||
}
|
||||
|
||||
progress_callback->SetProgressValue(INDICES_TO_READ);
|
||||
progress_callback->SetProgressValue(progress);
|
||||
progress_callback->PopState();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue