Beispiel #1
0
        public void Read(CubReader br)
        {
            Params = br.ReadKnownObject <ParamList>();
            if (br.ReadObject() is List <object> partDatas)
            {
                Parts = new List <Part>(partDatas.Cast <Part>());
            }

            CanvasWidth  = br.ReadInt32();
            CanvasHeight = br.ReadInt32();
        }
 public sealed override void Read(CubReader br)
 {
     base.Read(br);
     Row    = br.ReadInt32();
     Column = br.ReadInt32();
     Pivots = br.ReadKnownObject <PivotList>();
     if (br.ReadObject() is List <object> list)
     {
         PivotPoints = new List <float[]>(list.Cast <float[]>());
     }
     base.ReadOpacity(br);
 }
Beispiel #3
0
        public sealed override void Read(CubReader br)
        {
            base.Read(br);
            TextureNo    = br.ReadInt32();
            PointCount   = br.ReadInt32();
            PolygonCount = br.ReadInt32();
            int[] array = (int[])br.ReadObject();
            IndexArray = new ushort[PolygonCount * 3];
            for (int i = PolygonCount * 3 - 1; i >= 0; i--)
            {
                IndexArray[i] = (ushort)array[i];
            }

            if (br.ReadObject() is List <object> list)
            {
                PivotPoints = new List <float[]>(list.Cast <float[]>());
            }

            UvMap = (float[])br.ReadObject();

            if (br.FormatVersion >= 8)
            {
                OptionFlag = br.ReadInt32();
                if (OptionFlag != 0)
                {
                    if ((OptionFlag & 1) != 0)
                    {
                        int num = br.ReadInt32();
                        ColorGroupNo = num;
                        OptionData.Add(L2Consts.BK_OPTION_COLOR, num);
                    }

                    ColorCompositionType = (OptionFlag & 30) != 0 ? (OptionFlag & 30) >> 1 : 0;

                    if ((OptionFlag & 32) != 0)
                    {
                        Culling = false;
                    }
                }
            }
            else
            {
                OptionFlag = 0;
            }
        }
Beispiel #4
0
        public virtual void Read(CubReader br)
        {
            ID               = br.ReadIdString();
            TargetID         = br.ReadIdString();
            Pivots           = br.ReadKnownObject <PivotList>();
            AverageDrawOrder = br.ReadInt32();
            PivotDrawOrder   = br.ReadIntArray();
            PivotOpacity     = br.ReadFloatArray();
            if (br.FormatVersion >= 11)
            {
                var drawDataId = br.ReadIdString();
                if (string.IsNullOrEmpty(drawDataId))
                {
                    ClipIDs = null;
                }
                else
                {
                    if (drawDataId.Contains(","))
                    {
                        ClipIDs = new List <string>(drawDataId.Split(new[] { "," },
                                                                     StringSplitOptions.RemoveEmptyEntries));
                    }
                    else
                    {
                        ClipIDs = new List <string> {
                            drawDataId
                        };
                    }
                }
            }
            else
            {
                ClipIDs = null;
            }

            var minPivot = PivotDrawOrder.Min();

            if (minPivot < TotalMinOrder)
            {
                TotalMinOrder = minPivot;
            }

            var maxPivot = PivotDrawOrder.Max();

            if (maxPivot > TotalMaxOrder)
            {
                TotalMaxOrder = maxPivot;
            }
        }