2021-07-29 18:33:22 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-08-15 02:42:26 +02:00
|
|
|
#include <gint/display.h>
|
|
|
|
#include "engine.h"
|
|
|
|
|
2021-07-29 18:33:22 +02:00
|
|
|
struct map {
|
2021-08-08 01:43:26 +02:00
|
|
|
/*width, height and the number of layer of the map (max 2)*/
|
2021-07-31 03:40:14 +02:00
|
|
|
int w, h, nb_layer;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*the tileset to use*/
|
2021-07-29 18:33:22 +02:00
|
|
|
bopti_image_t *tileset;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*list of all background tiles (layer 1)*/
|
2021-07-30 02:01:05 +02:00
|
|
|
short *tiles_layer1;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*list of all "physical" tiles (layer 2)*/
|
2021-07-30 02:01:05 +02:00
|
|
|
short *tiles_layer2;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*state of each tile on the map (solid, air ...)*/
|
2021-07-31 03:40:14 +02:00
|
|
|
short *info_map;
|
2021-07-29 18:33:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum map_state {
|
|
|
|
TILE_AIR = 0,
|
|
|
|
TILE_SOLID = 1,
|
2021-08-06 23:42:49 +02:00
|
|
|
TILE_DOOR = 2,
|
|
|
|
TILE_CHARACTER = 3,
|
2021-07-29 18:33:22 +02:00
|
|
|
};
|
2021-08-15 02:42:26 +02:00
|
|
|
|
|
|
|
int map_walkable(struct map const *map, int x, int y);
|
|
|
|
int map_get_player_tile(struct game const *game);
|