Switch Nazara to C++20

This commit is contained in:
Lynix
2023-11-14 14:24:28 +01:00
parent 35b4da0d4b
commit e5789d1749
17 changed files with 51 additions and 57 deletions

View File

@@ -167,19 +167,17 @@ namespace Nz
for (auto&& rendererImpl : implementations)
{
#ifndef NAZARA_RENDERER_EMBEDDEDBACKENDS
std::string fileNameStr = rendererImpl.fileName.generic_u8string();
DynLib implLib;
if (!implLib.Load(rendererImpl.fileName))
{
NazaraWarning("Failed to load " + fileNameStr + ": " + implLib.GetLastError());
NazaraWarningFmt("Failed to load {0}: {1}", rendererImpl.fileName, implLib.GetLastError());
continue;
}
CreateRendererImplFunc createRenderer = reinterpret_cast<CreateRendererImplFunc>(implLib.GetSymbol("NazaraRenderer_Instantiate"));
if (!createRenderer)
{
NazaraDebug("Skipped " + fileNameStr + " (symbol not found)");
NazaraDebug("Skipped {0} (NazaraRenderer_Instantiate symbol not found)", rendererImpl.fileName);
continue;
}
@@ -194,7 +192,7 @@ namespace Nz
}
#ifndef NAZARA_RENDERER_EMBEDDEDBACKENDS
NazaraDebug("Loaded " + fileNameStr);
NazaraDebug("Loaded {0}", rendererImpl.fileName);
chosenLib = std::move(implLib);
#endif

View File

@@ -89,7 +89,7 @@ namespace Nz
std::shared_ptr<Texture> texture = params.renderDevice->InstantiateTexture(texParams, image.GetConstPixels(), params.buildMipmaps);
texture->SetFilePath(image.GetFilePath());
if (std::string debugName = texture->GetFilePath().generic_u8string(); !debugName.empty())
if (std::string debugName = PathToString(texture->GetFilePath()); !debugName.empty())
texture->UpdateDebugName(debugName);
return texture;