diff options
Diffstat (limited to 'src/background.c')
-rw-r--r-- | src/background.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/background.c b/src/background.c index 49b5e0c..76a3edf 100644 --- a/src/background.c +++ b/src/background.c @@ -2,6 +2,7 @@ #include "constants.h" #include <raymath.h> #include <assert.h> +#include <stdlib.h> void AddBackground(const char* backgroundTextureName) { Entity e = {0}; @@ -14,7 +15,16 @@ void AddBackground(const char* backgroundTextureName) { Asset* backgroundTextureAsset = GetMatchingAssetWithType(backgroundTextureName, Texture_Asset); - assert(backgroundTextureAsset); + + if (backgroundTextureAsset == NULL) { + + TraceLog(LOG_ERROR, + "Failed to create background from texture asset: %s, asset not found", + backgroundTextureName + ); + exit(EXIT_FAILURE); + + } Texture2D backgroundTexture = backgroundTextureAsset->texture; const float backgroundSizeScale = (float)WINDOW_HEIGHT / backgroundTexture.height; |