refactor: appTypes.c to app.h

This commit is contained in:
2025-12-12 20:58:53 +01:00
parent 1aa2f7897d
commit c064e80be2
16 changed files with 36 additions and 22 deletions
+18
View File
@@ -153,10 +153,28 @@ typedef enum
ENEMIES_TEX_COUNT
} enemiesTextureID;
typedef enum
{
START,
SHIP_COUNT
} shipID;
typedef struct
{
int id;
char* assetPath;
int frameSize;
int speed0;
int speed1;
int speed2;
int rotationSpeed;
}Ship;
#define MAX_ENEMIES 100
typedef struct
{
Config config;
int count;
Sprite sprite[MAX_ENEMIES];
Animation animation[MAX_ENEMIES];
+1 -3
View File
@@ -1,6 +1,4 @@
#include <engine.h>
#include "appTypes.h"
#include "app.h"
void ConfigApp(App* app){
InitConfig(&app->config, "config/config.ini");
+1 -2
View File
@@ -1,5 +1,4 @@
#include "engine.h"
#include "appTypes.h"
#include "app.h"
const ShaderAsset shaderAssets[SHADER_COUNT] = {
{"shaders/postfx.fs"}
+1 -2
View File
@@ -1,5 +1,4 @@
#include "appTypes.h"
#include "engine.h"
#include "app.h"
const TextureAsset birdsTextureAssets[BIRDS_TEX_COUNT] = {
+4 -3
View File
@@ -1,11 +1,12 @@
#include "appTypes.h"
#include "engine.h"
#include "app.h"
const TextureAsset enemiesTextureAssets[ENEMIES_TEX_COUNT] = {
{"assets/ship_start.png", 16.0f, 16.0f, 90.0f}
};
Enemies CreateEnemies(void){
Enemies CreateEnemies(void){
Enemies enemies = {.count = MAX_ENEMIES};
TextureAsset textureAsset = enemiesTextureAssets[BOAT];
Texture2D texture = LoadTexture(textureAsset.path);
+1 -2
View File
@@ -1,5 +1,4 @@
#include "engine.h"
#include "appTypes.h"
#include "app.h"
Floor CreateFloor(void)
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
const TextureAsset islandsTextureAssets[ISLANDS_TEX_COUNT] = {
{"assets/island.png", 16.0f, 16.0f, 0.0f}
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
const TextureAsset playerTextureAssets[PLAYER_TEX_COUNT] = {
{"assets/ship_start.png", 16.0f, 16.0f, 0.0f}
+1 -1
View File
@@ -1,3 +1,3 @@
#include "appTypes.h"
#include "app.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
void InitLogo(LogoState *l) {
SetTargetFPS(60);
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
void InitMenu(MenuState *m)
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
const TextureAsset menuTextureAssets[MENU_TEX_COUNT] = {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
void InitBackground(float scrollSpeed, Background *bg, Texture2D *texture, const TextureAsset *backgroundAsset){
bg->scrolling = 0.0f;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
void InitMenuSettings(MenuSettings *s)
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
void OnEscapeChangeView(App *app, View view)
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h"
#include "app.h"
int main(void)
{