From 251be1ac2d808dfd0fca5c0eb37398357ca7bb20 Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Thu, 7 Aug 2025 10:10:18 +0300 Subject: Huge Commit - Added (static)sprites - Removed variable fps (removes wierd camera jitter) Also I'm becoming increasingly more anti-VSync --- src/background.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/background.c') 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); } -- cgit v1.2.3