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 "logo.h"
#include "menu.h" #include "menu.h"
#include "game.h" #include "game.h"
#include "settings.h"
typedef struct { typedef struct {
Config config; Config config;
@@ -19,8 +20,9 @@ typedef struct {
Window window; Window window;
Font font; Font font;
LogoState logo; LogoState logo;
GameState game;
MenuState menu; MenuState menu;
GameState game;
SettingsState settings;
} App; } App;
void ConfigApp(App* app){ void ConfigApp(App* app){
@@ -38,6 +40,7 @@ void InitApp(App *app){
InitLogo(&app->logo); InitLogo(&app->logo);
InitMenu(&app->menu); InitMenu(&app->menu);
InitGame(&app->game,&app->window); InitGame(&app->game,&app->window);
InitSettings(&app->settings);
} }
void UpdateApp(App *app){ void UpdateApp(App *app){
@@ -61,9 +64,14 @@ void UpdateApp(App *app){
}break; }break;
case GAMEPLAY: 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); RenderGame(&app->game, &app->state, &app->flags);
}break; }break;
case SETTINGS:
{
UpdateSettings(&app->settings, &app->flags);
RenderSettings(&app->settings, &app->flags);
}
default: break; default: break;
} }
} }
+2 -1
View File
@@ -4,7 +4,8 @@
typedef enum View { typedef enum View {
LOGO = 0, LOGO = 0,
MENU = 1, MENU = 1,
GAMEPLAY = 2 GAMEPLAY = 2,
SETTINGS = 3
} View; } View;
#endif // SCREEN_H #endif // SCREEN_H