won't work
This commit is contained in:
parent
b44c91051e
commit
13301a9451
12
src/core.h
12
src/core.h
|
@ -1,6 +1,8 @@
|
|||
#ifndef _PLAGUE_CORE_H
|
||||
#define _PLAGUE_CORE_H
|
||||
|
||||
#include <gint/defs/types.h>
|
||||
|
||||
// Duration for internal clock (ms)
|
||||
#define ENGINE_TICK 50
|
||||
#define CURSOR_TICK 150
|
||||
|
@ -12,6 +14,12 @@
|
|||
// Number of planes on screen
|
||||
#define NB_PLANES 5
|
||||
|
||||
struct grid {
|
||||
int width;
|
||||
int height;
|
||||
uint8_t *data;
|
||||
};
|
||||
|
||||
// game : all statistics of the current game
|
||||
struct game
|
||||
{
|
||||
|
@ -36,7 +44,7 @@ struct game
|
|||
struct plane *planes[NB_PLANES + 1];
|
||||
|
||||
// Grid for epidemologic model
|
||||
int grid[16][32];
|
||||
struct grid grid;
|
||||
};
|
||||
|
||||
// plane : information about planes
|
||||
|
@ -81,4 +89,4 @@ int callback_tick(volatile int *tick);
|
|||
// message : display a message
|
||||
void message(const char *msg[5]);
|
||||
|
||||
#endif /* _PLAGUE_CORE_H */
|
||||
#endif /* _PLAGUE_CORE_H */
|
||||
|
|
11
src/main.c
11
src/main.c
|
@ -11,6 +11,8 @@
|
|||
#include <gint/keyboard.h>
|
||||
#include <gint/timer.h>
|
||||
#include <gint/clock.h>
|
||||
#include <gint/defs/types.h>
|
||||
#include <gint/std/stdlib.h>
|
||||
|
||||
#include "core.h"
|
||||
#include "display_engine.h"
|
||||
|
@ -59,11 +61,18 @@ int main(void)
|
|||
|
||||
.planes = {&plane_1, &plane_2, &plane_3, &plane_4, &plane_5, NULL},
|
||||
|
||||
.grid = {{0}},
|
||||
.grid = { 128, 64, NULL },
|
||||
};
|
||||
|
||||
/* allocate memory */
|
||||
current_game.grid.data = calloc(current_game.grid.width *
|
||||
current_game.grid.height, sizeof(uint8_t));
|
||||
|
||||
main_loop(¤t_game);
|
||||
|
||||
/* free memory */
|
||||
free(current_game.grid.data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue