Ejemplo n.º 1
0
 public abstract object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context);
Ejemplo n.º 2
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            // TODO: Create ModelMesh object here.
            var w3xMesh = W3xMesh.Parse(reader, imports, asset.Header);

            return(null);
        }
Ejemplo n.º 3
0
 public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
 {
     return(AudioFile.ParseAsset(reader, asset));
 }
Ejemplo n.º 4
0
 public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
 {
     return(DialogEvent.ParseAsset(reader, asset, imports));
 }
Ejemplo n.º 5
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            var w3xMesh = W3xMesh.Parse(reader, imports, asset.Header);

            return(new ModelMesh(w3xMesh, asset, context.AssetStore.LoadContext));
        }
Ejemplo n.º 6
0
 public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
 {
     return(CrowdResponse.ParseAsset(reader, asset, imports));
 }
Ejemplo n.º 7
0
 public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
 {
     return(W3xBox.Parse(reader));
 }
Ejemplo n.º 8
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            var twelve = reader.ReadUInt32();

            if (twelve != 12)
            {
                throw new InvalidDataException();
            }

            reader.ReadUInt32(); // Length

            var ddsFile = DdsFile.FromStream(reader.BaseStream);

            var result = context.GraphicsDevice.CreateStaticTexture2D(
                ddsFile.Header.Width,
                ddsFile.Header.Height,
                ddsFile.ArraySize,
                ddsFile.MipMaps,
                ddsFile.PixelFormat,
                ddsFile.Dimension == DdsTextureDimension.TextureCube);

            result.Name = asset.Name;

            return(new Graphics.TextureAsset(result, asset));
        }
Ejemplo n.º 9
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            var w3xHierarchy = W3xHierarchy.Parse(reader, asset.Header);

            var bones = new ModelBone[w3xHierarchy.Pivots.Length];

            for (var i = 0; i < w3xHierarchy.Pivots.Length; i++)
            {
                var w3xPivot = w3xHierarchy.Pivots[i];

                bones[i] = new ModelBone(
                    i,
                    w3xPivot.Name,
                    w3xPivot.ParentIdx != -1
                        ? bones[w3xPivot.ParentIdx]
                        : null,
                    w3xPivot.Translation,
                    w3xPivot.Rotation);
            }

            return(new ModelBoneHierarchy(asset, bones));
        }
Ejemplo n.º 10
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            return(W3xMesh.Parse(reader, imports, asset.Header));

            //var effectName = shaderName.Replace(".fx", string.Empty);

            //var effect = context.EffectLibrary.GetEffect(
            //    shaderName,
            //    vertexDescriptors);

            //// TODO: Extract state properties from shader material.
            //var rasterizerState = RasterizerStateDescriptionUtility.DefaultFrontIsCounterClockwise;
            //var depthState = DepthStencilStateDescription.DepthOnlyLessEqual;
            //var blendState = BlendStateDescription.SingleDisabled;

            //var material = new ShaderMaterial(context.EffectLibrary, effect)
            //{
            //    PipelineState = new EffectPipelineState(
            //        rasterizerState,
            //        depthState,
            //        blendState,
            //        RenderPipeline.GameOutputDescription)
            //};


            //var materialPasses = new ModelMeshMaterialPass[1];
            //materialPasses[0] = new ModelMeshMaterialPass(
            //    context.GraphicsDevice,
            //    null,
            //    new ModelMeshPart[]
            //    {
            //        new ModelMeshPart(0, (uint) indices.Length, material)
            //    });

            //return new ModelMesh(
            //    context.GraphicsDevice,
            //    asset.Name,
            //    vertexData,
            //    indices,
            //    effect,
            //    materialPasses,
            //    false, // isSkinned,
            //    null, // parentBone,
            //    0, // numBones,
            //    boundingBox,
            //    hidden,
            //    geometryType == MeshGeometryType.CameraOriented);
        }
Ejemplo n.º 11
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            var box = W3xBox.Parse(reader);

            return(null); // TODO
        }
Ejemplo n.º 12
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            var hierarchy  = imports.GetImportedData <ModelBoneHierarchy>(reader);
            var subObjects = reader.ReadArrayAtOffset(() => W3xSubObject.Parse(reader, imports));

            var modelSubObjects = new ModelSubObject[subObjects.Length];

            for (var i = 0; i < subObjects.Length; i++)
            {
                var subObject = subObjects[i];
                modelSubObjects[i] = new ModelSubObject(
                    subObject.Name,
                    hierarchy.Bones[subObject.BoneIndex],
                    subObject.RenderObject);
            }

            return(new Model(asset, hierarchy, modelSubObjects));
        }
Ejemplo n.º 13
0
        public override object Parse(Asset asset, BinaryReader reader, AssetImportCollection imports, AssetParseContext context)
        {
            var result = AudioSettings.ParseAsset(reader, asset);

            context.AssetStore.AudioSettings.Current = result;

            return(result);
        }