diff --git a/include/app.h b/include/app.h index 8e9e17a..6237ead 100644 --- a/include/app.h +++ b/include/app.h @@ -11,6 +11,7 @@ #include "logo.h" #include "menu.h" #include "game.h" +#include "settings.h" typedef struct { Config config; @@ -18,9 +19,10 @@ typedef struct { Flags flags; Window window; Font font; - LogoState logo; - GameState game; + LogoState logo; MenuState menu; + GameState game; + SettingsState settings; } App; void ConfigApp(App* app){ @@ -38,6 +40,7 @@ void InitApp(App *app){ InitLogo(&app->logo); InitMenu(&app->menu); InitGame(&app->game,&app->window); + InitSettings(&app->settings); } void UpdateApp(App *app){ @@ -61,9 +64,14 @@ void UpdateApp(App *app){ }break; case GAMEPLAY: { - UpdateGame(&app->game, &app->state.currentView, &app->state.running, &app->flags); + UpdateGame(&app->game, &app->state, &app->flags); RenderGame(&app->game, &app->state, &app->flags); }break; + case SETTINGS: + { + UpdateSettings(&app->settings, &app->flags); + RenderSettings(&app->settings, &app->flags); + } default: break; } } diff --git a/include/view.h b/include/view.h index 96374f7..3272f0d 100644 --- a/include/view.h +++ b/include/view.h @@ -4,7 +4,8 @@ typedef enum View { LOGO = 0, MENU = 1, - GAMEPLAY = 2 + GAMEPLAY = 2, + SETTINGS = 3 } View; #endif // SCREEN_H