mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-10-12 02:13:06 +00:00
Add glow to Crypt lava tiles
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "engine/point.hpp"
|
||||
#include "items.h"
|
||||
#include "levels/drlg_l1.h"
|
||||
#include "lighting.h"
|
||||
|
||||
namespace devilution {
|
||||
|
||||
@@ -811,4 +812,27 @@ void SetCryptSetPieceRoom()
|
||||
}
|
||||
}
|
||||
|
||||
void PlaceCryptLights()
|
||||
{
|
||||
constexpr int lavaTiles[] = {
|
||||
124, 128, 130, 132, 133, 134, 135, 139, 141, 143, 145, 156, 164, 166,
|
||||
167, 168, 169, 170, 182, 190, 192, 195, 196, 199, 200, 254, 266, 273,
|
||||
276, 281, 282, 283, 284, 285, 286, 287, 288, 290, 302, 316, 434, 435,
|
||||
436, 437, 445, 446, 447, 453, 457, 460, 466, 470, 477, 479, 484, 485,
|
||||
486, 490, 507, 537, 557, 559, 561, 563, 564, 568, 569, 572, 578, 580,
|
||||
584, 585, 589, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601
|
||||
};
|
||||
|
||||
for (int j = 0; j < MAXDUNY; j++) {
|
||||
for (int i = 0; i < MAXDUNX; i++) {
|
||||
for (const int lavaTile : lavaTiles) {
|
||||
if (dPiece[i][j] == lavaTile) {
|
||||
DoLighting({ i, j }, 3, {});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace devilution
|
||||
|
||||
@@ -24,5 +24,6 @@ void FixCryptDirtTiles();
|
||||
bool PlaceCryptStairs(lvl_entry entry);
|
||||
void CryptSubstitution();
|
||||
void SetCryptSetPieceRoom();
|
||||
void PlaceCryptLights();
|
||||
|
||||
} // namespace devilution
|
||||
|
||||
@@ -1298,6 +1298,7 @@ void CreateL5Dungeon(uint32_t rseed, lvl_entry entry)
|
||||
Pass3();
|
||||
|
||||
if (leveltype == DTYPE_CRYPT) {
|
||||
PlaceCryptLights();
|
||||
SetCryptSetPieceRoom();
|
||||
}
|
||||
}
|
||||
@@ -1324,10 +1325,12 @@ void LoadL1Dungeon(const char *path, Point spawn)
|
||||
|
||||
Pass3();
|
||||
|
||||
if (setlvltype == DTYPE_CRYPT)
|
||||
if (setlvltype == DTYPE_CRYPT) {
|
||||
AddCryptObjects(0, 0, MAXDUNX, MAXDUNY);
|
||||
else
|
||||
PlaceCryptLights();
|
||||
} else {
|
||||
AddL1Objs(0, 0, MAXDUNX, MAXDUNY);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace devilution
|
||||
|
||||
+1
-1
@@ -381,7 +381,7 @@ void MakeLightTable()
|
||||
float scaled;
|
||||
if (IsAnyOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) {
|
||||
// quardratic falloff with over exposure
|
||||
const float brightness = radius * 1.5;
|
||||
const float brightness = radius * 1.25;
|
||||
scaled = factor * factor * brightness + (maxDarkness - brightness);
|
||||
scaled = std::max(maxBrightness, scaled);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user