]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapgen_indev.cpp
Increase liquid_loop_max to 10000 again
[dragonfireclient.git] / src / mapgen_indev.cpp
index 430359be2d0d4d4f25dcf302c6e3329c181da242..7203fc85d7f1c34ea66d70bdbf733165ade97f75 100644 (file)
@@ -359,33 +359,30 @@ void MapgenIndev::generateFloatIslands(int min_y) {
        float xl = node_max.X - node_min.X;
        float yl = node_max.Y - node_min.Y;
        float zl = node_max.Z - node_min.Z;
+       u32 zstride = xl + 1;
        float midy = node_min.Y + yl * 0.5;
-       u32 index = 0, index2d = 0;
-       for (int x1 = 0; x1 <= xl; ++x1)
-       {
-               for (int z1 = 0; z1 <= zl; ++z1, ++index2d)
-               {
-                       float noise3 = noiseindev_float_islands3->result[index2d];
-                       float pmidy = midy + noise3 / 1.5 * AMPY;
-                       for (int y1 = 0; y1 <= yl; ++y1, ++index)
-                       {
-                               int y = y1 + node_min.Y;
-                               float noise1 = noiseindev_float_islands1->result[index];
-                               float offset = y > pmidy ? (y - pmidy) / TGRAD : (pmidy - y) / BGRAD;
-                               float noise1off = noise1 - offset - RAR;
-                               if (noise1off > 0 && noise1off < 0.7) {
-                                       float noise2 = noiseindev_float_islands2->result[index];
-                                       if (noise2 - noise1off > -0.7){
-                                               v3s16 p = p0 + v3s16(x1, y1, z1);
-                                               u32 i = vm->m_area.index(p);
-                                               if (!vm->m_area.contains(i))
-                                                       continue;
-                                               // Cancel if not  air
-                                               if (vm->m_data[i].getContent() != CONTENT_AIR)
-                                                       continue;
-                                               vm->m_data[i] = n1;
-                                       }
-                               }
+       u32 index = 0;
+       for (int z1 = 0; z1 <= zl; ++z1)
+       for (int y1 = 0; y1 <= yl; ++y1)
+       for (int x1 = 0; x1 <= xl; ++x1, ++index) {
+               int y = y1 + node_min.Y;
+               u32 index2d = z1 * zstride + x1;
+               float noise3 = noiseindev_float_islands3->result[index2d];
+               float pmidy = midy + noise3 / 1.5 * AMPY;
+               float noise1 = noiseindev_float_islands1->result[index];
+               float offset = y > pmidy ? (y - pmidy) / TGRAD : (pmidy - y) / BGRAD;
+               float noise1off = noise1 - offset - RAR;
+               if (noise1off > 0 && noise1off < 0.7) {
+                       float noise2 = noiseindev_float_islands2->result[index];
+                       if (noise2 - noise1off > -0.7) {
+                               v3s16 p = p0 + v3s16(x1, y1, z1);
+                               u32 i = vm->m_area.index(p);
+                               if (!vm->m_area.contains(i))
+                                       continue;
+                               // Cancel if not  air
+                               if (vm->m_data[i].getContent() != CONTENT_AIR)
+                                       continue;
+                               vm->m_data[i] = n1;
                        }
                }
        }