MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getCurrentObjectFolderState

Function getCurrentObjectFolderState

src/OpenLoco/src/Objects/ObjectIndex.cpp:138–154  ·  view source on GitHub ↗

0x00470F3C

Source from the content-addressed store, hash-verified

136
137 // 0x00470F3C
138 static ObjectFolderState getCurrentObjectFolderState(fs::path path, bool shouldRecurse)
139 {
140 ObjectFolderState currentState{};
141
142 currentState.basePath = path.u8string();
143
144 iterateObjectFolder(path, shouldRecurse, [&currentState](const fs::directory_entry& file) {
145 currentState.numObjects++;
146 const auto lastWrite = file.last_write_time().time_since_epoch().count();
147 currentState.dateHash ^= ((lastWrite >> 32) ^ (lastWrite & 0xFFFFFFFF));
148 currentState.dateHash = std::rotr(currentState.dateHash, 5);
149 currentState.totalFileSize += file.file_size();
150 return true;
151 });
152
153 return currentState;
154 }
155
156 // 0x00471712
157 static bool hasCustomObjectsInIndex()

Callers 1

loadIndexFunction · 0.85

Calls 2

iterateObjectFolderFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected