]> Shamusworld >> Repos - legend/blob - src/data.cpp
Initial commit for the Legend of A... project!
[legend] / src / data.cpp
1 //
2 // Game data
3 //
4 // by James Hammons
5 // (C) 2014 Underground Software
6 //
7 // JLH = James Hammons <jlhamm@acm.org>
8 //
9 // WHO  WHEN        WHAT
10 // ---  ----------  ------------------------------------------------------------
11 // JLH  08/21/2014  Created this file
12 //
13
14 #include "data.h"
15
16
17 // We use anonymous structs and cast these to Maps to be able to access them.
18
19 static const struct {
20         unsigned int width, height;
21         uint16_t n, s, e, w, special;
22         unsigned char state[16 * 11 + 1];
23 } map000 = { 16, 11,
24         1, 0, 2, 3, 0,
25         "1111111100111177"
26         "1111211100111177"
27         "1111000000111117"
28         "1111000000011111"
29         "0000000000001111"
30         "0000000000000111"
31         "1111000050000000"
32         "1111000000000000"
33         "1111000000001111"
34         "1111111101111111"
35         "1111111111111111"
36 };
37
38 static const struct {
39         unsigned int width, height;
40         uint16_t n, s, e, w, special;
41         unsigned char state[16 * 11 + 1];
42 } map001 = { 16, 11,
43         0, 0, 0, 0, 0,
44         "1111111111111111"
45         "1111111111111111"
46         "1111000000111111"
47         "1111000000011111"
48         "1100000000001111"
49         "1100000000000111"
50         "1111000050000011"
51         "1111000000000011"
52         "1111000000001117"
53         "1111111100111177"
54         "1111111100111177"
55 };
56
57 static const struct {
58         unsigned int width, height;
59         uint16_t n, s, e, w, special;
60         unsigned char state[16 * 11 + 1];
61 } map002 = { 16, 11,
62         0, 0, 0, 0, 0,
63         "1111111111111111"
64         "1111111111111111"
65         "1111000000111111"
66         "1111000000011111"
67         "1100000000001111"
68         "1100000000000111"
69         "0000000000000011"
70         "0000000000000011"
71         "1111000000001111"
72         "1111111111111111"
73         "1111111111111111"
74 };
75
76 static const struct {
77         unsigned int width, height;
78         uint16_t n, s, e, w, special;
79         unsigned char state[16 * 11 + 1];
80 } map003 = { 16, 11,
81         0, 0, 0, 0, 0,
82         "1111111111111111"
83         "1111111111111111"
84         "1111000000111111"
85         "1111000000011111"
86         "1100005000000000"
87         "1100000000000000"
88         "1111000000000011"
89         "1111000000000011"
90         "1111000000001111"
91         "1111111111111111"
92         "1111111111111111"
93 };
94
95
96 static const struct {
97         unsigned int width, height;
98         uint16_t n, s, e, w, special;
99         unsigned char state[16 * 11 + 1];
100 } room000 = { 16, 11,
101         0, 0, 0, 0, 0,
102         "1111111111111111"
103         "1111111111111111"
104         "1144444444444411"
105         "1144444444444411"
106         "1144444444444411"
107         "1144444444444411"
108         "1144444444444411"
109         "1144444444444411"
110         "1144444444444411"
111         "1111111441111111"
112         "1111111441111111"
113 };
114
115
116 const void * maps[] = {
117         &map000, &map001, &map002, &map003
118 };
119
120
121 const void * rooms[] = {
122         &room000
123 };
124
125
126 // Misc. globals
127
128 uint8_t roomState[256 * 256];
129 uint16_t roomWidth, roomHeight;
130
131 Map * mapSave = 0, * currentMap = 0;
132 uint16_t pxSave, pySave;
133