コード例 #1
0
        /// <summary>
        /// The serialise.
        /// </summary>
        /// <param name="serialise">
        /// The serialise.
        /// </param>
        /// <exception cref="Exception">
        /// </exception>
        public override void Serialise(IwSerialise serialise)
        {
            base.Serialise(serialise);

            uint resCount = 0;

            serialise.UInt32(ref resCount);

            bool unknown0 = false;

            serialise.Bool(ref unknown0);
            bool unknown1 = true;

            serialise.Bool(ref unknown1);

            while (resCount > 0)
            {
                var  pos    = serialise.Position;
                uint length = 0;
                serialise.UInt32(ref length);

                CIwManaged res = null;
                serialise.ManagedObject(this.Hash, ref res);
                this.resources.Add((CIwResource)res, false);
                --resCount;

                if (serialise.Position != pos + length)
                {
                    throw new Exception(
                              string.Format(
                                  "Parse of {0} failed: wrong position by {1} bytes", res.GetType().Name, serialise.Position - (pos + length)));
                    serialise.Position = pos + length;
                }
            }
        }
コード例 #2
0
        public void Bone()
        {
            var        s   = IwSerialise.Open("TestData\\managedobject_bone.bin", true, this.container.Resolve <ClassRegistry>(), null);
            CIwManaged obj = null;

            s.ManagedObject(ref obj);
            s.Close();
            Assert.IsTrue(obj is CIwAnimBone);
            Assert.AreEqual(obj.Hash, "bonename".ToeHash());
        }
コード例 #3
0
ファイル: CIwManagedList.cs プロジェクト: gamemaster101gr/toe
 /// <summary>
 /// The serialise.
 /// </summary>
 /// <param name="serialise">
 /// The serialise.
 /// </param>
 public void Serialise(IwSerialise serialise)
 {
     this.array.SerialiseHeader(serialise);
     for (uint i = 0; i < this.array.Size; ++i)
     {
         CIwManaged m = this.array[(int)i];
         serialise.ManagedObject(ref m);
         this.array[(int)i] = m;
     }
 }
コード例 #4
0
        /// <summary>
        /// The serialise.
        /// </summary>
        /// <param name="serialise">
        /// The serialise.
        /// </param>
        public override void Serialise(IwSerialise serialise)
        {
            base.Serialise(serialise);
            {
                uint val = 0x00020000;
                serialise.UInt32(ref val);
            }
            {
                ushort val = 4;
                serialise.UInt16(ref val);
            }
            {
                ushort val = 4;
                serialise.UInt16(ref val);
            }

            this.sphere.Serialise(serialise);
            this.list.Serialise(serialise);
            this.ext.Serialise(serialise);

            if (serialise.IsReading())
            {
                uint numMaterials = 0;
                serialise.UInt32(ref numMaterials);
                this.materials = new CIwMaterial[numMaterials];
                for (int i = 0; i < this.materials.Length; ++i)
                {
                    CIwManaged m = null;
                    serialise.ManagedHash("CIwMaterial".ToeHash(), ref m);
                    this.materials[i] = (CIwMaterial)m;
                }
            }
            else
            {
                uint numMaterials = (uint)this.materials.Length;
                serialise.UInt32(ref numMaterials);
                for (int i = 0; i < this.materials.Length; ++i)
                {
                    CIwManaged m = this.materials[i];
                    serialise.ManagedHash("CIwMaterial".ToeHash(), ref m);
                }
            }
        }
コード例 #5
0
ファイル: CIwMaterial.cs プロジェクト: gamemaster101gr/toe
        /// <summary>
        /// The serialise.
        /// </summary>
        /// <param name="serialise">
        /// The serialise.
        /// </param>
        public override void Serialise(IwSerialise serialise)
        {
            base.Serialise(serialise);

            bool someFlag = false;

            serialise.Bool(ref someFlag);
            {
                serialise.UInt32(ref this.flags);
            }

            if (!someFlag)
            {
                {
                    serialise.Int16(ref this.zDepthOfs);
                }
                {
                    serialise.Int16(ref this.zDepthOfsHW);
                }
                {
                    serialise.Colour(ref this.colEmissive);
                }
                {
                    serialise.Colour(ref this.colAmbient);
                }
                {
                    serialise.Colour(ref this.colDiffuse);
                }
                {
                    serialise.Colour(ref this.colSpecular);
                }
                {
                    uint val = 4;
                    serialise.UInt32(ref val);
                }
            }
            {
                // Texture is always presented
                CIwManaged t = this.texture0;
                serialise.ManagedHash("CIwTexture".ToeHash(), ref t);
                this.texture0 = (CIwTexture)t;
            }

            if (!someFlag)
            {
                CIwManaged t = this.texture1;
                serialise.ManagedHash("CIwTexture".ToeHash(), ref t);
                this.texture1 = (CIwTexture)t;
                {
                    CIwManaged val = null;
                    serialise.ManagedHash("?".ToeHash(), ref val);
                }
                {
                    CIwManaged val = null;
                    serialise.ManagedHash("?".ToeHash(), ref val);
                }

                byte isAnimated = 0;
                serialise.UInt8(ref isAnimated);
                if (isAnimated != 0)
                {
                    {
                        byte value = 0;
                        serialise.UInt8(ref value);
                    }

                    serialise.UInt8(ref this.celNum);
                    serialise.UInt8(ref this.celNumU);
                    serialise.UInt8(ref this.celW);
                    serialise.UInt8(ref this.celH);
                    serialise.UInt8(ref this.celPeriod);
                }

                serialise.UInt8(ref this.alphaTestValue);
                {
                    CIwManaged val = null;
                    serialise.ManagedHash("?".ToeHash(), ref val);
                }
            }
        }
コード例 #6
0
		public virtual void ParseCloseChild(CIwTextParserITX pParser, CIwManaged pChild) 
		{
		}