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
commitc401b7663d0854a7a3f5c35b6809faf65dc1fd66 (patch)
tree68e2f9af0115bc48fcc34ba41ceb1461bccf5f1d /src/game
parent70bc98f96c3e4ae7a45ff095c5f539711aaf7fb1 (diff)
downloadrts-c401b7663d0854a7a3f5c35b6809faf65dc1fd66.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;
}