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

Make IObjectInterface::cb non-static

This commit is contained in:
Ivan Savenko
2024-01-01 16:37:48 +02:00
parent c37ce05d06
commit a15366f5a5
89 changed files with 502 additions and 445 deletions

View File

@ -30,14 +30,14 @@
VCMI_LIB_NAMESPACE_BEGIN
std::unique_ptr<CMap> CMapService::loadMap(const ResourcePath & name) const
std::unique_ptr<CMap> CMapService::loadMap(const ResourcePath & name, IGameCallback * cb) const
{
std::string modName = VLC->modh->findResourceOrigin(name);
std::string language = VLC->modh->getModLanguage(modName);
std::string encoding = Languages::getLanguageOptions(language).encoding;
auto stream = getStreamFromFS(name);
return getMapLoader(stream, name.getName(), modName, encoding)->loadMap();
return getMapLoader(stream, name.getName(), modName, encoding)->loadMap(cb);
}
std::unique_ptr<CMapHeader> CMapService::loadMapHeader(const ResourcePath & name) const
@ -50,10 +50,10 @@ std::unique_ptr<CMapHeader> CMapService::loadMapHeader(const ResourcePath & name
return getMapLoader(stream, name.getName(), modName, encoding)->loadMapHeader();
}
std::unique_ptr<CMap> CMapService::loadMap(const uint8_t * buffer, int size, const std::string & name, const std::string & modName, const std::string & encoding) const
std::unique_ptr<CMap> CMapService::loadMap(const uint8_t * buffer, int size, const std::string & name, const std::string & modName, const std::string & encoding, IGameCallback * cb) const
{
auto stream = getStreamFromMem(buffer, size);
std::unique_ptr<CMap> map(getMapLoader(stream, name, modName, encoding)->loadMap());
std::unique_ptr<CMap> map(getMapLoader(stream, name, modName, encoding)->loadMap(cb));
std::unique_ptr<CMapHeader> header(map.get());
//might be original campaign and require patch