diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/background.c | 12 | ||||
-rw-r--r-- | src/main.c | 2 |
2 files changed, 13 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; @@ -13,6 +13,8 @@ int main() { LoadAssets(); InitGame(); + AddBackground("yo-mama"); + while(!WindowShouldClose()) { UpdateGame(GetFrameTime()); |