-#if 0
-static void make_randomstone(VoxelManipulator &vmanip, v3s16 p0)
-{
- MapNode stonenode(LEGN(ndef, "CONTENT_STONE"));
-
- s16 size = myrand_range(3, 6);
-
- VoxelArea stone_a(v3s16(-2,0,-2), v3s16(2,size,2));
- Buffer<u8> stone_d(stone_a.getVolume());
- for(s32 i=0; i<stone_a.getVolume(); i++)
- stone_d[i] = 0;
-
- // Force stone at bottom to make it usually touch the ground
- {
- for(s16 z=0; z<=0; z++)
- for(s16 y=0; y<=0; y++)
- for(s16 x=0; x<=0; x++)
- {
- stone_d[stone_a.index(v3s16(x,y,z))] = 1;
- }
- }
-
- // Generate from perlin noise
- for(s16 z=stone_a.MinEdge.Z; z<=stone_a.MaxEdge.Z; z++)
- for(s16 y=stone_a.MinEdge.Y; y<=stone_a.MaxEdge.Y; y++)
- for(s16 x=stone_a.MinEdge.X; x<=stone_a.MaxEdge.X; x++)
- {
- double d = noise3d_perlin((float)x/3.,(float)z/3.,(float)y/3.,
- p0.Z*4243+p0.Y*34+p0.X, 2, 0.5);
- if(z == stone_a.MinEdge.Z || z == stone_a.MaxEdge.Z)
- d -= 0.3;
- if(/*y == stone_a.MinEdge.Y ||*/ y == stone_a.MaxEdge.Y)
- d -= 0.3;
- if(x == stone_a.MinEdge.X || x == stone_a.MaxEdge.X)
- d -= 0.3;
- if(d > 0.0)
- {
- u32 vi = stone_a.index(v3s16(x,y,z));
- stone_d[vi] = 1;
- }
- }
-
- /*// Add stone randomly
- for(u32 iii=0; iii<7; iii++)
- {
- s16 d = 1;
-
- v3s16 p(
- myrand_range(stone_a.MinEdge.X, stone_a.MaxEdge.X-d),
- myrand_range(stone_a.MinEdge.Y, stone_a.MaxEdge.Y-d),
- myrand_range(stone_a.MinEdge.Z, stone_a.MaxEdge.Z-d)
- );
-
- for(s16 z=0; z<=d; z++)
- for(s16 y=0; y<=d; y++)
- for(s16 x=0; x<=d; x++)
- {
- stone_d[stone_a.index(p+v3s16(x,y,z))] = 1;
- }
- }*/
-
- // Blit stone to vmanip
- for(s16 z=stone_a.MinEdge.Z; z<=stone_a.MaxEdge.Z; z++)
- for(s16 y=stone_a.MinEdge.Y; y<=stone_a.MaxEdge.Y; y++)
- for(s16 x=stone_a.MinEdge.X; x<=stone_a.MaxEdge.X; x++)
- {
- v3s16 p(x,y,z);
- p += p0;
- if(vmanip.m_area.contains(p) == false)
- continue;
- u32 vi = vmanip.m_area.index(p);
- if(vmanip.m_data[vi].getContent() != CONTENT_AIR
- && vmanip.m_data[vi].getContent() != CONTENT_IGNORE)
- continue;
- u32 i = stone_a.index(x,y,z);
- if(stone_d[i] == 1)
- vmanip.m_data[vi] = stonenode;
- }
-}
-#endif
-
-#if 0
-static void make_largestone(VoxelManipulator &vmanip, v3s16 p0)
-{
- MapNode stonenode(LEGN(ndef, "CONTENT_STONE"));
-
- s16 size = myrand_range(8, 16);
-
- VoxelArea stone_a(v3s16(-size/2,0,-size/2), v3s16(size/2,size,size/2));
- Buffer<u8> stone_d(stone_a.getVolume());
- for(s32 i=0; i<stone_a.getVolume(); i++)
- stone_d[i] = 0;
-
- // Force stone at bottom to make it usually touch the ground
- {
- for(s16 z=0; z<=0; z++)
- for(s16 y=0; y<=0; y++)
- for(s16 x=0; x<=0; x++)
- {
- stone_d[stone_a.index(v3s16(x,y,z))] = 1;
- }
- }
-
- // Generate from perlin noise
- for(s16 z=stone_a.MinEdge.Z; z<=stone_a.MaxEdge.Z; z++)
- for(s16 y=stone_a.MinEdge.Y; y<=stone_a.MaxEdge.Y; y++)
- for(s16 x=stone_a.MinEdge.X; x<=stone_a.MaxEdge.X; x++)
- {
- double d = 1.0;
- d += noise3d_perlin((float)x/10.,(float)z/10.,(float)y/10.,
- p0.Z*5123+p0.Y*2439+p0.X, 2, 0.5);
- double mid_z = (stone_a.MaxEdge.Z+stone_a.MinEdge.Z)/2;
- double mid_x = (stone_a.MaxEdge.X+stone_a.MinEdge.X)/2;
- double mid_y = (stone_a.MaxEdge.Y+stone_a.MinEdge.Y)/2;
- double dz = (double)z-mid_z;
- double dx = (double)x-mid_x;
- double dy = MYMAX(0, (double)y-mid_y);
- double r = sqrt(dz*dz+dx*dx+dy*dy);
- d /= (2*r/size)*2 + 0.01;
- if(d > 1.0)
- {
- u32 vi = stone_a.index(v3s16(x,y,z));
- stone_d[vi] = 1;
- }
- }
-
- /*// Add stone randomly
- for(u32 iii=0; iii<7; iii++)
- {
- s16 d = 1;
-
- v3s16 p(
- myrand_range(stone_a.MinEdge.X, stone_a.MaxEdge.X-d),
- myrand_range(stone_a.MinEdge.Y, stone_a.MaxEdge.Y-d),
- myrand_range(stone_a.MinEdge.Z, stone_a.MaxEdge.Z-d)
- );
-
- for(s16 z=0; z<=d; z++)
- for(s16 y=0; y<=d; y++)
- for(s16 x=0; x<=d; x++)
- {
- stone_d[stone_a.index(p+v3s16(x,y,z))] = 1;
- }
- }*/
-
- // Blit stone to vmanip
- for(s16 z=stone_a.MinEdge.Z; z<=stone_a.MaxEdge.Z; z++)
- for(s16 y=stone_a.MinEdge.Y; y<=stone_a.MaxEdge.Y; y++)
- for(s16 x=stone_a.MinEdge.X; x<=stone_a.MaxEdge.X; x++)
- {
- v3s16 p(x,y,z);
- p += p0;
- if(vmanip.m_area.contains(p) == false)
- continue;
- u32 vi = vmanip.m_area.index(p);
- /*if(vmanip.m_data[vi].getContent() != CONTENT_AIR
- && vmanip.m_data[vi].getContent() != CONTENT_IGNORE)
- continue;*/
- u32 i = stone_a.index(x,y,z);
- if(stone_d[i] == 1)
- vmanip.m_data[vi] = stonenode;
- }
-}
-#endif
-