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

Function FillSolidBlockTbls

Source/gendung.cpp:61–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59MICROS dpiece_defs_map_2[MAXDUNX][MAXDUNY];
60
61void FillSolidBlockTbls()
62{
63 BYTE bv;
64 DWORD dwTiles;
65 BYTE *pSBFile, *pTmp;
66 int i;
67
68 memset(nBlockTable, 0, sizeof(nBlockTable));
69 memset(nSolidTable, 0, sizeof(nSolidTable));
70 memset(nTransTable, 0, sizeof(nTransTable));
71 memset(nMissileTable, 0, sizeof(nMissileTable));
72 memset(nTrapTable, 0, sizeof(nTrapTable));
73
74 switch (leveltype) {
75 case DTYPE_TOWN:
76 pSBFile = LoadFileInMem("Levels\\TownData\\Town.SOL", &dwTiles);
77 break;
78 case DTYPE_CATHEDRAL:
79 pSBFile = LoadFileInMem("Levels\\L1Data\\L1.SOL", &dwTiles);
80 break;
81 case DTYPE_CATACOMBS:
82 pSBFile = LoadFileInMem("Levels\\L2Data\\L2.SOL", &dwTiles);
83 break;
84 case DTYPE_CAVES:
85 pSBFile = LoadFileInMem("Levels\\L3Data\\L3.SOL", &dwTiles);
86 break;
87 case DTYPE_HELL:
88 pSBFile = LoadFileInMem("Levels\\L4Data\\L4.SOL", &dwTiles);
89 break;
90 default:
91 app_fatal("FillSolidBlockTbls");
92 }
93
94 pTmp = pSBFile;
95
96 for (i = 1; i <= dwTiles; i++) {
97 bv = *pTmp++;
98 if (bv & 1)
99 nSolidTable[i] = TRUE;
100 if (bv & 2)
101 nBlockTable[i] = TRUE;
102 if (bv & 4)
103 nMissileTable[i] = TRUE;
104 if (bv & 8)
105 nTransTable[i] = TRUE;
106 if (bv & 0x80)
107 nTrapTable[i] = TRUE;
108 block_lvid[i] = (bv & 0x70) >> 4; /* beta: (bv >> 4) & 7 */
109 }
110
111 mem_free_dbg(pSBFile);
112}
113
114void SetDungeonMicros()
115{

Callers 1

LoadGameLevelFunction · 0.85

Calls 3

LoadFileInMemFunction · 0.85
app_fatalFunction · 0.85
mem_free_dbgFunction · 0.85

Tested by

no test coverage detected