From 6fef83688ff62d454d5a432a30ebfdfdc920343b Mon Sep 17 00:00:00 2001 From: furudbat Date: Fri, 1 Mar 2024 17:01:45 +0100 Subject: [PATCH] Remove new in throw --- include/Font.hpp | 8 ++++---- include/Mesh.hpp | 2 +- include/Sound.hpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/Font.hpp b/include/Font.hpp index 60c119b0..1128af8a 100644 --- a/include/Font.hpp +++ b/include/Font.hpp @@ -166,7 +166,7 @@ class Font : public ::Font { void Load(const std::string& fileName) { set(::LoadFont(fileName.c_str())); if (!IsReady()) { - throw new RaylibException("Failed to load Font with from file: " + fileName); + throw RaylibException("Failed to load Font with from file: " + fileName); } } @@ -183,14 +183,14 @@ class Font : public ::Font { void Load(const std::string& fileName, int fontSize, int* fontChars, int charCount) { set(::LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount)); if (!IsReady()) { - throw new RaylibException("Failed to load Font with from file with font size: " + fileName); + throw RaylibException("Failed to load Font with from file with font size: " + fileName); } } void Load(const ::Image& image, ::Color key, int firstChar) { set(::LoadFontFromImage(image, key, firstChar)); if (!IsReady()) { - throw new RaylibException("Failed to load Font with from image"); + throw RaylibException("Failed to load Font with from image"); } } @@ -199,7 +199,7 @@ class Font : public ::Font { set(::LoadFontFromMemory(fileType.c_str(), fileData, dataSize, fontSize, fontChars, charsCount)); if (!IsReady()) { - throw new RaylibException("Failed to load Font " + fileType + " with from file data"); + throw RaylibException("Failed to load Font " + fileType + " with from file data"); } } diff --git a/include/Mesh.hpp b/include/Mesh.hpp index 7b6d6cbf..38d9daec 100644 --- a/include/Mesh.hpp +++ b/include/Mesh.hpp @@ -216,7 +216,7 @@ class Mesh : public ::Mesh { */ void Export(const std::string& fileName) { if (!::ExportMesh(*this, fileName.c_str())) { - throw new RaylibException("Failed to export the Mesh"); + throw RaylibException("Failed to export the Mesh"); } } diff --git a/include/Sound.hpp b/include/Sound.hpp index fce156c9..6232a985 100644 --- a/include/Sound.hpp +++ b/include/Sound.hpp @@ -173,7 +173,7 @@ class Sound : public ::Sound { void Load(const std::string& fileName) { set(::LoadSound(fileName.c_str())); if (!IsReady()) { - throw new RaylibException("Failed to load Sound from file"); + throw RaylibException("Failed to load Sound from file"); } } @@ -185,7 +185,7 @@ class Sound : public ::Sound { void Load(const ::Wave& wave) { set(::LoadSoundFromWave(wave)); if (!IsReady()) { - throw new RaylibException("Failed to load Wave"); + throw RaylibException("Failed to load Wave"); } }