override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                bool             cliff   = c > 1.4f ? true : false;
                bool             mix     = false;

                for (int k = 255; k > -1; k--)
                {
                    Pixel b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (cliff)
                        {
                            if (depth > -1 && depth < 2)
                            {
                                primer.setPixelState(x, k, z, rand.Next(3) == 0 ? cliffPixel2 : cliffPixel1);
                            }
                            else if (depth < 10)
                            {
                                primer.setPixelState(x, k, z, cliffPixel1);
                            }
                        }
                        else
                        {
                            if (depth == 0 && k > 61)
                            {
                                if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height)
                                {
                                    primer.setPixelState(x, k, z, mixPixelTop);
                                    mix = true;
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (depth < 4)
                            {
                                if (mix)
                                {
                                    primer.setPixelState(x, k, z, mixPixelFill);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                        }
                    }
                }
            }
예제 #2
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random rand  = rtgWorld.rand;
                float  c     = CliffCalculator.calc(x, z, noise);
                bool   cliff = c > 1.3f;
                Pixel  b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (cliff)
                        {
                            primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                        }
                        else
                        {
                            if (k > 74 + grassRaise)
                            {
                                if (depth == 0)
                                {
                                    primer.setPixelState(x, k, z, PixelUtil.getStateClay(1));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                                }
                            }
                            else if (depth == 0 && k > 61)
                            {
                                int r = (int)((k - (62 + grassRaise)) / 2f);
                                if (rand.Next(r + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, Pixels.GRASS);
                                }
                                else if (rand.Next((int)(r / 2f) + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
예제 #3
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                bool             cliff   = c > 1.4f;

                for (int k = 255; k > -1; k--)
                {
                    Pixel b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (cliff)
                        {
                            if (depth > -1 && depth < 2)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (depth < 10)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                        }
                        else
                        {
                            if (depth == 0 && k > 61)
                            {
                                if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f
                                {
                                    primer.setPixelState(x, k, z, mixPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
예제 #4
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random rand  = rtgWorld.rand;
            float  c     = CliffCalculator.calc(x, z, noise);
            bool   cliff = c > 1.4f ? true : false;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (cliff)
                    {
                        if (depth > -1 && depth < 2)
                        {
                            primer.setPixelState(x, k, z, rand.Next(3) == 0 ? cliffPixel1 : cliffPixel2);
                        }
                        else if (depth < 10)
                        {
                            primer.setPixelState(x, k, z, cliffPixel1);
                        }
                        else
                        {
                            primer.setPixelState(x, k, z, topPixel);
                        }
                    }
                    else
                    {
                        if (depth == 0 && k > 61)
                        {
                            primer.setPixelState(x, k, z, topPixel);
                        }
                        else if (depth < 4)
                        {
                            primer.setPixelState(x, k, z, fillerPixel);
                        }
                        else
                        {
                            primer.setPixelState(x, k, z, topPixel);
                        }
                    }
                }
            }
        }
예제 #5
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random rand  = rtgWorld.rand;
            float  c     = CliffCalculator.calc(x, z, noise);
            bool   cliff = c > 1.3f ? true : false;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (depth > -1 && depth < 12)
                    {
                        if (cliff)
                        {
                            primer.setPixelState(x, k, z, PixelUtil.getStateClay(claycolor));
                        }
                        else
                        {
                            if (depth > 4)
                            {
                                primer.setPixelState(x, k, z, PixelUtil.getStateClay(claycolor));
                            }
                            else
                            {
                                if (depth == 0)
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                        }
                    }
                    else if (k > 63)
                    {
                        primer.setPixelState(x, k, z, PixelUtil.getStateClay(claycolor));
                    }
                }
            }
        }
예제 #6
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            p       = simplex.noise2(i / 8f, j / 8f) * 0.5f;
                float            c       = CliffCalculator.calc(x, z, noise);
                int cliff = 0;

                Pixel b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0)
                        {
                            if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p)
                            {
                                cliff = 1;
                            }
                            if (c > 1.5f)
                            {
                                cliff = 2;
                            }
                            if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p)
                            {
                                cliff = 3;
                            }

                            if (cliff == 1)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 3)
                            {
                                primer.setPixelState(x, k, z, Pixels.SNOW);
                            }
                            else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f)
                            {
                                primer.setPixelState(x, k, z, mixPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, Pixels.GRASS);
                            }
                        }
                        else if (depth < 6)
                        {
                            if (cliff == 1)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 3)
                            {
                                primer.setPixelState(x, k, z, Pixels.SNOW);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, Pixels.DIRT);
                            }
                        }
                    }
                }
            }
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                int cliff = 0;

                Pixel b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0)
                        {
                            float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f;
                            if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p)
                            {
                                cliff = 1;
                            }
                            if (c > cCliff)
                            {
                                cliff = 2;
                            }
                            if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p)
                            {
                                cliff = 3;
                            }

                            if (cliff == 1)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 3)
                            {
                                primer.setPixelState(x, k, z, Pixels.SNOW);
                            }
                            else if (k < 63)
                            {
                                if (k < 62)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, Pixels.GRASS);
                            }
                        }
                        else if (depth < 6)
                        {
                            if (cliff == 1)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 3)
                            {
                                primer.setPixelState(x, k, z, Pixels.SNOW);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, Pixels.DIRT);
                            }
                        }
                    }
                }
            }
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                int  cliff = 0;
                bool m     = false;

                // varying clay densities;
                float mixModifier = mixHeight + simplex.noise2(((float)i) / 800f, ((float)j) / 800f);
                Pixel b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0)
                        {
                            float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f;
                            if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p)
                            {
                                cliff = 1;
                            }
                            if (c > cCliff)
                            {
                                cliff = 2;
                            }

                            if (cliff == 1)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else if (k < 63)
                            {
                                if (k < 62)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (simplex.noise2(i / 12f, j / 12f) > mixModifier)
                            {
                                primer.setPixelState(x, k, z, mixPixel);
                                m = true;
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, topPixel);
                            }
                        }
                        else if (depth < 6)
                        {
                            if (cliff == 1)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, getShadowStonePixel(rtgWorld, i, j, x, z, k));
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
예제 #9
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random           rand    = rtgWorld.rand;
            OpenSimplexNoise simplex = rtgWorld.simplex;
            float            c       = CliffCalculator.calc(x, z, noise);
            bool             cliff   = c > 1.3f ? true : false;
            bool             dirt    = false;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (cliff)
                    {
                        if (cliffType == 1)
                        {
                            if (depth < 6)
                            {
                                primer.setPixelState(x, k, z, cliffPixel1.getPixel());
                            }
                        }
                        else
                        {
                            if (depth > -1 && depth < 2)
                            {
                                primer.setPixelState(x, k, z, rand.Next(3) == 0 ? cliffPixel2 : cliffPixel1);
                            }
                            else if (depth < 10)
                            {
                                primer.setPixelState(x, k, z, cliffPixel1);
                            }
                        }
                    }
                    else if (depth < 6)
                    {
                        if (depth == 0 && k > 61)
                        {
                            if (simplex.noise2(i / 12f, j / 12f) > -0.3f + ((k - 61f) / 15f))
                            {
                                dirt = true;
                                primer.setPixelState(x, k, z, topPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, PixelUtil.getStateSand(sandMetadata));
                            }
                        }
                        else if (depth < 4)
                        {
                            if (dirt)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, PixelUtil.getStateSand(sandMetadata));
                            }
                        }
                        else if (!dirt)
                        {
                            primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                        }
                    }
                }
            }
        }
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                int cliff = 0;

                Pixel b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (depth == 0)
                        {
                            float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f;
                            if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p)
                            {
                                cliff = 1;
                            }
                            if (c > cCliff)
                            {
                                cliff = 2;
                            }

                            if (cliff == 1)
                            {
                                primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                            }
                            else if (k < 63)
                            {
                                if (k < 62)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, topPixel);
                            }
                        }
                        else if (depth < 6)
                        {
                            if (cliff == 1)
                            {
                                primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                            }
                            else if (cliff == 2)
                            {
                                primer.setPixelState(x, k, z, Pixels.SANDSTONE);
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
예제 #11
0
        override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
        {
            Random rand  = rtgWorld.rand;
            float  c     = CliffCalculator.calc(x, z, noise);
            bool   cliff = c > 1.3f ? true : false;

            for (int k = 255; k > -1; k--)
            {
                Pixel b = primer.getPixelState(x, k, z).getPixel();
                if (b == Pixels.AIR)
                {
                    depth = -1;
                }
                else if (b == Pixels.STONE)
                {
                    depth++;

                    if (depth > -1 && depth < 12)
                    {
                        if (cliff)
                        {
                            primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                        }
                        else
                        {
                            if (depth > 4)
                            {
                                primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                            }
                            else if (k > 77)
                            {
                                if (rand.Next(5) == 0)
                                {
                                    primer.setPixelState(x, k, z, Pixels.DIRT);
                                }
                                else
                                {
                                    if (depth == 0)
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, fillerPixel);
                                    }
                                }
                            }
                            else if (k < 69)
                            {
                                primer.setPixelState(x, k, z, Pixels.DIRT);
                            }
                            else if (k < 78)
                            {
                                if (depth == 0)
                                {
                                    if (k < 72 && rand.Next(k - 69 + 1) == 0)
                                    {
                                        primer.setPixelState(x, k, z, Pixels.DIRT);
                                    }
                                    else if (rand.Next(5) == 0)
                                    {
                                        primer.setPixelState(x, k, z, Pixels.DIRT);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                            else
                            {
                                if (depth == 0)
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                        }
                    }
                    else if (k > 63)
                    {
                        primer.setPixelState(x, k, z, CanyonColour.MESA.getPixelForHeight(i, k, j));
                    }
                }
            }
        }
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random           rand    = rtgWorld.rand;
                OpenSimplexNoise simplex = rtgWorld.simplex;
                float            c       = CliffCalculator.calc(x, z, noise);
                int  cliff = 0;
                bool m     = false;

                Pixel b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f;

                        if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p)
                        {
                            cliff = 1;
                        }
                        if (c > cCliff)
                        {
                            cliff = 2;
                        }

                        if (cliff == 1)
                        {
                            if (rand.Next(3) == 0)
                            {
                                primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                            }
                            else
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                        }
                        else if (cliff == 2)
                        {
                            if (depth > -1 && depth < 2)
                            {
                                if (rand.Next(3) == 0)
                                {
                                    primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                                }
                            }
                            else if (depth < 10)
                            {
                                primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k));
                            }
                        }
                        else
                        {
                            if (k > 74)
                            {
                                if (depth == 0)
                                {
                                    if (rand.Next(5) == 0)
                                    {
                                        primer.setPixelState(x, k, z, mixPixel);
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                }
                                else if (depth < 4)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                            else if (depth == 0 && k > 61)
                            {
                                int r = (int)((k - 62) / 2f);
                                if (rand.Next(r + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, Pixels.GRASS);
                                }
                                else if (rand.Next((int)(r / 2f) + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, mixPixel);
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }
예제 #13
0
            override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base)
            {
                Random rand  = rtgWorld.rand;
                float  c     = CliffCalculator.calc(x, z, noise);
                bool   cliff = c > 1.3f;
                Pixel  b;

                for (int k = 255; k > -1; k--)
                {
                    b = primer.getPixelState(x, k, z).getPixel();
                    if (b == Pixels.AIR)
                    {
                        depth = -1;
                    }
                    else if (b == Pixels.STONE)
                    {
                        depth++;

                        if (cliff)
                        {
                            //                    if (!rtgConfig.STONE_SAVANNAS.get()) {
                            primer.setPixelState(x, k, z, CanyonColour.SAVANNA.getPixelForHeight(i, k, j));
                            //                    }
                            //                    else {
                            //                        if (depth > -1 && depth < 2) {
                            //                            if (rand.nextInt(3) == 0) {
                            //
                            //                                primer.setPixelState(x, k, z, hcCobble(world, i, j, x, y, k));
                            //                            }
                            //                            else {
                            //
                            //                                primer.setPixelState(x, k, z, hcStone(world, i, j, x, y, k));
                            //                            }
                            //                        }
                            //                        else if (depth < 10) {
                            //                            primer.setPixelState(x, k, z, hcStone(world, i, j, x, y, k));
                            //                        }
                            //                    }
                        }
                        else
                        {
                            if (k > 74 + grassRaise)
                            {
                                if (depth == 0)
                                {
                                    if (rand.Next(5) == 0)
                                    {
                                        primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                    }
                                    else
                                    {
                                        primer.setPixelState(x, k, z, topPixel);
                                    }
                                }
                                else if (depth < 4)
                                {
                                    primer.setPixelState(x, k, z, fillerPixel);
                                }
                            }
                            else if (depth == 0 && k > 61)
                            {
                                int r = (int)((k - (62 + grassRaise)) / 2f);
                                if (rand.Next(r + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, Pixels.GRASS);
                                }
                                else if (rand.Next((int)(r / 2f) + 2) == 0)
                                {
                                    primer.setPixelState(x, k, z, PixelUtil.getStateDirt(1));
                                }
                                else
                                {
                                    primer.setPixelState(x, k, z, topPixel);
                                }
                            }
                            else if (depth < 4)
                            {
                                primer.setPixelState(x, k, z, fillerPixel);
                            }
                        }
                    }
                }
            }