Example #1
0
        public static bool Merge(byte[] data, uint texSize, ImgTex texture, LandDefs.Rotation rot, TerrainTex terrainTex)
        {
            if (texture == null)
            {
                return(false);
            }

            var baseTexture = terrainTex.BaseTexture;

            if (baseTexture != null)
            {
                ImgTex.MergeTexture(data, texSize, texSize, baseTexture, terrainTex.TexTiling, texture, rot);
                return(true);
            }
            else if (terrainTex.InitEnd())
            {
                ImgTex.MergeTexture(data, texSize, texSize, terrainTex.BaseTexture, terrainTex.TexTiling, texture, rot);
                return(true);
            }
            return(false);
        }