diff options
Diffstat (limited to 'src/background.c')
-rw-r--r-- | src/background.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/background.c b/src/background.c index 76a3edf..d3588a7 100644 --- a/src/background.c +++ b/src/background.c @@ -9,7 +9,6 @@ void AddBackground(const char* backgroundTextureName) { e.type = Background_Entity; e.flags |= ENTITY_VISIBLE; - e.drawLayer = Background_Layer; e.position = (Vector2) {0.0f, 0.0f}; @@ -32,11 +31,11 @@ void AddBackground(const char* backgroundTextureName) { Vector2 backgroundBounds = Vector2Scale((Vector2) {backgroundTexture.width, backgroundTexture.height}, backgroundSizeScale); - e.destRect = (Rectangle) { - .width = backgroundBounds.x, - .height = backgroundBounds.y - }; - e.texture = backgroundTexture; + AddSpriteToEntity(&e, (Sprite){ + .texture = backgroundTexture, + .layer = Background_Layer, + .destRect = {NO_OFFSET, NO_OFFSET, backgroundBounds.x, backgroundBounds.y} + }); AddEntity(&e); } |