Remove explicit sf:: prefix on Exception

This commit is contained in:
ZXShady 2025-02-19 23:18:23 +00:00 committed by Chris Thrasher
parent 7fd42b141d
commit 891a0d3263
10 changed files with 46 additions and 46 deletions

View File

@ -71,7 +71,7 @@ void InputSoundFile::StreamDeleter::operator()(InputStream* ptr) const
InputSoundFile::InputSoundFile(const std::filesystem::path& filename)
{
if (!openFromFile(filename))
throw sf::Exception("Failed to open input sound file");
throw Exception("Failed to open input sound file");
}
@ -79,7 +79,7 @@ InputSoundFile::InputSoundFile(const std::filesystem::path& filename)
InputSoundFile::InputSoundFile(const void* data, std::size_t sizeInBytes)
{
if (!openFromMemory(data, sizeInBytes))
throw sf::Exception("Failed to open input sound file from memory");
throw Exception("Failed to open input sound file from memory");
}
@ -87,7 +87,7 @@ InputSoundFile::InputSoundFile(const void* data, std::size_t sizeInBytes)
InputSoundFile::InputSoundFile(InputStream& stream)
{
if (!openFromStream(stream))
throw sf::Exception("Failed to open input sound file from stream");
throw Exception("Failed to open input sound file from stream");
}

View File

@ -69,7 +69,7 @@ Music::Music() : m_impl(std::make_unique<Impl>())
Music::Music(const std::filesystem::path& filename) : Music()
{
if (!openFromFile(filename))
throw sf::Exception("Failed to open music from file");
throw Exception("Failed to open music from file");
}
@ -77,7 +77,7 @@ Music::Music(const std::filesystem::path& filename) : Music()
Music::Music(const void* data, std::size_t sizeInBytes) : Music()
{
if (!openFromMemory(data, sizeInBytes))
throw sf::Exception("Failed to open music from memory");
throw Exception("Failed to open music from memory");
}
@ -85,7 +85,7 @@ Music::Music(const void* data, std::size_t sizeInBytes) : Music()
Music::Music(InputStream& stream) : Music()
{
if (!openFromStream(stream))
throw sf::Exception("Failed to open music from stream");
throw Exception("Failed to open music from stream");
}

View File

@ -44,7 +44,7 @@ OutputSoundFile::OutputSoundFile(const std::filesystem::path& filename,
const std::vector<SoundChannel>& channelMap)
{
if (!openFromFile(filename, sampleRate, channelCount, channelMap))
throw sf::Exception("Failed to open output sound file");
throw Exception("Failed to open output sound file");
}

View File

@ -44,7 +44,7 @@ namespace sf
SoundBuffer::SoundBuffer(const std::filesystem::path& filename)
{
if (!loadFromFile(filename))
throw sf::Exception("Failed to open sound buffer from file");
throw Exception("Failed to open sound buffer from file");
}
@ -52,7 +52,7 @@ SoundBuffer::SoundBuffer(const std::filesystem::path& filename)
SoundBuffer::SoundBuffer(const void* data, std::size_t sizeInBytes)
{
if (!loadFromMemory(data, sizeInBytes))
throw sf::Exception("Failed to open sound buffer from memory");
throw Exception("Failed to open sound buffer from memory");
}
@ -60,7 +60,7 @@ SoundBuffer::SoundBuffer(const void* data, std::size_t sizeInBytes)
SoundBuffer::SoundBuffer(InputStream& stream)
{
if (!loadFromStream(stream))
throw sf::Exception("Failed to open sound buffer from stream");
throw Exception("Failed to open sound buffer from stream");
}
@ -72,7 +72,7 @@ SoundBuffer::SoundBuffer(const std::int16_t* samples,
const std::vector<SoundChannel>& channelMap)
{
if (!loadFromSamples(samples, sampleCount, channelCount, sampleRate, channelMap))
throw sf::Exception("Failed to open sound buffer from samples");
throw Exception("Failed to open sound buffer from samples");
}

View File

@ -116,7 +116,7 @@ Image::Image(Vector2u size, const std::uint8_t* pixels)
Image::Image(const std::filesystem::path& filename)
{
if (!loadFromFile(filename))
throw sf::Exception("Failed to open image from file");
throw Exception("Failed to open image from file");
}
@ -124,7 +124,7 @@ Image::Image(const std::filesystem::path& filename)
Image::Image(const void* data, std::size_t size)
{
if (!loadFromMemory(data, size))
throw sf::Exception("Failed to open image from memory");
throw Exception("Failed to open image from memory");
}
@ -132,7 +132,7 @@ Image::Image(const void* data, std::size_t size)
Image::Image(InputStream& stream)
{
if (!loadFromStream(stream))
throw sf::Exception("Failed to open image from stream");
throw Exception("Failed to open image from stream");
}

View File

@ -48,7 +48,7 @@ RenderTexture::RenderTexture() = default;
RenderTexture::RenderTexture(Vector2u size, const ContextSettings& settings)
{
if (!resize(size, settings))
throw sf::Exception("Failed to create render texture");
throw Exception("Failed to create render texture");
}

View File

@ -228,7 +228,7 @@ struct Shader::UniformBinder
Shader::Shader(const std::filesystem::path& filename, Type type)
{
if (!loadFromFile(filename, type))
throw sf::Exception("Failed to load shader from file");
throw Exception("Failed to load shader from file");
}
@ -236,7 +236,7 @@ Shader::Shader(const std::filesystem::path& filename, Type type)
Shader::Shader(const std::filesystem::path& vertexShaderFilename, const std::filesystem::path& fragmentShaderFilename)
{
if (!loadFromFile(vertexShaderFilename, fragmentShaderFilename))
throw sf::Exception("Failed to load shader from files");
throw Exception("Failed to load shader from files");
}
@ -246,7 +246,7 @@ Shader::Shader(const std::filesystem::path& vertexShaderFilename,
const std::filesystem::path& fragmentShaderFilename)
{
if (!loadFromFile(vertexShaderFilename, geometryShaderFilename, fragmentShaderFilename))
throw sf::Exception("Failed to load shader from files");
throw Exception("Failed to load shader from files");
}
@ -254,7 +254,7 @@ Shader::Shader(const std::filesystem::path& vertexShaderFilename,
Shader::Shader(std::string_view shader, Type type)
{
if (!loadFromMemory(shader, type))
throw sf::Exception("Failed to load shader from memory");
throw Exception("Failed to load shader from memory");
}
@ -262,7 +262,7 @@ Shader::Shader(std::string_view shader, Type type)
Shader::Shader(std::string_view vertexShader, std::string_view fragmentShader)
{
if (!loadFromMemory(vertexShader, fragmentShader))
throw sf::Exception("Failed to load shader from memory");
throw Exception("Failed to load shader from memory");
}
@ -270,7 +270,7 @@ Shader::Shader(std::string_view vertexShader, std::string_view fragmentShader)
Shader::Shader(std::string_view vertexShader, std::string_view geometryShader, std::string_view fragmentShader)
{
if (!loadFromMemory(vertexShader, geometryShader, fragmentShader))
throw sf::Exception("Failed to load shader from memory");
throw Exception("Failed to load shader from memory");
}
@ -278,7 +278,7 @@ Shader::Shader(std::string_view vertexShader, std::string_view geometryShader, s
Shader::Shader(InputStream& stream, Type type)
{
if (!loadFromStream(stream, type))
throw sf::Exception("Failed to load shader from stream");
throw Exception("Failed to load shader from stream");
}
@ -286,7 +286,7 @@ Shader::Shader(InputStream& stream, Type type)
Shader::Shader(InputStream& vertexShaderStream, InputStream& fragmentShaderStream)
{
if (!loadFromStream(vertexShaderStream, fragmentShaderStream))
throw sf::Exception("Failed to load shader from streams");
throw Exception("Failed to load shader from streams");
}
@ -294,7 +294,7 @@ Shader::Shader(InputStream& vertexShaderStream, InputStream& fragmentShaderStrea
Shader::Shader(InputStream& vertexShaderStream, InputStream& geometryShaderStream, InputStream& fragmentShaderStream)
{
if (!loadFromStream(vertexShaderStream, geometryShaderStream, fragmentShaderStream))
throw sf::Exception("Failed to load shader from streams");
throw Exception("Failed to load shader from streams");
}
@ -998,7 +998,7 @@ namespace sf
////////////////////////////////////////////////////////////
Shader::Shader(const std::filesystem::path& /* filename */, Type /* type */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
@ -1006,7 +1006,7 @@ Shader::Shader(const std::filesystem::path& /* filename */, Type /* type */)
Shader::Shader(const std::filesystem::path& /* vertexShaderFilename */,
const std::filesystem::path& /* fragmentShaderFilename */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
@ -1015,42 +1015,42 @@ Shader::Shader(const std::filesystem::path& /* vertexShaderFilename */,
const std::filesystem::path& /* geometryShaderFilename */,
const std::filesystem::path& /* fragmentShaderFilename */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
////////////////////////////////////////////////////////////
Shader::Shader(std::string_view /* shader */, Type /* type */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
////////////////////////////////////////////////////////////
Shader::Shader(std::string_view /* vertexShader */, std::string_view /* fragmentShader */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
////////////////////////////////////////////////////////////
Shader::Shader(std::string_view /* vertexShader */, std::string_view /* geometryShader */, std::string_view /* fragmentShader */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
////////////////////////////////////////////////////////////
Shader::Shader(InputStream& /* stream */, Type /* type */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
////////////////////////////////////////////////////////////
Shader::Shader(InputStream& /* vertexShaderStream */, InputStream& /* fragmentShaderStream */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}
@ -1059,7 +1059,7 @@ Shader::Shader(InputStream& /* vertexShaderStream */,
InputStream& /* geometryShaderStream */,
InputStream& /* fragmentShaderStream */)
{
throw sf::Exception("Shaders are not supported with OpenGL ES 1");
throw Exception("Shaders are not supported with OpenGL ES 1");
}

View File

@ -76,7 +76,7 @@ Texture::Texture() : m_cacheId(TextureImpl::getUniqueId())
Texture::Texture(const std::filesystem::path& filename, bool sRgb) : Texture()
{
if (!loadFromFile(filename, sRgb))
throw sf::Exception("Failed to load texture from file");
throw Exception("Failed to load texture from file");
}
@ -84,7 +84,7 @@ Texture::Texture(const std::filesystem::path& filename, bool sRgb) : Texture()
Texture::Texture(const std::filesystem::path& filename, bool sRgb, const IntRect& area) : Texture()
{
if (!loadFromFile(filename, sRgb, area))
throw sf::Exception("Failed to load texture from file");
throw Exception("Failed to load texture from file");
}
@ -92,7 +92,7 @@ Texture::Texture(const std::filesystem::path& filename, bool sRgb, const IntRect
Texture::Texture(const void* data, std::size_t size, bool sRgb) : Texture()
{
if (!loadFromMemory(data, size, sRgb))
throw sf::Exception("Failed to load texture from memory");
throw Exception("Failed to load texture from memory");
}
@ -100,7 +100,7 @@ Texture::Texture(const void* data, std::size_t size, bool sRgb) : Texture()
Texture::Texture(const void* data, std::size_t size, bool sRgb, const IntRect& area) : Texture()
{
if (!loadFromMemory(data, size, sRgb, area))
throw sf::Exception("Failed to load texture from memory");
throw Exception("Failed to load texture from memory");
}
@ -108,7 +108,7 @@ Texture::Texture(const void* data, std::size_t size, bool sRgb, const IntRect& a
Texture::Texture(InputStream& stream, bool sRgb) : Texture()
{
if (!loadFromStream(stream, sRgb))
throw sf::Exception("Failed to load texture from stream");
throw Exception("Failed to load texture from stream");
}
@ -116,7 +116,7 @@ Texture::Texture(InputStream& stream, bool sRgb) : Texture()
Texture::Texture(InputStream& stream, bool sRgb, const IntRect& area) : Texture()
{
if (!loadFromStream(stream, sRgb, area))
throw sf::Exception("Failed to load texture from stream");
throw Exception("Failed to load texture from stream");
}
@ -124,7 +124,7 @@ Texture::Texture(InputStream& stream, bool sRgb, const IntRect& area) : Texture(
Texture::Texture(const Image& image, bool sRgb) : Texture()
{
if (!loadFromImage(image, sRgb))
throw sf::Exception("Failed to load texture from image");
throw Exception("Failed to load texture from image");
}
@ -132,7 +132,7 @@ Texture::Texture(const Image& image, bool sRgb) : Texture()
Texture::Texture(const Image& image, bool sRgb, const IntRect& area) : Texture()
{
if (!loadFromImage(image, sRgb, area))
throw sf::Exception("Failed to load texture from image");
throw Exception("Failed to load texture from image");
}
@ -140,7 +140,7 @@ Texture::Texture(const Image& image, bool sRgb, const IntRect& area) : Texture()
Texture::Texture(Vector2u size, bool sRgb) : Texture()
{
if (!resize(size, sRgb))
throw sf::Exception("Failed to create texture");
throw Exception("Failed to create texture");
}

View File

@ -53,7 +53,7 @@ FileInputStream::FileInputStream() = default;
FileInputStream::FileInputStream(const std::filesystem::path& filename)
{
if (!open(filename))
throw sf::Exception("Failed to open file input stream");
throw Exception("Failed to open file input stream");
}

View File

@ -48,10 +48,10 @@ Cursor::Cursor() : m_impl(std::make_unique<priv::CursorImpl>())
Cursor::Cursor(const std::uint8_t* pixels, Vector2u size, Vector2u hotspot) : Cursor()
{
if ((pixels == nullptr) || (size.x == 0) || (size.y == 0))
throw sf::Exception("Failed to create cursor from pixels (invalid arguments)");
throw Exception("Failed to create cursor from pixels (invalid arguments)");
if (!m_impl->loadFromPixels(pixels, size, hotspot))
throw sf::Exception("Failed to create cursor from pixels");
throw Exception("Failed to create cursor from pixels");
}
@ -59,7 +59,7 @@ Cursor::Cursor(const std::uint8_t* pixels, Vector2u size, Vector2u hotspot) : Cu
Cursor::Cursor(Type type) : Cursor()
{
if (!m_impl->loadFromSystem(type))
throw sf::Exception("Failed to create cursor from type");
throw Exception("Failed to create cursor from type");
}