示例#1
0
        public static bool AreEqualByContent(TextureBuilder x, TextureBuilder y)
        {
            if (x == null || y == null)
            {
                return(true);
            }

            if ((x, y).AreSameReference(out bool areTheSame))
            {
                return(areTheSame);
            }

            if (!BaseBuilder.AreEqualByContent(x, y))
            {
                return(false);
            }

            if (x.CoordinateSet != y.CoordinateSet)
            {
                return(false);
            }

            if (x.MinFilter != y.MinFilter)
            {
                return(false);
            }
            if (x.MagFilter != y.MagFilter)
            {
                return(false);
            }
            if (x.WrapS != y.WrapS)
            {
                return(false);
            }
            if (x.WrapT != y.WrapT)
            {
                return(false);
            }

            if (!ImageBuilder.AreEqualByContent(x._PrimaryImageContent, y._PrimaryImageContent))
            {
                return(false);
            }
            if (!ImageBuilder.AreEqualByContent(x._FallbackImageContent, y._FallbackImageContent))
            {
                return(false);
            }

            if (!TextureTransformBuilder.AreEqualByContent(x._Transform, y._Transform))
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        public static int GetContentHashCode(ImageBuilder x)
        {
            if (x == null)
            {
                return(0);
            }

            var h = BaseBuilder.GetContentHashCode(x);

            h ^= x.Content.GetHashCode();

            return(h);
        }
示例#3
0
        public static bool AreEqualByContent(ImageBuilder x, ImageBuilder y)
        {
            if ((x, y).AreSameReference(out bool areTheSame))
            {
                return(areTheSame);
            }

            if (!BaseBuilder.AreEqualByContent(x, y))
            {
                return(false);
            }

            if (!IMAGEFILE.AreEqual(x.Content, y.Content))
            {
                return(false);
            }

            return(true);
        }
示例#4
0
        public static int GetContentHashCode(TextureBuilder x)
        {
            if (x == null)
            {
                return(0);
            }

            var h = BaseBuilder.GetContentHashCode(x);

            h ^= x.CoordinateSet.GetHashCode();
            h ^= x.MinFilter.GetHashCode();
            h ^= x.MagFilter.GetHashCode();
            h ^= x.WrapS.GetHashCode();
            h ^= x.WrapT.GetHashCode();

            h ^= ImageBuilder.GetContentHashCode(x._PrimaryImageContent);
            h ^= ImageBuilder.GetContentHashCode(x._FallbackImageContent);

            return(h);
        }
示例#5
0
 private ImageBuilder(ImageBuilder other)
     : base(other)
 {
     this.Content = other.Content;
 }
示例#6
0
 public static bool IsValid(ImageBuilder ib)
 {
     return(ib != null && ib.Content.IsValid);
 }