refactor: appTypes.c to app.h
This commit is contained in:
@@ -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,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
@@ -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
@@ -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] = {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#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}
|
||||||
};
|
};
|
||||||
|
|
||||||
Enemies CreateEnemies(void){
|
Enemies CreateEnemies(void){
|
||||||
Enemies enemies = {.count = MAX_ENEMIES};
|
Enemies enemies = {.count = MAX_ENEMIES};
|
||||||
TextureAsset textureAsset = enemiesTextureAssets[BOAT];
|
TextureAsset textureAsset = enemiesTextureAssets[BOAT];
|
||||||
Texture2D texture = LoadTexture(textureAsset.path);
|
Texture2D texture = LoadTexture(textureAsset.path);
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
#include "engine.h"
|
#include "app.h"
|
||||||
#include "appTypes.h"
|
|
||||||
|
|
||||||
Floor CreateFloor(void)
|
Floor CreateFloor(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
@@ -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
@@ -1,3 +1,3 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
void InitLogo(LogoState *l) {
|
void InitLogo(LogoState *l) {
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
void InitMenu(MenuState *m)
|
void InitMenu(MenuState *m)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
|
|
||||||
const TextureAsset menuTextureAssets[MENU_TEX_COUNT] = {
|
const TextureAsset menuTextureAssets[MENU_TEX_COUNT] = {
|
||||||
|
|||||||
@@ -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,4 +1,4 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
void InitMenuSettings(MenuSettings *s)
|
void InitMenuSettings(MenuSettings *s)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
void OnEscapeChangeView(App *app, View view)
|
void OnEscapeChangeView(App *app, View view)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "appTypes.h"
|
#include "app.h"
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user