aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-24 17:53:46 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 21:51:47 +0200
commit19d9a571afbce0e4d6db3234aeb4ccd221076997 (patch)
tree0d44937ecb8350f3ac9e1567d1cdb59f62a9d649 /src/game
parentc0887a44fb3c716194ef8eacd27a9556fdfdfc00 (diff)
downloadjancity-19d9a571afbce0e4d6db3234aeb4ccd221076997.tar.gz
Implement main menu
Diffstat (limited to 'src/game')
-rw-r--r--src/game/inc/game.h10
-rw-r--r--src/game/privinc/game_private.h3
-rw-r--r--src/game/src/game.c7
3 files changed, 11 insertions, 9 deletions
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 <stddef.h>
+
#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 <terrain.h>
#include <stddef.h>
-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;
}