fix: settings functionality.

This commit is contained in:
huaqo-games
2025-10-17 18:19:26 +02:00
parent daedd30854
commit 6e7fcd7d85
2 changed files with 13 additions and 4 deletions
+10 -2
View File
@@ -11,6 +11,7 @@
#include "logo.h"
#include "menu.h"
#include "game.h"
#include "settings.h"
typedef struct {
Config config;
@@ -19,8 +20,9 @@ typedef struct {
Window window;
Font font;
LogoState logo;
GameState game;
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;
}
}
+2 -1
View File
@@ -4,7 +4,8 @@
typedef enum View {
LOGO = 0,
MENU = 1,
GAMEPLAY = 2
GAMEPLAY = 2,
SETTINGS = 3
} View;
#endif // SCREEN_H