Browse Source

Merge SetDungeonMicros and SetTownMicros

pull/632/head
Anders Jenbo 6 years ago
parent
commit
dd64f18a49
  1. 3
      Source/diablo.cpp
  2. 7
      Source/gendung.cpp
  3. 29
      Source/town.cpp

3
Source/diablo.cpp

@ -1603,8 +1603,7 @@ void LoadGameLevel(BOOL firstflag, int lvldir)
}
}
if (leveltype != DTYPE_TOWN)
SetDungeonMicros();
SetDungeonMicros();
InitLightMax();
IncProgress();

7
Source/gendung.cpp

@ -117,7 +117,10 @@ void SetDungeonMicros()
WORD *pPiece;
MICROS *pMap;
if (leveltype != DTYPE_HELL) {
if (leveltype == DTYPE_TOWN) {
MicroTileLen = 16;
blocks = 16;
} else if (leveltype != DTYPE_HELL) {
MicroTileLen = 10;
blocks = 10;
} else {
@ -131,7 +134,7 @@ void SetDungeonMicros()
pMap = &dpiece_defs_map_2[x][y];
if (lv) {
lv--;
if (leveltype != DTYPE_HELL)
if (leveltype != DTYPE_HELL && leveltype != DTYPE_TOWN)
pPiece = (WORD *)&pLevelPieces[20 * lv];
else
pPiece = (WORD *)&pLevelPieces[32 * lv];

29
Source/town.cpp

@ -2,33 +2,6 @@
DEVILUTION_BEGIN_NAMESPACE
void SetTownMicros()
{
int i, x, y, lv;
WORD *pPiece;
MICROS *pMap;
MicroTileLen = 16;
for (y = 0; y < MAXDUNY; y++) {
for (x = 0; x < MAXDUNX; x++) {
lv = dPiece[x][y];
pMap = &dpiece_defs_map_2[x][y];
if (lv != 0) {
lv--;
pPiece = (WORD *)&pLevelPieces[32 * lv];
for (i = 0; i < 16; i++) {
pMap->mt[i] = SDL_SwapLE16(pPiece[(i & 1) + 16 - 2 - (i & 0xE)]);
}
} else {
for (i = 0; i < 16; i++) {
pMap->mt[i] = 0;
}
}
}
}
}
/**
* @brief Load level data into dPiece
* @param P3Tiles Tile set
@ -244,8 +217,6 @@ void CreateTown(int entry)
}
}
}
SetTownMicros();
}
DEVILUTION_END_NAMESPACE

Loading…
Cancel
Save