From c401b7663d0854a7a3f5c35b6809faf65dc1fd66 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 24 Jun 2022 17:53:46 +0200 Subject: Implement main menu --- src/game/inc/game.h | 10 +++++++++- src/game/privinc/game_private.h | 3 +-- src/game/src/game.c | 7 +------ 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/game') diff --git a/src/game/inc/game.h b/src/game/inc/game.h index 8275d54..5298b9f 100644 --- a/src/game/inc/game.h +++ b/src/game/inc/game.h @@ -1,12 +1,20 @@ #ifndef GAME_H #define GAME_H +#include + #ifdef __cplusplus extern "C" { #endif -int game(void); +struct game_cfg +{ +}; + +int game_resinit(void); +int game(const struct game_cfg *cfg); +void game_free(void); #ifdef __cplusplus } diff --git a/src/game/privinc/game_private.h b/src/game/privinc/game_private.h index 1b9449f..3ca8d62 100644 --- a/src/game/privinc/game_private.h +++ b/src/game/privinc/game_private.h @@ -6,8 +6,7 @@ extern "C" { #endif -int game_resinit(void); -void game_free(void); + #ifdef __cplusplus } diff --git a/src/game/src/game.c b/src/game/src/game.c index bcab5f2..83be2fd 100644 --- a/src/game/src/game.c +++ b/src/game/src/game.c @@ -8,13 +8,9 @@ #include #include -int game(void) +int game(const struct game_cfg *const cfg) { int ret = -1; - - if (game_resinit()) - goto end; - enum {HUMAN_PLAYERS = 1, MAP_RESOURCES = 3}; struct human_player humans[HUMAN_PLAYERS]; struct terrain_map map; @@ -109,6 +105,5 @@ int game(void) ret = 0; end: - game_free(); return ret; } -- cgit v1.2.3