Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/CSFML/Audio/Music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
////////////////////////////////////////////////////////////
sfMusic* sfMusic_createFromFile(const char* filename)
{
assert(filename);

auto* music = new sfMusic;
if (!music->This.openFromFile(filename))
{
Expand Down
3 changes: 3 additions & 0 deletions src/CSFML/Audio/SoundBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename)
{
assert(filename);

sf::SoundBuffer soundBuffer;
if (!soundBuffer.loadFromFile(filename))
return nullptr;
Expand Down Expand Up @@ -106,6 +108,7 @@ void sfSoundBuffer_destroy(const sfSoundBuffer* soundBuffer)
bool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
{
assert(soundBuffer);
assert(filename);
return soundBuffer->This.saveToFile(filename);
}

Expand Down
2 changes: 2 additions & 0 deletions src/CSFML/Graphics/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
////////////////////////////////////////////////////////////
sfFont* sfFont_createFromFile(const char* filename)
{
assert(filename);

sf::Font font;
if (!font.openFromFile(filename))
return nullptr;
Expand Down
3 changes: 3 additions & 0 deletions src/CSFML/Graphics/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ sfImage* sfImage_createFromPixels(sfVector2u size, const uint8_t* data)
////////////////////////////////////////////////////////////
sfImage* sfImage_createFromFile(const char* filename)
{
assert(filename);

sf::Image image;
if (!image.loadFromFile(filename))
return nullptr;
Expand Down Expand Up @@ -110,6 +112,7 @@ void sfImage_destroy(const sfImage* image)
bool sfImage_saveToFile(const sfImage* image, const char* filename)
{
assert(image);
assert(filename);
return image->This.saveToFile(filename);
}

Expand Down
4 changes: 4 additions & 0 deletions src/CSFML/Graphics/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ sfTexture* sfTexture_create(sfVector2u size)
////////////////////////////////////////////////////////////
sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area)
{
assert(filename);

auto* texture = new sfTexture;

const sf::IntRect rect = area ? convertRect(*area) : sf::IntRect();
Expand All @@ -69,6 +71,8 @@ sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area)
////////////////////////////////////////////////////////////
sfTexture* sfTexture_createSrgbFromFile(const char* filename, const sfIntRect* area)
{
assert(filename);

auto* texture = new sfTexture;

const sf::IntRect rect = area ? convertRect(*area) : sf::IntRect();
Expand Down