예제 #1
0
 public CParticleEmitter(CR2WFile cr2w) : base(cr2w)
 {
     Emitters = new CArray("array:2,0,ptr:CParticleEmitter", "CParticleEmitter", true, cr2w)
     {
         Name = "Emitters"
     };
 }
예제 #2
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);
            CDynamicInt count = new CDynamicInt(cr2w);

            count.Read(file, 1);
            for (int j = 0; j < count.val; j++)
            {
                CArray  currenttreebundle = new CArray(cr2w);
                CHandle treetype          = new CHandle(cr2w);
                treetype.Read(file, 4);
                currenttreebundle.Name = treetype.Handle;
                CArray currentTrees = new CArray(cr2w);
                currentTrees.AddVariable(treetype);
                CDynamicInt treecount = new CDynamicInt(cr2w);
                treecount.Read(file, 1);
                for (int i = 0; i < treecount.val; i++)
                {
                    CTree tree = new CTree(cr2w);
                    tree.Read(file, 29);
                    currentTrees.AddVariable(tree);
                }
                currenttreebundle.AddVariable(currentTrees);
                Trees.AddVariable(currenttreebundle);
            }
            file.BaseStream.Seek(1, SeekOrigin.Current);
        }
예제 #3
0
 public CPhysicsDestructionResource(CR2WFile cr2w) :
     base(cr2w)
 {
     block5 = new CArray("[]SMeshBlock5", "SMeshBlock5", true, cr2w)
     {
         Name = "block5"
     };
 }
예제 #4
0
 public CMaterialGraph(CR2WFile cr2w) :
     base(cr2w)
 {
     pixelParameters       = new CArray("array:0,0,CMaterialGraphParameter", "CMaterialGraphParameter", true, cr2w);
     pixelParameters.Name  = "pixelParameters";
     vertexParameters      = new CArray("array:0,0,CMaterialGraphParameter", "CMaterialGraphParameter", true, cr2w);
     vertexParameters.Name = "vertexParameters";
 }
예제 #5
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);

            // get bonecount for compressed buffers
            CArray bones     = variables.FirstOrDefault(_ => _.Name == "bones") as CArray;
            int    bonecount = bones.array.Count;

            rigdata.Read(file, (uint)bonecount * 48, bonecount);
        }
예제 #6
0
 public CFoliageResource(CR2WFile cr2w) : base(cr2w)
 {
     Trees = new CArray(cr2w)
     {
         Name = "Trees"
     };
     Grasses = new CArray(cr2w)
     {
         Name = "Grasses"
     };
 }
예제 #7
0
        public CEntity(CR2WFile cr2w) :
            base(cr2w)
        {
            unk1      = new CUInt32(cr2w);
            unk1.Name = "unk1";
            unk2      = new CUInt32(cr2w);
            unk2.Name = "unk2";

            components      = new CArray("[]handle:Component", "handle:Component", true, cr2w);
            components.Name = "components";
        }
예제 #8
0
 public CNode(CR2WFile cr2w) :
     base(cr2w)
 {
     attachmentsReference = new CArray("[]handle:attachment", "handle:attachment", true, cr2w)
     {
         Name = "attachments reference",
     };
     attachmentsChild = new CArray("[]handle:attachment", "handle:attachment", true, cr2w)
     {
         Name = "child attachments"
     };
 }
예제 #9
0
 public CEntity(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name)
 {
     Components = new CArray <CPtr <CComponent> >(cr2w, this, nameof(Components))
     {
         IsSerialized = true, Elementtype = "ptr:CComponent"
     };
     BufferV1 = new CCompressedBuffer <SEntityBufferType1>(cr2w, this, nameof(BufferV1))
     {
         IsSerialized = true
     };
     BufferV2 = new CBufferUInt32 <SEntityBufferType2>(cr2w, this, nameof(BufferV2))
     {
         IsSerialized = true
     };
 }
예제 #10
0
        public CEntity(CR2WFile cr2w) : base(cr2w)
        {
            components = new CArray("[]handle:Component", "handle:Component", true, cr2w)
            {
                Name = "components"
            };

            buffer_v1 = new CVector(cr2w)
            {
                Name = "Buffer_v1"
            };
            buffer_v2 = new CBufferUInt32 <CEntityBufferType2>(cr2w, _ => new CEntityBufferType2(_))
            {
                Name = "Buffer_v2"
            };
        }
예제 #11
0
 public CLayerGroup(CR2WFile cr2w) : base(cr2w)
 {
     World = new CHandle(cr2w)
     {
         Name = "WorldParent"
     };
     LayergroupParent = new CHandle(cr2w)
     {
         Name = "LayergroupParent"
     };
     NumGroups      = new CDynamicInt(cr2w);
     ChildrenGroups = new CArray(cr2w)
     {
         Name = "ChildrenGroups"
     };
     NumInfos      = new CDynamicInt(cr2w);
     ChildrenInfos = new CArray(cr2w)
     {
         Name = "ChildrenInfos"
     };
 }
예제 #12
0
 public CParticleSystem(CR2WFile cr2w) : base(cr2w)
 {
     lods = new CArray("array:0,0,SParticleSystemLODLevel", "SParticleSystemLODLevel", true, cr2w)
     {
         Name = "lods", Type = "CArray"
     };
     emitters = new CArray("array:0,0,ptr:CParticleEmitter", "CParticleEmitter", true, cr2w)
     {
         Name = "emitters", Type = "CArray"
     };
     autoHideDistance = new CFloat(cr2w)
     {
         Name = "autoHideDistance", Type = "CFloat"
     };
     autoHideRange = new CFloat(cr2w)
     {
         Name = "autoHideRange", Type = "CFloat"
     };
     previewBackgroundColor = new CColor(cr2w)
     {
         Name = "previewBackgroundColor", Type = "Color"
     };
     previewShowGrid = new CBool(cr2w)
     {
         Name = "previewShowGrid", Type = "CBool"
     };
     visibleThroughWalls = new CBool(cr2w)
     {
         Name = "visibleThroughWalls", Type = "CBool"
     };
     prewarmingTime = new CFloat(cr2w)
     {
         Name = "prewarmingTime", Type = "CFloat"
     };
     renderingPlane = new CName(cr2w)
     {
         Name = "renderingPlane", Type = "CName"
     };
 }
예제 #13
0
 public CFont(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name)
 {
     Unicodemapping = new CArray <CUInt16>(cr2w, this, nameof(Unicodemapping))
     {
         IsSerialized = true, Elementtype = "Uint16"
     };
     Linedist = new CInt32(cr2w, this, nameof(Linedist))
     {
         IsSerialized = true
     };
     Maxglyphheight = new CInt32(cr2w, this, nameof(Maxglyphheight))
     {
         IsSerialized = true
     };
     Kerning = new CBool(cr2w, this, nameof(Kerning))
     {
         IsSerialized = true
     };
     Glyphs = new CArray <CArray <CFloat> >(cr2w, this, nameof(Glyphs))
     {
         IsSerialized = true, Elementtype = "array:2,0,Float"
     };
 }
예제 #14
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);
            var count = file.ReadVLQInt32();

            //For each of the treetypes
            for (int j = 0; j < count; j++)
            {
                CArray CTreeCollection = new CArray(cr2w);
                //Read the handle of the trees we are currently reading
                CHandle treetype = new CHandle(cr2w);
                treetype.Read(file, size);
                treetype.Name = "Type";
                CTreeCollection.AddVariable(treetype);
                //Read the number of trees in this treetype
                var treecount = file.ReadVLQInt32();
                //For each of the trees in the treetype
                for (int i = 0; i < treecount; i++)
                {
                    SFoliageInstance tree = new SFoliageInstance(cr2w)
                    {
                        Name = "Details"
                    };
                    tree.Read(file, size);
                    //Add the tree entry to its handle holder
                    CTreeCollection.AddVariable(tree);
                    tree.Name = i.ToString();
                }
                //Add the handle and the tree subvars into the Trees CArray
                Trees.AddVariable(CTreeCollection);
            }
            //Read Grasses!
            count = file.ReadVLQInt32();
            if (count > 0)
            {
                for (int j = 0; j < count; j++)
                {
                    CArray GrassCollection = new CArray(cr2w);
                    //Read the handle of the Grasses we are currently reading
                    CHandle treetype = new CHandle(cr2w);
                    treetype.Read(file, size);
                    treetype.Name = "Type";
                    GrassCollection.AddVariable(treetype);
                    //Read the number of Grasses in this treetype
                    var treecount = file.ReadVLQInt32();
                    //For each of the Grasses in the treetype
                    for (int i = 0; i < treecount; i++)
                    {
                        SFoliageInstance grass = new SFoliageInstance(cr2w)
                        {
                            Name = "Details"
                        };
                        grass.Read(file, size);
                        //Add the grass entry to its handle holder
                        GrassCollection.AddVariable(grass);
                        grass.Name = i.ToString();
                    }
                    //Add the handle and the grass subvars into the grasses CArray
                    Grasses.AddVariable(GrassCollection);
                }
            }
            else
            {
                return;
            }
        }
예제 #15
0
 public CFoliageResource(CR2WFile cr2w) : base(cr2w)
 {
     Trees      = new CArray("CTrees", cr2w);
     Trees.Name = "Trees";
 }
예제 #16
0
 public CMeshComponent(CR2WFile cr2w) :
     base(cr2w)
 {
     attachments      = new CArray("[]handle:attachment", "handle:attachment", true, cr2w);
     attachments.Name = "attachments";
 }
예제 #17
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);

            var cnt = file.ReadVLQInt32();

            for (int i = 0; i < cnt; i++)
            {
                //This is actually a byte-byte pair but no idea why or how anyone would edit this
                var mapping = new CUInt16(cr2w, Unicodemapping, "");
                mapping.Read(file, size);
                Unicodemapping.AddVariable(mapping);
            }
            Linedist.Read(file, size);
            Maxglyphheight.Read(file, size);
            Kerning.Read(file, size);

            var num = file.ReadVLQInt32();

            for (int i = 0; i < num; i++)
            {
                var glyph = new CArray <CFloat>(cr2w, Glyphs, "Glyph - " + i)
                {
                    Elementtype = "Float"
                };
                // UVs
                CFloat uv00 = new CFloat(cr2w, glyph, "UV[0][0]");
                uv00.Read(file, size);
                glyph.AddVariable(uv00);
                CFloat uv01 = new CFloat(cr2w, glyph, "UV[0][1]");
                uv01.Read(file, size);
                glyph.AddVariable(uv01);
                CFloat uv10 = new CFloat(cr2w, glyph, "UV[1][0]");
                uv10.Read(file, size);
                glyph.AddVariable(uv10);
                CFloat uv11 = new CFloat(cr2w, glyph, "UV[1][1]");
                uv11.Read(file, size);
                glyph.AddVariable(uv11);

                CInt32 textureindex = new CInt32(cr2w, glyph, "Texture index");
                textureindex.Read(file, size);
                glyph.AddVariable(textureindex);
                CInt32 width = new CInt32(cr2w, glyph, "Width");
                width.Read(file, size);
                glyph.AddVariable(width);
                CInt32 height = new CInt32(cr2w, glyph, "Height");
                height.Read(file, size);
                glyph.AddVariable(height);
                CInt32 advance_x = new CInt32(cr2w, glyph, "Advance X");
                advance_x.Read(file, size);
                glyph.AddVariable(advance_x);
                CInt32 bearing_x = new CInt32(cr2w, glyph, "Bearing X");
                bearing_x.Read(file, size);
                glyph.AddVariable(bearing_x);
                CInt32 bearing_y = new CInt32(cr2w, glyph, "Bearing Y");
                bearing_y.Read(file, size);
                glyph.AddVariable(bearing_y);

                Glyphs.AddVariable(glyph);
            }
        }