refactor: header file for every module

This commit is contained in:
2026-09-19 13:11:53 +02:00
parent b26070a518
commit dda0d38e22
36 changed files with 968 additions and 272 deletions
+49
View File
@@ -0,0 +1,49 @@
#ifndef ENGINE_SPRITE_H
#define ENGINE_SPRITE_H
#include <raylib.h>
typedef struct {
Texture2D texture;
Rectangle sourceRec;
Rectangle destRec;
Vector2 frameSize;
Vector2 origin;
float rotation;
Color color;
} Sprite;
typedef struct {
const char *path;
float frameWidth;
float frameHeight;
float rotation;
} TextureAsset;
typedef struct {
const char *path;
} ShaderAsset;
typedef struct {
const char *path;
} SoundtrackAsset;
typedef struct {
const char *path;
} SoundAsset;
typedef struct {
const TextureAsset *textureAssets;
const ShaderAsset *shaderAssets;
const SoundtrackAsset *soundtrackAssets;
const SoundAsset *soundAssets;
} Assets;
void UpdateSpriteSourceRec(Sprite *sprite, const Vector2 *vector);
void UpdateSpriteDestRec(Sprite *sprite, const Vector2 *vector);
void UpdateSpriteRotation(Sprite *sprite, float rotation);
void UpdateSpriteRotationTowards(Sprite *sprite, float rotation, float degreesPerSecond,
float deltaTime);
void RenderSprite(const Sprite *sprite);
#endif