diff options
author | BoredGuy <osome3717@gmail.com> | 2025-07-31 14:50:24 +0300 |
---|---|---|
committer | BoredGuy <osome3717@gmail.com> | 2025-07-31 14:50:24 +0300 |
commit | 3bedf42ddd687469d4738de3bd2c20eee7b81c19 (patch) | |
tree | 6cbde166d05d62d459bd9491768d80f8d066ca2d | |
parent | ab443b5b552c7aa51ecf98801541c9ca5f76d32d (diff) |
Small Fixes
-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()); |