1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

vcmi: modernize lib/mapping

This commit is contained in:
Konstantin
2023-02-11 19:30:06 +03:00
parent 7bfb37df4d
commit b16f66477c
18 changed files with 294 additions and 363 deletions

View File

@ -70,7 +70,7 @@ void CMapService::saveMap(const std::unique_ptr<CMap> & map, boost::filesystem::
boost::filesystem::remove(fullPath);
boost::filesystem::ofstream tmp(fullPath, boost::filesystem::ofstream::binary);
tmp.write((const char *)serializeBuffer.getBuffer().data(),serializeBuffer.getSize());
tmp.write(reinterpret_cast<const char *>(serializeBuffer.getBuffer().data()), serializeBuffer.getSize());
tmp.flush();
tmp.close();
}
@ -123,7 +123,7 @@ std::unique_ptr<IMapLoader> CMapService::getMapLoader(std::unique_ptr<CInputStre
static JsonNode loadPatches(std::string path)
{
JsonNode node = JsonUtils::assembleFromFiles(path);
JsonNode node = JsonUtils::assembleFromFiles(std::move(path));
for (auto & entry : node.Struct())
JsonUtils::validate(entry.second, "vcmi:mapHeader", "patch for " + entry.first);
return node;