1#ifndef MAPS_H
2#define MAPS_H
3
4#include "nonstd.h"
5
6#include "maps/map1.h"
7
8typedef struct {
9 const unsigned char *data;
10 int len;
11 int width;
12 int height;
13 u32 *cells;
14} Map;
15
16typedef struct {
17 const char *name;
18 const char *reply;
19 const char *vdb_path;
20} NpcSettings;
21
22typedef struct {
23 const unsigned char *data;
24 int len;
25 Map map;
26 NpcSettings npcs[10];
27} GameMap;
28
29static inline GameMap make_map1(void) {
30 GameMap map = {0};
31 map.data = maps_map1_txt;
32 map.len = (int)maps_map1_txt_len;
33 map.npcs[0] = (NpcSettings){.name = "Bromm", .reply = "Bromm: The old ruins are north of here.", .vdb_path = "corpus/map1_bromm.vdb"};
34 map.npcs[1] = (NpcSettings){.name = "Dagna", .reply = "Dagna: The well is safe, mostly.", .vdb_path = "corpus/map1_dagna.vdb"};
35 map.npcs[2] = (NpcSettings){.name = "Keldor", .reply = "Keldor: I saw lights in the marsh last night.", .vdb_path = "corpus/map1_keldor.vdb"};
36 map.npcs[3] = (NpcSettings){.name = "Thrain", .reply = "Thrain: Mind the bridge; the beams sing when they're weak.", .vdb_path = "corpus/map1_thrain.vdb"};
37 map.npcs[4] = (NpcSettings){.name = "Skara", .reply = "Skara: If you hear bells in the fog, turn back.", .vdb_path = "corpus/map1_skara.vdb"};
38 return map;
39}
40
41#endif