Devilution
Diablo devolved - magic behind the 1996 computer game
gendung.cpp
Go to the documentation of this file.
1 
6 #include "all.h"
7 
9 
15 BOOLEAN nTransTable[2049];
16 //int dword_52D204;
23 char TransVal;
29 BYTE *pMegaTiles;
35 char block_lvid[2049];
36 //char byte_5B78EB;
38 BOOLEAN nTrapTable[2049];
39 BYTE leveltype;
40 BYTE currlevel;
41 BOOLEAN TransList[256];
45 BOOLEAN nSolidTable[2049];
54 BOOLEAN nBlockTable[2049];
58 BYTE setlvlnum;
62 BOOLEAN nMissileTable[2049];
63 BYTE *pSetPiece;
65 BOOLEAN setlevel;
68 int dmaxx;
69 int dmaxy;
70 int setpc_h;
71 int setpc_w;
72 int setpc_x;
73 int ViewX;
74 int ViewY;
75 int setpc_y;
77 int dminx;
78 int dminy;
80 
82 {
83  BYTE bv;
84  DWORD dwTiles;
85  BYTE *pSBFile, *pTmp;
86  int i;
87 
88  memset(nBlockTable, 0, sizeof(nBlockTable));
89  memset(nSolidTable, 0, sizeof(nSolidTable));
90  memset(nTransTable, 0, sizeof(nTransTable));
91  memset(nMissileTable, 0, sizeof(nMissileTable));
92  memset(nTrapTable, 0, sizeof(nTrapTable));
93 
94  switch (leveltype) {
95  case DTYPE_TOWN:
96  pSBFile = LoadFileInMem("Levels\\TownData\\Town.SOL", &dwTiles);
97  break;
98  case DTYPE_CATHEDRAL:
99  pSBFile = LoadFileInMem("Levels\\L1Data\\L1.SOL", &dwTiles);
100  break;
101  case DTYPE_CATACOMBS:
102  pSBFile = LoadFileInMem("Levels\\L2Data\\L2.SOL", &dwTiles);
103  break;
104  case DTYPE_CAVES:
105  pSBFile = LoadFileInMem("Levels\\L3Data\\L3.SOL", &dwTiles);
106  break;
107  case DTYPE_HELL:
108  pSBFile = LoadFileInMem("Levels\\L4Data\\L4.SOL", &dwTiles);
109  break;
110  default:
111  app_fatal("FillSolidBlockTbls");
112  }
113 
114  pTmp = pSBFile;
115 
116  for (i = 1; i <= dwTiles; i++) {
117  bv = *pTmp++;
118  if (bv & 1)
119  nSolidTable[i] = TRUE;
120  if (bv & 2)
121  nBlockTable[i] = TRUE;
122  if (bv & 4)
123  nMissileTable[i] = TRUE;
124  if (bv & 8)
125  nTransTable[i] = TRUE;
126  if (bv & 0x80)
127  nTrapTable[i] = TRUE;
128  block_lvid[i] = (bv & 0x70) >> 4; /* beta: (bv >> 4) & 7 */
129  }
130 
131  mem_free_dbg(pSBFile);
132 }
133 
135 {
136  int i, x, y, lv, blocks;
137  WORD *pPiece;
138  MICROS *pMap;
139 
140  if (leveltype == DTYPE_TOWN) {
141  MicroTileLen = 16;
142  blocks = 16;
143  } else if (leveltype != DTYPE_HELL) {
144  MicroTileLen = 10;
145  blocks = 10;
146  } else {
147  MicroTileLen = 12;
148  blocks = 16;
149  }
150 
151  for (y = 0; y < MAXDUNY; y++) {
152  for (x = 0; x < MAXDUNX; x++) {
153  lv = dPiece[x][y];
154  pMap = &dpiece_defs_map_2[x][y];
155  if (lv) {
156  lv--;
158  pPiece = (WORD *)&pLevelPieces[20 * lv];
159  else
160  pPiece = (WORD *)&pLevelPieces[32 * lv];
161  for (i = 0; i < blocks; i++)
162  pMap->mt[i] = SDL_SwapLE16(pPiece[(i & 1) + blocks - 2 - (i & 0xE)]);
163  } else {
164  for (i = 0; i < blocks; i++)
165  pMap->mt[i] = 0;
166  }
167  }
168  }
169 }
170 
172 {
173  memset(dTransVal, 0, sizeof(dTransVal));
174  memset(TransList, 0, sizeof(TransList));
175  TransVal = 1;
176 }
177 
178 void DRLG_MRectTrans(int x1, int y1, int x2, int y2)
179 {
180  int i, j;
181 
182  x1 = 2 * x1 + 17;
183  y1 = 2 * y1 + 17;
184  x2 = 2 * x2 + 16;
185  y2 = 2 * y2 + 16;
186 
187  for (j = y1; j <= y2; j++) {
188  for (i = x1; i <= x2; i++) {
189  dTransVal[i][j] = TransVal;
190  }
191  }
192 
193  TransVal++;
194 }
195 
196 void DRLG_RectTrans(int x1, int y1, int x2, int y2)
197 {
198  int i, j;
199 
200  for (j = y1; j <= y2; j++) {
201  for (i = x1; i <= x2; i++) {
202  dTransVal[i][j] = TransVal;
203  }
204  }
205  TransVal++;
206 }
207 
208 void DRLG_CopyTrans(int sx, int sy, int dx, int dy)
209 {
210  dTransVal[dx][dy] = dTransVal[sx][sy];
211 }
212 
213 #ifndef SPAWN
214 void DRLG_ListTrans(int num, BYTE *List)
215 {
216  int i;
217  BYTE x1, x2, y1, y2;
218 
219  for (i = 0; i < num; i++) {
220  x1 = *List++;
221  y1 = *List++;
222  x2 = *List++;
223  y2 = *List++;
224  DRLG_RectTrans(x1, y1, x2, y2);
225  }
226 }
227 
228 void DRLG_AreaTrans(int num, BYTE *List)
229 {
230  int i;
231  BYTE x1, x2, y1, y2;
232 
233  for (i = 0; i < num; i++) {
234  x1 = *List++;
235  y1 = *List++;
236  x2 = *List++;
237  y2 = *List++;
238  DRLG_RectTrans(x1, y1, x2, y2);
239  TransVal--;
240  }
241  TransVal++;
242 }
243 #endif
244 
246 {
247  setpc_x = 0;
248  setpc_y = 0;
249  setpc_w = 0;
250  setpc_h = 0;
251 }
252 
254 {
255  int i, j, x, y, w, h;
256 
257  w = 2 * setpc_w;
258  h = 2 * setpc_h;
259  x = 2 * setpc_x + 16;
260  y = 2 * setpc_y + 16;
261 
262  for (j = 0; j < h; j++) {
263  for (i = 0; i < w; i++) {
264  dFlags[i + x][j + y] |= 8;
265  }
266  }
267 }
268 
269 #ifndef SPAWN
270 void Make_SetPC(int x, int y, int w, int h)
271 {
272  int i, j, dx, dy, dh, dw;
273 
274  dw = 2 * w;
275  dh = 2 * h;
276  dx = 2 * x + 16;
277  dy = 2 * y + 16;
278 
279  for (j = 0; j < dh; j++) {
280  for (i = 0; i < dw; i++) {
281  dFlags[i + dx][j + dy] |= 8;
282  }
283  }
284 }
285 
286 BOOL DRLG_WillThemeRoomFit(int floor, int x, int y, int minSize, int maxSize, int *width, int *height)
287 {
288  int ii, xx, yy;
289  int xSmallest, ySmallest;
290  int xArray[20], yArray[20];
291  int xCount, yCount;
292  BOOL yFlag, xFlag;
293 
294  yFlag = TRUE;
295  xFlag = TRUE;
296  xCount = 0;
297  yCount = 0;
298 
299  // BUGFIX: change '&&' to '||' (fixed)
300  if (x > DMAXX - maxSize || y > DMAXY - maxSize) {
301  return FALSE;
302  }
303  if (!SkipThemeRoom(x, y)) {
304  return FALSE;
305  }
306 
307  memset(xArray, 0, sizeof(xArray));
308  memset(yArray, 0, sizeof(yArray));
309 
310  for (ii = 0; ii < maxSize; ii++) {
311  if (xFlag) {
312  for (xx = x; xx < x + maxSize; xx++) {
313  if (dungeon[xx][y + ii] != floor) {
314  if (xx >= minSize) {
315  break;
316  }
317  xFlag = FALSE;
318  } else {
319  xCount++;
320  }
321  }
322  if (xFlag) {
323  xArray[ii] = xCount;
324  xCount = 0;
325  }
326  }
327  if (yFlag) {
328  for (yy = y; yy < y + maxSize; yy++) {
329  if (dungeon[x + ii][yy] != floor) {
330  if (yy >= minSize) {
331  break;
332  }
333  yFlag = FALSE;
334  } else {
335  yCount++;
336  }
337  }
338  if (yFlag) {
339  yArray[ii] = yCount;
340  yCount = 0;
341  }
342  }
343  }
344 
345  for (ii = 0; ii < minSize; ii++) {
346  if (xArray[ii] < minSize || yArray[ii] < minSize) {
347  return FALSE;
348  }
349  }
350 
351  xSmallest = xArray[0];
352  ySmallest = yArray[0];
353 
354  for (ii = 0; ii < maxSize; ii++) {
355  if (xArray[ii] < minSize || yArray[ii] < minSize) {
356  break;
357  }
358  if (xArray[ii] < xSmallest) {
359  xSmallest = xArray[ii];
360  }
361  if (yArray[ii] < ySmallest) {
362  ySmallest = yArray[ii];
363  }
364  }
365 
366  *width = xSmallest - 2;
367  *height = ySmallest - 2;
368  return TRUE;
369 }
370 
371 void DRLG_CreateThemeRoom(int themeIndex)
372 {
373  int xx, yy;
374 
375  for (yy = themeLoc[themeIndex].y; yy < themeLoc[themeIndex].y + themeLoc[themeIndex].height; yy++) {
376  for (xx = themeLoc[themeIndex].x; xx < themeLoc[themeIndex].x + themeLoc[themeIndex].width; xx++) {
377  if (leveltype == DTYPE_CATACOMBS) {
378  if (yy == themeLoc[themeIndex].y
379  && xx >= themeLoc[themeIndex].x
380  && xx <= themeLoc[themeIndex].x + themeLoc[themeIndex].width
381  || yy == themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1
382  && xx >= themeLoc[themeIndex].x
383  && xx <= themeLoc[themeIndex].x + themeLoc[themeIndex].width) {
384  dungeon[xx][yy] = 2;
385  } else if (xx == themeLoc[themeIndex].x
386  && yy >= themeLoc[themeIndex].y
387  && yy <= themeLoc[themeIndex].y + themeLoc[themeIndex].height
388  || xx == themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1
389  && yy >= themeLoc[themeIndex].y
390  && yy <= themeLoc[themeIndex].y + themeLoc[themeIndex].height) {
391  dungeon[xx][yy] = 1;
392  } else {
393  dungeon[xx][yy] = 3;
394  }
395  }
396  if (leveltype == DTYPE_CAVES) {
397  if (yy == themeLoc[themeIndex].y
398  && xx >= themeLoc[themeIndex].x
399  && xx <= themeLoc[themeIndex].x + themeLoc[themeIndex].width
400  || yy == themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1
401  && xx >= themeLoc[themeIndex].x
402  && xx <= themeLoc[themeIndex].x + themeLoc[themeIndex].width) {
403  dungeon[xx][yy] = 134;
404  } else if (xx == themeLoc[themeIndex].x
405  && yy >= themeLoc[themeIndex].y
406  && yy <= themeLoc[themeIndex].y + themeLoc[themeIndex].height
407  || xx == themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1
408  && yy >= themeLoc[themeIndex].y
409  && yy <= themeLoc[themeIndex].y + themeLoc[themeIndex].height) {
410  dungeon[xx][yy] = 137;
411  } else {
412  dungeon[xx][yy] = 7;
413  }
414  }
415  if (leveltype == DTYPE_HELL) {
416  if (yy == themeLoc[themeIndex].y
417  && xx >= themeLoc[themeIndex].x
418  && xx <= themeLoc[themeIndex].x + themeLoc[themeIndex].width
419  || yy == themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1
420  && xx >= themeLoc[themeIndex].x
421  && xx <= themeLoc[themeIndex].x + themeLoc[themeIndex].width) {
422  dungeon[xx][yy] = 2;
423  } else if (xx == themeLoc[themeIndex].x
424  && yy >= themeLoc[themeIndex].y
425  && yy <= themeLoc[themeIndex].y + themeLoc[themeIndex].height
426  || xx == themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1
427  && yy >= themeLoc[themeIndex].y
428  && yy <= themeLoc[themeIndex].y + themeLoc[themeIndex].height) {
429  dungeon[xx][yy] = 1;
430  } else {
431  dungeon[xx][yy] = 6;
432  }
433  }
434  }
435  }
436 
437  if (leveltype == DTYPE_CATACOMBS) {
438  dungeon[themeLoc[themeIndex].x][themeLoc[themeIndex].y] = 8;
439  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y] = 7;
440  dungeon[themeLoc[themeIndex].x][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 9;
441  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 6;
442  }
443  if (leveltype == DTYPE_CAVES) {
444  dungeon[themeLoc[themeIndex].x][themeLoc[themeIndex].y] = 150;
445  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y] = 151;
446  dungeon[themeLoc[themeIndex].x][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 152;
447  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 138;
448  }
449  if (leveltype == DTYPE_HELL) {
450  dungeon[themeLoc[themeIndex].x][themeLoc[themeIndex].y] = 9;
451  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y] = 16;
452  dungeon[themeLoc[themeIndex].x][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 15;
453  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 12;
454  }
455 
456  if (leveltype == DTYPE_CATACOMBS) {
457  switch (random_(0, 2)) {
458  case 0:
459  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height / 2] = 4;
460  break;
461  case 1:
462  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 5;
463  break;
464  }
465  }
466  if (leveltype == DTYPE_CAVES) {
467  switch (random_(0, 2)) {
468  case 0:
469  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height / 2] = 147;
470  break;
471  case 1:
472  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 146;
473  break;
474  }
475  }
476  if (leveltype == DTYPE_HELL) {
477  switch (random_(0, 2)) {
478  case 0:
479  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height / 2 - 1] = 53;
480  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height / 2] = 6;
481  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height / 2 + 1] = 52;
482  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width - 2][themeLoc[themeIndex].y + themeLoc[themeIndex].height / 2 - 1] = 54;
483  break;
484  case 1:
485  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2 - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 57;
486  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 6;
487  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2 + 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 1] = 56;
488  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 2] = 59;
489  dungeon[themeLoc[themeIndex].x + themeLoc[themeIndex].width / 2 - 1][themeLoc[themeIndex].y + themeLoc[themeIndex].height - 2] = 58;
490  break;
491  }
492  }
493 }
494 
495 void DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int freq, int rndSize)
496 {
497  int i, j;
498  int themeW, themeH;
499  int rv2, min, max;
500 
501  themeCount = 0;
502  memset(themeLoc, 0, sizeof(*themeLoc));
503  for (j = 0; j < DMAXY; j++) {
504  for (i = 0; i < DMAXX; i++) {
505  if (dungeon[i][j] == floor && !random_(0, freq) && DRLG_WillThemeRoomFit(floor, i, j, minSize, maxSize, &themeW, &themeH)) {
506  if (rndSize) {
507  min = minSize - 2;
508  max = maxSize - 2;
509  rv2 = min + random_(0, random_(0, themeW - min + 1));
510  if (rv2 >= min && rv2 <= max)
511  themeW = rv2;
512  else
513  themeW = min;
514  rv2 = min + random_(0, random_(0, themeH - min + 1));
515  if (rv2 >= min && rv2 <= max)
516  themeH = rv2;
517  else
518  themeH = min;
519  }
520  themeLoc[themeCount].x = i + 1;
521  themeLoc[themeCount].y = j + 1;
522  themeLoc[themeCount].width = themeW;
523  themeLoc[themeCount].height = themeH;
524  if (leveltype == DTYPE_CAVES)
525  DRLG_RectTrans(2 * i + 20, 2 * j + 20, 2 * (i + themeW) + 15, 2 * (j + themeH) + 15);
526  else
527  DRLG_MRectTrans(i + 1, j + 1, i + themeW, j + themeH);
530  themeCount++;
531  }
532  }
533  }
534 }
535 #endif
536 
538 {
539  int i, x, y, xx, yy;
540 
541  for (i = 0; i < themeCount; i++) {
542  for (y = themeLoc[i].y; y < themeLoc[i].y + themeLoc[i].height - 1; y++) {
543  for (x = themeLoc[i].x; x < themeLoc[i].x + themeLoc[i].width - 1; x++) {
544  xx = 2 * x + 16;
545  yy = 2 * y + 16;
546  dFlags[xx][yy] |= BFLAG_POPULATED;
547  dFlags[xx + 1][yy] |= BFLAG_POPULATED;
548  dFlags[xx][yy + 1] |= BFLAG_POPULATED;
549  dFlags[xx + 1][yy + 1] |= BFLAG_POPULATED;
550  }
551  }
552  }
553 }
554 
555 BOOL SkipThemeRoom(int x, int y)
556 {
557  int i;
558 
559  for (i = 0; i < themeCount; i++) {
560  if (x >= themeLoc[i].x - 2 && x <= themeLoc[i].x + themeLoc[i].width + 2
561  && y >= themeLoc[i].y - 2 && y <= themeLoc[i].y + themeLoc[i].height + 2)
562  return FALSE;
563  }
564 
565  return TRUE;
566 }
567 
569 {
570  if (!leveldebug) {
571  currlevel = 0;
573  setlevel = FALSE;
574  }
575 }
576 
DRLG_InitTrans
void DRLG_InitTrans()
Definition: gendung.cpp:171
ScrollStruct
Definition: structs.h:1105
setpc_w
int setpc_w
Definition: gendung.cpp:71
currlevel
BYTE currlevel
Definition: gendung.cpp:40
THEME_LOC::ttval
int ttval
Definition: structs.h:1116
setpc_h
int setpc_h
Definition: gendung.cpp:70
MICROS::mt
WORD mt[16]
Definition: structs.h:1122
dminx
int dminx
Definition: gendung.cpp:77
setpc_x
int setpc_x
Definition: gendung.cpp:72
DRLG_CopyTrans
void DRLG_CopyTrans(int sx, int sy, int dx, int dy)
Definition: gendung.cpp:208
pSpecialCels
BYTE * pSpecialCels
Definition: gendung.cpp:55
dungeon
BYTE dungeon[DMAXX][DMAXY]
Definition: gendung.cpp:18
THEME_LOC::x
int x
Definition: structs.h:1114
DTYPE_CATACOMBS
@ DTYPE_CATACOMBS
Definition: enums.h:1870
pdungeon
BYTE pdungeon[DMAXX][DMAXY]
Definition: gendung.cpp:20
pDungeonCels
BYTE * pDungeonCels
Definition: gendung.cpp:47
dmaxx
int dmaxx
Definition: gendung.cpp:68
MAXDUNX
#define MAXDUNX
Definition: defs.h:25
pLevelPieces
BYTE * pLevelPieces
Definition: gendung.cpp:30
pMegaTiles
BYTE * pMegaTiles
Definition: gendung.cpp:29
TransList
BOOLEAN TransList[256]
Definition: gendung.cpp:41
MICROS
Definition: structs.h:1121
ViewX
int ViewX
Definition: gendung.cpp:73
Make_SetPC
void Make_SetPC(int x, int y, int w, int h)
Definition: gendung.cpp:270
gnDifficulty
int gnDifficulty
Definition: gendung.cpp:31
all.h
ViewY
int ViewY
Definition: gendung.cpp:74
DRLG_ListTrans
void DRLG_ListTrans(int num, BYTE *List)
Definition: gendung.cpp:214
DRLG_PlaceThemeRooms
void DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int freq, int rndSize)
Definition: gendung.cpp:495
dObject
char dObject[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:19
themeCount
int themeCount
Definition: gendung.cpp:11
pSetPiece
BYTE * pSetPiece
Definition: gendung.cpp:63
MAXDUNY
#define MAXDUNY
Definition: defs.h:26
dLight
char dLight[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:27
dPiece
int dPiece[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:26
nSolidTable
BOOLEAN nSolidTable[2049]
List of path blocking dPieces.
Definition: gendung.cpp:45
DRLG_MRectTrans
void DRLG_MRectTrans(int x1, int y1, int x2, int y2)
Definition: gendung.cpp:178
TransVal
char TransVal
Definition: gendung.cpp:23
app_fatal
void app_fatal(const char *pszFmt,...)
Definition: appfat.cpp:18
DEVILUTION_END_NAMESPACE
#define DEVILUTION_END_NAMESPACE
Definition: types.h:10
nMissileTable
BOOLEAN nMissileTable[2049]
List of missile blocking dPieces.
Definition: gendung.cpp:62
SetDungeonMicros
void SetDungeonMicros()
Definition: gendung.cpp:134
MAXTILES
#define MAXTILES
Definition: defs.h:37
themeLoc
THEME_LOC themeLoc[MAXTHEMES]
Definition: gendung.cpp:48
setloadflag
BOOL setloadflag
Definition: gendung.cpp:28
LoadFileInMem
BYTE * LoadFileInMem(char *pszName, DWORD *pdwFileLen)
Load a file in to a buffer.
Definition: engine.cpp:801
SkipThemeRoom
BOOL SkipThemeRoom(int x, int y)
Definition: gendung.cpp:555
dMissile
char dMissile[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:76
dItem
char dItem[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:57
THEME_LOC::width
int width
Definition: structs.h:1117
leveldebug
BOOL leveldebug
Definition: diablo.cpp:35
nTrapTable
BOOLEAN nTrapTable[2049]
Definition: gendung.cpp:38
dmaxy
int dmaxy
Definition: gendung.cpp:69
DRLG_HoldThemeRooms
void DRLG_HoldThemeRooms()
Definition: gendung.cpp:537
THEME_LOC::height
int height
Definition: structs.h:1118
setlevel
BOOLEAN setlevel
Definition: gendung.cpp:65
DRLG_SetPC
void DRLG_SetPC()
Definition: gendung.cpp:253
dpiece_defs_map_2
MICROS dpiece_defs_map_2[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:79
DRLG_CreateThemeRoom
void DRLG_CreateThemeRoom(int themeIndex)
Definition: gendung.cpp:371
DMAXY
#define DMAXY
Definition: defs.h:8
DTYPE_TOWN
@ DTYPE_TOWN
Definition: enums.h:1868
DTYPE_HELL
@ DTYPE_HELL
Definition: enums.h:1872
LvlViewX
int LvlViewX
Definition: gendung.cpp:67
DTYPE_CAVES
@ DTYPE_CAVES
Definition: enums.h:1871
dPreLight
char dPreLight[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:22
THEME_LOC::y
int y
Definition: structs.h:1115
dTransVal
char dTransVal[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:37
LvlViewY
int LvlViewY
Definition: gendung.cpp:66
InitLevels
void InitLevels()
Definition: gendung.cpp:568
setlvlnum
BYTE setlvlnum
Definition: gendung.cpp:58
DTYPE_CATHEDRAL
@ DTYPE_CATHEDRAL
Definition: enums.h:1869
FillSolidBlockTbls
void FillSolidBlockTbls()
Definition: gendung.cpp:81
dflags
char dflags[DMAXX][DMAXY]
Definition: gendung.cpp:25
dSpecial
char dSpecial[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:50
THEME_LOC
Definition: structs.h:1113
random_
int random_(BYTE idx, int v)
Main RNG function.
Definition: engine.cpp:752
block_lvid
char block_lvid[2049]
List of transparancy masks to use for dPieces.
Definition: gendung.cpp:35
nTransTable
BOOLEAN nTransTable[2049]
List of transparent dPieces.
Definition: gendung.cpp:15
mem_free_dbg
void mem_free_dbg(void *p)
Multithreaded safe memfree.
Definition: engine.cpp:786
DRLG_WillThemeRoomFit
BOOL DRLG_WillThemeRoomFit(int floor, int x, int y, int minSize, int maxSize, int *width, int *height)
Definition: gendung.cpp:286
dMonster
int dMonster[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:17
DEVILUTION_BEGIN_NAMESPACE
Definition: sha.cpp:10
BFLAG_POPULATED
@ BFLAG_POPULATED
Definition: enums.h:1880
MAXTHEMES
#define MAXTHEMES
Definition: defs.h:36
dPlayer
char dPlayer[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:49
dFlags
char dFlags[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:56
ScrollInfo
ScrollStruct ScrollInfo
Definition: gendung.cpp:46
MicroTileLen
int MicroTileLen
Definition: gendung.cpp:24
level_frame_types
DEVILUTION_BEGIN_NAMESPACE WORD level_frame_types[MAXTILES]
Definition: gendung.cpp:10
DRLG_AreaTrans
void DRLG_AreaTrans(int num, BYTE *List)
Definition: gendung.cpp:228
dminy
int dminy
Definition: gendung.cpp:78
DRLG_InitSetPC
void DRLG_InitSetPC()
Definition: gendung.cpp:245
setpc_y
int setpc_y
Definition: gendung.cpp:75
DRLG_RectTrans
void DRLG_RectTrans(int x1, int y1, int x2, int y2)
Definition: gendung.cpp:196
leveltype
BYTE leveltype
Definition: gendung.cpp:39
dDead
char dDead[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:21
nBlockTable
BOOLEAN nBlockTable[2049]
List of light blocking dPieces.
Definition: gendung.cpp:54
DMAXX
#define DMAXX
Definition: defs.h:7
setlvltype
char setlvltype
Definition: gendung.cpp:64