Skip to content

Commit

Permalink
Reformat rot array in NodeDefManager::nodeboxConnects, to make it les…
Browse files Browse the repository at this point in the history
…s magic
  • Loading branch information
Desour authored and sfan5 committed Oct 30, 2023
1 parent 6410458 commit 1d31533
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions src/nodedef.cpp
Expand Up @@ -1736,18 +1736,41 @@ bool NodeDefManager::nodeboxConnects(MapNode from, MapNode to,
f2.param_type_2 == CPT2_4DIR ||
f2.param_type_2 == CPT2_COLORED_4DIR)
&& (connect_face >= 4)) {
static const u8 rot[33 * 4] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 4, 32, 16, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, // 4 - back
8, 4, 32, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, // 8 - right
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 8, 4, 32, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, // 16 - front
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 32, 16, 8, 4 // 32 - left
};
static const u8 rot[33 * 4] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
4, 32, 16, 8, // 4 - back
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
8, 4, 32, 16, // 8 - right
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
16, 8, 4, 32, // 16 - front
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
32, 16, 8, 4 // 32 - left
};
if (f2.param_type_2 == CPT2_FACEDIR ||
f2.param_type_2 == CPT2_COLORED_FACEDIR) {
return (f2.connect_sides
Expand Down

0 comments on commit 1d31533

Please sign in to comment.