Fix weird linking error. tbh it didn't need to be parallelized
This commit is contained in:
@@ -1,13 +1,10 @@
|
|||||||
#include <GameDB.hpp>
|
#include <GameDB.hpp>
|
||||||
#include <Mem.hpp>
|
#include <Mem.hpp>
|
||||||
#include <algorithm>
|
|
||||||
#include <execution>
|
|
||||||
|
|
||||||
namespace n64 {
|
namespace n64 {
|
||||||
void GameDB::match(Mem &mem) {
|
void GameDB::match(Mem &mem) {
|
||||||
ROM &rom = mem.rom;
|
ROM &rom = mem.rom;
|
||||||
bool found = false;
|
for (const auto &i : gamedb) {
|
||||||
std::for_each(std::execution::par, std::begin(gamedb), std::end(gamedb), [&](const auto &i) {
|
|
||||||
bool matches_code = i.code == rom.code;
|
bool matches_code = i.code == rom.code;
|
||||||
bool matches_region = false;
|
bool matches_region = false;
|
||||||
|
|
||||||
@@ -18,27 +15,24 @@ void GameDB::match(Mem &mem) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (matches_code) {
|
if (matches_code) {
|
||||||
found = true;
|
|
||||||
if (matches_region) {
|
if (matches_region) {
|
||||||
mem.saveType = i.saveType;
|
mem.saveType = i.saveType;
|
||||||
mem.rom.gameNameDB = i.name;
|
mem.rom.gameNameDB = i.name;
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
Util::warn(
|
|
||||||
"Matched code for {}, but not region! Game supposedly exists in regions [{}] but this image has region {}",
|
|
||||||
i.name, i.regions, rom.header.countryCode[0]);
|
|
||||||
mem.saveType = i.saveType;
|
|
||||||
mem.rom.gameNameDB = i.name;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Util::warn(
|
||||||
|
"Matched code for {}, but not region! Game supposedly exists in regions [{}] but this image has region {}",
|
||||||
|
i.name, i.regions, rom.header.countryCode[0]);
|
||||||
|
mem.saveType = i.saveType;
|
||||||
|
mem.rom.gameNameDB = i.name;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
Util::debug("Did not match any Game DB entries. Code: {} Region: {}", mem.rom.code, mem.rom.header.countryCode[0]);
|
|
||||||
|
|
||||||
mem.rom.gameNameDB = "";
|
|
||||||
mem.saveType = SAVE_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Util::warn("Did not match any Game DB entries. Code: {} Region: {}", mem.rom.code, mem.rom.header.countryCode[0]);
|
||||||
|
|
||||||
|
mem.rom.gameNameDB = "";
|
||||||
|
mem.saveType = SAVE_NONE;
|
||||||
}
|
}
|
||||||
} // namespace n64
|
} // namespace n64
|
||||||
|
|||||||
Reference in New Issue
Block a user