2021-11-04 18:08:43 +01:00
|
|
|
#include <gint/display.h>
|
2022-06-23 11:03:57 +02:00
|
|
|
#include <gint/gint.h>
|
2021-10-31 15:12:30 +01:00
|
|
|
#include "core.h"
|
2022-06-23 11:03:57 +02:00
|
|
|
#include "save.h"
|
2021-10-23 18:51:28 +02:00
|
|
|
|
2021-10-10 15:08:56 +02:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2021-11-04 18:08:43 +01:00
|
|
|
extern font_t font_calccity;
|
|
|
|
dfont(&font_calccity);
|
2021-10-23 18:51:28 +02:00
|
|
|
title_screen();
|
|
|
|
|
2021-10-31 15:12:30 +01:00
|
|
|
// Game initialisation
|
2022-07-05 16:02:37 +02:00
|
|
|
struct calccity *calccity;
|
|
|
|
calccity = (struct calccity*) malloc(sizeof *calccity);
|
|
|
|
|
|
|
|
struct camera *camera;
|
|
|
|
camera = (struct camera*) malloc(sizeof *camera);
|
|
|
|
|
|
|
|
struct map *map;
|
|
|
|
map = (struct map*) malloc(sizeof *map);
|
2021-10-10 15:08:56 +02:00
|
|
|
|
2022-07-05 16:02:37 +02:00
|
|
|
// Loading save
|
|
|
|
gint_world_switch(GINT_CALL(read_save, (void *)calccity, (void *)camera, (void *)map));
|
|
|
|
|
|
|
|
// Launch the game
|
|
|
|
main_loop(calccity, camera, map);
|
2022-06-23 11:03:57 +02:00
|
|
|
|
|
|
|
// Backup data
|
2022-07-05 16:02:37 +02:00
|
|
|
gint_world_switch(GINT_CALL(write_save, (void *)calccity, (void *)camera, (void *)map));
|
|
|
|
|
|
|
|
// Free memory
|
|
|
|
free(calccity);
|
|
|
|
free(camera);
|
|
|
|
free(map);
|
2022-06-23 11:03:57 +02:00
|
|
|
|
2021-10-10 15:08:56 +02:00
|
|
|
return 1;
|
2021-10-23 18:51:28 +02:00
|
|
|
}
|