diff options
author | BoredGuy <osome3717@gmail.com> | 2025-08-07 10:10:18 +0300 |
---|---|---|
committer | BoredGuy <osome3717@gmail.com> | 2025-08-07 10:10:18 +0300 |
commit | 251be1ac2d808dfd0fca5c0eb37398357ca7bb20 (patch) | |
tree | 4bc7ccdaee4773b1ef55ce734a40c528384d4efe /src/background.c | |
parent | 2b95f565e8b88841d20f79205ac600cc14e28458 (diff) |
Huge Commit
- Added (static)sprites
- Removed variable fps (removes wierd camera jitter)
Also I'm becoming increasingly more anti-VSync
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); } |