]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fractalnoise.c
changed most Sys_Error calls to Con_Printf with appropriate error returns
[xonotic/darkplaces.git] / fractalnoise.c
index 4574902fa496379d920554fddf5022bf24f759fa..90419e3d4e4d4a3574aa5460f82545b05eab6440 100644 (file)
@@ -9,11 +9,17 @@ void fractalnoise(qbyte *noise, int size, int startgrid)
 
        for (sizepower = 0;(1 << sizepower) < size;sizepower++);
        if (size != (1 << sizepower))
-               Sys_Error("fractalnoise: size must be power of 2\n");
+       {
+               Con_Printf("fractalnoise: size must be power of 2\n");
+               return;
+       }
 
        for (gridpower = 0;(1 << gridpower) < startgrid;gridpower++);
        if (startgrid != (1 << gridpower))
-               Sys_Error("fractalnoise: grid must be power of 2\n");
+       {
+               Con_Printf("fractalnoise: grid must be power of 2\n");
+               return;
+       }
 
        startgrid = bound(0, startgrid, size);
 
@@ -32,7 +38,7 @@ void fractalnoise(qbyte *noise, int size, int startgrid)
                g = g2 >> 1;
                if (g)
                {
-                       // subdivide, diamond-square algorythm (really this has little to do with squares)
+                       // subdivide, diamond-square algorithm (really this has little to do with squares)
                        // diamond
                        for (y = 0;y < size;y += g2)
                                for (x = 0;x < size;x += g2)
@@ -72,11 +78,17 @@ void fractalnoisequick(qbyte *noise, int size, int startgrid)
 
        for (sizepower = 0;(1 << sizepower) < size;sizepower++);
        if (size != (1 << sizepower))
-               Sys_Error("fractalnoise: size must be power of 2\n");
+       {
+               Con_Printf("fractalnoise: size must be power of 2\n");
+               return;
+       }
 
        for (gridpower = 0;(1 << gridpower) < startgrid;gridpower++);
        if (startgrid != (1 << gridpower))
-               Sys_Error("fractalnoise: grid must be power of 2\n");
+       {
+               Con_Printf("fractalnoise: grid must be power of 2\n");
+               return;
+       }
 
        startgrid = bound(0, startgrid, size);
 
@@ -94,7 +106,7 @@ void fractalnoisequick(qbyte *noise, int size, int startgrid)
                g = g2 >> 1;
                if (g)
                {
-                       // subdivide, diamond-square algorythm (really this has little to do with squares)
+                       // subdivide, diamond-square algorithm (really this has little to do with squares)
                        // diamond
                        for (y = 0;y < size;y += g2)
                                for (x = 0;x < size;x += g2)