This commit is contained in:
2026-03-21 19:35:45 +01:00
parent 048575c14c
commit f6af3449a6
23 changed files with 354 additions and 80 deletions

View File

@@ -1,7 +1,9 @@
#pragma once
#include "defs.h"
#include "raylib.h"
#include "texture_manager.h"
#include "utils/arena.h"
#include "utils/defs.h"
typedef struct Animation {
u8 frame_count;
@@ -12,21 +14,27 @@ typedef struct Animation {
typedef struct Sprite {
Texture2D tex;
Vector2 pos;
Vector2 anchor;
Rectangle source;
Color color;
Animation* animation;
} Sprite;
Sprite* sprite_from_texture(Texture2D tex,
Vector2* anchor,
Rectangle* source,
Color* color,
Arena* arena);
Sprite* sprite_new(const char* path,
Vector2* pos,
Vector2* anchor,
Rectangle* source,
Color* color);
Color* color,
Arena* arena,
TextureManager* tm);
void sprite_draw(Sprite* sprite);
void sprite_draw(Sprite* sprite, Vector2 pos);
void sprite_free(Sprite* sprite);
void animation_update(Animation* a);
void animation_update(Animation* a, float dt);