summaryrefslogtreecommitdiff
path: root/src/voxel.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-03-09 08:49:00 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-03-09 23:27:26 +0100
commit12d1e4ff0486f86ae20051daa1135dc7db366023 (patch)
tree20505a9d8b05540cbdcb8faf2da9e4542126e9fe /src/voxel.h
parent3b27cf30d99a5b4e82677c253bee269574edbaa0 (diff)
downloadminetest-12d1e4ff0486f86ae20051daa1135dc7db366023.tar.gz
minetest-12d1e4ff0486f86ae20051daa1135dc7db366023.tar.bz2
minetest-12d1e4ff0486f86ae20051daa1135dc7db366023.zip
VoxelArea: add_{x,y,z,p} must be static
Fix some documentations issues Use getNodeNoCheck(v3s16, ...) in some cases instead of getNodeNoCheck(x, y, z, ...)
Diffstat (limited to 'src/voxel.h')
-rw-r--r--src/voxel.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/voxel.h b/src/voxel.h
index 687336923..16540e595 100644
--- a/src/voxel.h
+++ b/src/voxel.h
@@ -277,25 +277,36 @@ public:
return index(p.X, p.Y, p.Z);
}
- // Translate index in the X coordinate
- void add_x(const v3s16 &extent, u32 &i, s16 a)
+ /**
+ * Translate index in the X coordinate
+ */
+ static void add_x(const v3s16 &extent, u32 &i, s16 a)
{
i += a;
}
- // Translate index in the Y coordinate
- void add_y(const v3s16 &extent, u32 &i, s16 a)
+
+ /**
+ * Translate index in the Y coordinate
+ */
+ static void add_y(const v3s16 &extent, u32 &i, s16 a)
{
i += a * extent.X;
}
- // Translate index in the Z coordinate
- void add_z(const v3s16 &extent, u32 &i, s16 a)
+
+ /**
+ * Translate index in the Z coordinate
+ */
+ static void add_z(const v3s16 &extent, u32 &i, s16 a)
{
- i += a * extent.X*extent.Y;
+ i += a * extent.X * extent.Y;
}
- // Translate index in space
- void add_p(const v3s16 &extent, u32 &i, v3s16 a)
+
+ /**
+ * Translate index in space
+ */
+ static void add_p(const v3s16 &extent, u32 &i, v3s16 a)
{
- i += a.Z*extent.X*extent.Y + a.Y*extent.X + a.X;
+ i += a.Z * extent.X * extent.Y + a.Y * extent.X + a.X;
}
/*