bullets
This commit is contained in:
20
src/sprite.h
20
src/sprite.h
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user