aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_voxelalgorithms.cpp
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-10-09 10:50:26 -0400
committerGitHub <noreply@github.com>2022-10-09 10:50:26 -0400
commit9676364c1fe5fe5eae69c55e7d7a45392decfb2d (patch)
treeb21c99ce54820b24bfef9028c39b01f28ed3c1ca /src/unittest/test_voxelalgorithms.cpp
parent440d966b939059dfa51604eb68d61eecb12baeb4 (diff)
downloadminetest-9676364c1fe5fe5eae69c55e7d7a45392decfb2d.tar.xz
Optimize lighting calculation (#12797)
Diffstat (limited to 'src/unittest/test_voxelalgorithms.cpp')
-rw-r--r--src/unittest/test_voxelalgorithms.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/unittest/test_voxelalgorithms.cpp b/src/unittest/test_voxelalgorithms.cpp
index abe48893f..6514d3713 100644
--- a/src/unittest/test_voxelalgorithms.cpp
+++ b/src/unittest/test_voxelalgorithms.cpp
@@ -138,27 +138,27 @@ void TestVoxelAlgorithms::testLighting(IGameDef *gamedef)
const NodeDefManager *ndef = gamedef->ndef();
{
MapNode n = map.getNode(v3s16(9, 9, -9));
- UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef), 0);
- UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef), 13);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef->getLightingFlags(n)), 0);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef->getLightingFlags(n)), 13);
}
{
MapNode n = map.getNode(v3s16(0, 1, 0));
- UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef), 12);
- UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef), 12);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef->getLightingFlags(n)), 12);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef->getLightingFlags(n)), 12);
}
{
MapNode n = map.getNode(v3s16(-9, -1, 0));
- UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef), 3);
- UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef), 12);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef->getLightingFlags(n)), 3);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef->getLightingFlags(n)), 12);
}
{
MapNode n = map.getNode(v3s16(-10, 0, 0));
- UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef), 3);
- UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef), 14);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef->getLightingFlags(n)), 3);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef->getLightingFlags(n)), 14);
}
{
MapNode n = map.getNode(v3s16(-11, 0, 0));
- UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef), 2);
- UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef), 15);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_NIGHT, ndef->getLightingFlags(n)), 2);
+ UASSERTEQ(int, n.getLight(LIGHTBANK_DAY, ndef->getLightingFlags(n)), 15);
}
}