mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-16 12:32:29 +01:00
Count number of object conflicts during scan
This commit is contained in:
@@ -99,6 +99,7 @@ class ObjectRepository : public IObjectRepository
|
|||||||
QueryDirectoryResult _queryDirectoryResult = { 0 };
|
QueryDirectoryResult _queryDirectoryResult = { 0 };
|
||||||
ObjectEntryMap _itemMap;
|
ObjectEntryMap _itemMap;
|
||||||
uint16 _languageId = 0;
|
uint16 _languageId = 0;
|
||||||
|
int _numConflicts;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObjectRepository(IPlatformEnvironment * env)
|
ObjectRepository(IPlatformEnvironment * env)
|
||||||
@@ -247,6 +248,7 @@ private:
|
|||||||
Path::GetDirectory(objectDirectory, sizeof(objectDirectory), gRCT2AddressObjectDataPath);
|
Path::GetDirectory(objectDirectory, sizeof(objectDirectory), gRCT2AddressObjectDataPath);
|
||||||
|
|
||||||
Console::WriteLine("Scanning %lu objects...", _queryDirectoryResult.TotalFiles);
|
Console::WriteLine("Scanning %lu objects...", _queryDirectoryResult.TotalFiles);
|
||||||
|
_numConflicts = 0;
|
||||||
|
|
||||||
auto stopwatch = Stopwatch();
|
auto stopwatch = Stopwatch();
|
||||||
stopwatch.Start();
|
stopwatch.Start();
|
||||||
@@ -258,6 +260,10 @@ private:
|
|||||||
|
|
||||||
stopwatch.Stop();
|
stopwatch.Stop();
|
||||||
Console::WriteLine("Scanning complete in %.2f seconds.", stopwatch.GetElapsedMilliseconds() / 1000.0f);
|
Console::WriteLine("Scanning complete in %.2f seconds.", stopwatch.GetElapsedMilliseconds() / 1000.0f);
|
||||||
|
if (_numConflicts > 0)
|
||||||
|
{
|
||||||
|
Console::WriteLine("%d object conflicts found.", _numConflicts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScanDirectory(const std::string &directory)
|
void ScanDirectory(const std::string &directory)
|
||||||
@@ -390,6 +396,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_numConflicts++;
|
||||||
Console::Error::WriteLine("Object conflict: '%s'", conflict->Path);
|
Console::Error::WriteLine("Object conflict: '%s'", conflict->Path);
|
||||||
Console::Error::WriteLine(" : '%s'", item->Path);
|
Console::Error::WriteLine(" : '%s'", item->Path);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user