Allow error message to be formatted

This commit is contained in:
SirLynix
2023-08-14 23:16:37 +02:00
committed by Jérôme Leclercq
parent 25957c4b7f
commit a741672a51
119 changed files with 707 additions and 490 deletions

View File

@@ -13,13 +13,13 @@ namespace Nz
Cursor::Cursor(const Image& cursor, const Vector2i& hotSpot, SystemCursor placeholder)
{
ErrorFlags flags(ErrorMode::ThrowException, true);
ErrorFlags flags(ErrorMode::ThrowException);
Create(cursor, hotSpot, placeholder);
}
Cursor::Cursor(SystemCursor systemCursor)
{
ErrorFlags flags(ErrorMode::ThrowException, true);
ErrorFlags flags(ErrorMode::ThrowException);
Create(systemCursor);
}

View File

@@ -12,7 +12,7 @@ namespace Nz
Icon::Icon(const Image& icon)
{
ErrorFlags flags(ErrorMode::ThrowException, true);
ErrorFlags flags(ErrorMode::ThrowException);
Create(icon);
}

View File

@@ -55,7 +55,7 @@ namespace Nz
);
if (!m_surface)
NazaraError("failed to create SDL Surface for cursor: " + std::string(SDL_GetError()));
NazaraError("failed to create SDL Surface for cursor: {0}", std::string(SDL_GetError()));
m_cursor = SDL_CreateColorCursor(m_surface, hotSpot.x, hotSpot.y);
if (!m_cursor)
@@ -63,7 +63,7 @@ namespace Nz
if (m_surface) //< Just in case exceptions were disabled
SDL_FreeSurface(m_surface);
NazaraError("failed to create SDL cursor: " + std::string(SDL_GetError()));
NazaraError("failed to create SDL cursor: {0}", std::string(SDL_GetError()));
}
}
@@ -77,7 +77,7 @@ namespace Nz
{
m_cursor = SDL_CreateSystemCursor(s_systemCursorIds[cursor]);
if (!m_cursor)
NazaraError("failed to create SDL cursor: " + std::string(SDL_GetError()));
NazaraError("failed to create SDL cursor: {0}", std::string(SDL_GetError()));
}
}

View File

@@ -28,7 +28,7 @@ namespace Nz
);
if (!m_icon)
NazaraError("failed to create SDL Surface for icon: " + std::string(SDL_GetError()));
NazaraError("failed to create SDL Surface for icon: {0}", std::string(SDL_GetError()));
}
IconImpl::~IconImpl()

View File

@@ -91,7 +91,7 @@ namespace Nz
m_handle = SDL_CreateWindow(title.c_str(), x, y, width, height, winStyle);
if (!m_handle)
{
NazaraError("Failed to create window: " + Error::GetLastSystemError());
NazaraError("failed to create window: {0}", Error::GetLastSystemError());
return false;
}
@@ -212,8 +212,8 @@ namespace Nz
if (SDL_GetWindowWMInfo(m_handle, &wmInfo) != SDL_TRUE)
{
#ifndef NAZARA_PLATFORM_WEB
ErrorFlags flags(ErrorMode::ThrowException, true);
NazaraError(std::string("failed to retrieve window manager info: ") + SDL_GetError());
ErrorFlags flags(ErrorMode::ThrowException);
NazaraError("failed to retrieve window manager info: {0}", SDL_GetError());
#endif
}
@@ -261,7 +261,7 @@ namespace Nz
#if defined(NAZARA_PLATFORM_WEB)
handle.type = WindowBackend::Web;
#else
ErrorFlags flags(ErrorMode::ThrowException, true);
ErrorFlags flags(ErrorMode::ThrowException);
NazaraError("unhandled window subsystem");
#endif
}