mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 17:53:42 +01:00
Add progress bar to CRC calculation
This commit is contained in:
1 parent
8e43a9a204
commit
93c0ef68b6
4 files changed
+35
-20
No files matched your search
@@ -65,23 +65,6 @@ BlockDevice *constructBlockDevice(FileLoader *fileLoader) {
|
||||
return new FileBlockDevice(fileLoader);
|
||||
}
|
||||
|
||||
u32 BlockDevice::CalculateCRC(volatile bool *cancel) {
|
||||
u32 crc = crc32(0, Z_NULL, 0);
|
||||
|
||||
u8 block[2048];
|
||||
for (u32 i = 0; i < GetNumBlocks(); ++i) {
|
||||
if (cancel && *cancel)
|
||||
return 0;
|
||||
if (!ReadBlock(i, block, true)) {
|
||||
ERROR_LOG(FILESYS, "Failed to read block for CRC");
|
||||
return 0;
|
||||
}
|
||||
crc = crc32(crc, block, 2048);
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void BlockDevice::NotifyReadError() {
|
||||
auto err = GetI18NCategory(I18NCat::ERRORS);
|
||||
if (!reportedError_) {
|
||||
|
||||
Reference in new issue
Block a user