MCPcopy Create free account
hub / github.com/diasurgical/devilution / CreateTown

Function CreateTown

Source/town.cpp:144–220  ·  view source on GitHub ↗

* @brief Initialize town level * @param entry Methode of entry */

Source from the content-addressed store, hash-verified

142 * @param entry Methode of entry
143 */
144void CreateTown(int entry)
145{
146 int x, y;
147
148 dminx = 10;
149 dminy = 10;
150 dmaxx = 84;
151 dmaxy = 84;
152 DRLG_InitTrans();
153 DRLG_Init_Globals();
154
155 if (entry == 0) {
156 ViewX = 75;
157 ViewY = 68;
158 } else if (entry == 1) {
159 ViewX = 25;
160 ViewY = 31;
161 } else if (entry == 7) {
162 if (TWarpFrom == 5) {
163 ViewX = 49;
164 ViewY = 22;
165 }
166 if (TWarpFrom == 9) {
167 ViewX = 18;
168 ViewY = 69;
169 }
170 if (TWarpFrom == 13) {
171 ViewX = 41;
172 ViewY = 81;
173 }
174 }
175
176 T_Pass3();
177 memset(dLight, 0, sizeof(dLight));
178 memset(dFlags, 0, sizeof(dFlags));
179 memset(dPlayer, 0, sizeof(dPlayer));
180 memset(dMonster, 0, sizeof(dMonster));
181 memset(dObject, 0, sizeof(dObject));
182 memset(dItem, 0, sizeof(dItem));
183 memset(dArch, 0, sizeof(dArch));
184
185 for (y = 0; y < MAXDUNY; y++) {
186 for (x = 0; x < MAXDUNX; x++) {
187 if (dPiece[x][y] == 360) {
188 dArch[x][y] = 1;
189 } else if (dPiece[x][y] == 358) {
190 dArch[x][y] = 2;
191 } else if (dPiece[x][y] == 129) {
192 dArch[x][y] = 6;
193 } else if (dPiece[x][y] == 130) {
194 dArch[x][y] = 7;
195 } else if (dPiece[x][y] == 128) {
196 dArch[x][y] = 8;
197 } else if (dPiece[x][y] == 117) {
198 dArch[x][y] = 9;
199 } else if (dPiece[x][y] == 157) {
200 dArch[x][y] = 10;
201 } else if (dPiece[x][y] == 158) {

Callers 1

CreateLevelFunction · 0.85

Calls 2

DRLG_InitTransFunction · 0.85
DRLG_Init_GlobalsFunction · 0.85

Tested by

no test coverage detected