Skip to content

Commit

Permalink
Merge pull request #298 from furudbat/bugfix/throw-new
Browse files Browse the repository at this point in the history
Remove new in throw
  • Loading branch information
RobLoach authored Mar 1, 2024
2 parents 2869044 + 6fef836 commit b3bc196
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions include/Font.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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");
}
}

Expand All @@ -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");
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
4 changes: 2 additions & 2 deletions include/Sound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand All @@ -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");
}
}

Expand Down

0 comments on commit b3bc196

Please sign in to comment.