diff options
Diffstat (limited to 'src/background.c')
-rw-r--r-- | src/background.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/background.c b/src/background.c index c9ed1fb..d3647cf 100644 --- a/src/background.c +++ b/src/background.c @@ -7,8 +7,8 @@ void AddBackground(const char* backgroundTextureName) { Entity e = {0}; - e.type = Background_Entity; + e.type = Background_Entity; e.flags |= ENTITY_VISIBLE; e.position = (Vector2) {0.0f, 0.0f}; @@ -32,11 +32,15 @@ void AddBackground(const char* backgroundTextureName) { Vector2 backgroundBounds = Vector2Scale((Vector2) {backgroundTexture.width, backgroundTexture.height}, backgroundSizeScale); - AddSpriteToEntity(&e, (Sprite){ - .texture = backgroundTexture, - .layer = Background_Layer, - .destRect = {NO_OFFSET, NO_OFFSET, backgroundBounds.x, backgroundBounds.y} - }); + Sprite backgroundSprite = (Sprite) { + .texture = backgroundTexture, + .layer = Background_Layer, + .numAnimations = 0, + + .destRect = {NO_OFFSET, NO_OFFSET, backgroundBounds.x, backgroundBounds.y} + }; + + AddSpriteToEntity(&e, backgroundSprite); AddEntity(&e); } |