1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Change VoxelArea volume to be u32

This commit is contained in:
sfan5 2024-12-06 21:17:59 +01:00
parent 67126cbd1b
commit 4f800dd2b4
6 changed files with 20 additions and 19 deletions

View file

@ -77,7 +77,7 @@ void make_tree(MMVManip &vmanip, v3s16 p0, bool is_apple_tree,
VoxelArea leaves_a(v3s16(-2, -1, -2), v3s16(2, 2, 2));
Buffer<u8> leaves_d(leaves_a.getVolume());
for (s32 i = 0; i < leaves_a.getVolume(); i++)
for (u32 i = 0; i < leaves_d.getSize(); i++)
leaves_d[i] = 0;
// Force leaves at near the end of the trunk
@ -697,9 +697,8 @@ void make_jungletree(MMVManip &vmanip, v3s16 p0, const NodeDefManager *ndef,
p1.Y -= 1;
VoxelArea leaves_a(v3s16(-3, -2, -3), v3s16(3, 2, 3));
//SharedPtr<u8> leaves_d(new u8[leaves_a.getVolume()]);
Buffer<u8> leaves_d(leaves_a.getVolume());
for (s32 i = 0; i < leaves_a.getVolume(); i++)
for (u32 i = 0; i < leaves_d.getSize(); i++)
leaves_d[i] = 0;
// Force leaves at near the end of the trunk
@ -788,7 +787,7 @@ void make_pine_tree(MMVManip &vmanip, v3s16 p0, const NodeDefManager *ndef,
VoxelArea leaves_a(v3s16(-3, -6, -3), v3s16(3, 3, 3));
Buffer<u8> leaves_d(leaves_a.getVolume());
for (s32 i = 0; i < leaves_a.getVolume(); i++)
for (u32 i = 0; i < leaves_d.getSize(); i++)
leaves_d[i] = 0;
// Upper branches