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 ENEMIES_TEX_COUNT
} enemiesTextureID; } 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 #define MAX_ENEMIES 100
typedef struct typedef struct
{ {
Config config;
int count; int count;
Sprite sprite[MAX_ENEMIES]; Sprite sprite[MAX_ENEMIES];
Animation animation[MAX_ENEMIES]; Animation animation[MAX_ENEMIES];
+1 -3
View File
@@ -1,6 +1,4 @@
#include <engine.h> #include "app.h"
#include "appTypes.h"
void ConfigApp(App* app){ void ConfigApp(App* app){
InitConfig(&app->config, "config/config.ini"); InitConfig(&app->config, "config/config.ini");
+1 -2
View File
@@ -1,5 +1,4 @@
#include "engine.h" #include "app.h"
#include "appTypes.h"
const ShaderAsset shaderAssets[SHADER_COUNT] = { const ShaderAsset shaderAssets[SHADER_COUNT] = {
{"shaders/postfx.fs"} {"shaders/postfx.fs"}
+1 -2
View File
@@ -1,5 +1,4 @@
#include "appTypes.h" #include "app.h"
#include "engine.h"
const TextureAsset birdsTextureAssets[BIRDS_TEX_COUNT] = { const TextureAsset birdsTextureAssets[BIRDS_TEX_COUNT] = {
+3 -2
View File
@@ -1,5 +1,6 @@
#include "appTypes.h" #include "app.h"
#include "engine.h"
const TextureAsset enemiesTextureAssets[ENEMIES_TEX_COUNT] = { const TextureAsset enemiesTextureAssets[ENEMIES_TEX_COUNT] = {
{"assets/ship_start.png", 16.0f, 16.0f, 90.0f} {"assets/ship_start.png", 16.0f, 16.0f, 90.0f}
+1 -2
View File
@@ -1,5 +1,4 @@
#include "engine.h" #include "app.h"
#include "appTypes.h"
Floor CreateFloor(void) Floor CreateFloor(void)
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h" #include "app.h"
const TextureAsset islandsTextureAssets[ISLANDS_TEX_COUNT] = { const TextureAsset islandsTextureAssets[ISLANDS_TEX_COUNT] = {
{"assets/island.png", 16.0f, 16.0f, 0.0f} {"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] = { const TextureAsset playerTextureAssets[PLAYER_TEX_COUNT] = {
{"assets/ship_start.png", 16.0f, 16.0f, 0.0f} {"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) { void InitLogo(LogoState *l) {
SetTargetFPS(60); SetTargetFPS(60);
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h" #include "app.h"
void InitMenu(MenuState *m) void InitMenu(MenuState *m)
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h" #include "app.h"
const TextureAsset menuTextureAssets[MENU_TEX_COUNT] = { 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){ void InitBackground(float scrollSpeed, Background *bg, Texture2D *texture, const TextureAsset *backgroundAsset){
bg->scrolling = 0.0f; bg->scrolling = 0.0f;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h" #include "app.h"
void InitMenuSettings(MenuSettings *s) void InitMenuSettings(MenuSettings *s)
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h" #include "app.h"
void OnEscapeChangeView(App *app, View view) void OnEscapeChangeView(App *app, View view)
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "appTypes.h" #include "app.h"
int main(void) int main(void)
{ {