summaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorOlivier Gayot <og@satcom1.com>2016-09-04 17:59:59 +0200
committerOlivier Gayot <og@satcom1.com>2016-09-04 18:00:35 +0200
commit3b3ed255a05eb0a0a3ed2886c010b952c1b1bd8c (patch)
treef08b104c4d62095835d1ab5a6332356b251bad01 /map.c
parent0a58c87f21ec0717e17318528a7c252c9d0997e7 (diff)
create a structure battle and make use of itHEADmaster
Signed-off-by: Olivier Gayot <og@satcom1.com>
Diffstat (limited to 'map.c')
-rw-r--r--map.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/map.c b/map.c
index 6783873..d2e2c30 100644
--- a/map.c
+++ b/map.c
@@ -1,7 +1,8 @@
-#include <stdio.h>
-#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
+
+#include "battle.h"
+
#include "constantes.h"
#include "structures.h"
#include "prototypes.h"
@@ -46,7 +47,15 @@ void Fmap (SURFACES*surfaces, POSITIONS* positions,
(void) surfaces;
(void) positions;
- battle(t1, t2);
+ struct battle_t battle;
+
+ if (battle_init(&battle, t1, t2) < 0) {
+ return;
+ }
+
+ battle_run(&battle);
+
+ battle_close(&battle);
#endif
}