Remove new in throw

This commit is contained in:
furudbat
2024-03-01 17:01:45 +01:00
parent 286904424f
commit 6fef83688f
3 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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