示例#1
0
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public override void Write(ISavableWriter output)
 {
     output.WriteEnum <TextureAddressMode>("AddressU", _impl.AddressU);
     output.WriteEnum <TextureAddressMode>("AddressV", _impl.AddressV);
     output.WriteEnum <TextureAddressMode>("AddressW", _impl.AddressW);
     output.WriteEnum <TextureFilter>("Filter", _impl.Filter);
     output.Write("MipMapLevelOfDetailBias", _impl.MipMapLevelOfDetailBias);
     output.Write("MaxAnisotropy", _impl.MaxAnisotropy);
 }
示例#2
0
 /// <summary>
 /// Serializes this SceneHints.
 /// </summary>
 /// <param name="output">Output to be written to</param>
 public void Write(ISavableWriter output)
 {
     output.WriteEnum <CullHint>("CullHint", _cullHint);
     output.WriteEnum <PickingHint>("PickingHint", _pickHint);
     output.WriteEnum <LightCombineHint>("LightCombineHint", _lightHint);
     output.WriteEnum <TransparencyType>("TransparencyType", _transHint);
     output.WriteEnum <RenderBucketType>("RenderBucketType", _bucketType);
     output.Write("OrthoOrder", _orthoOrder);
 }
示例#3
0
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public override void Write(ISavableWriter output)
 {
     output.WriteEnum <CullMode>("Cull", _impl.Cull);
     output.WriteEnum <VertexWinding>("VertexWinding", _impl.VertexWinding);
     output.WriteEnum <FillMode>("Fill", _impl.Fill);
     output.Write("DepthBias", _impl.DepthBias);
     output.Write("SlopeScaledDepthBias", _impl.SlopeScaledDepthBias);
     output.Write("EnableMultiSampleAntiAlias", _impl.EnableMultiSampleAntiAlias);
     output.Write("EnableScissorTest", _impl.EnableScissorTest);
 }
示例#4
0
        /// <summary>
        /// Serializes the object and writes it to the output.
        /// </summary>
        /// <param name="output">Savable Output</param>
        public void Write(ISavableWriter output)
        {
            output.Write("Name", base.Name);
            output.Write("IndexCount", _impl.IndexCount);
            output.WriteEnum <IndexFormat>("IndexFormat", _impl.IndexFormat);
            output.WriteEnum <ResourceUsage>("BufferUsage", _impl.BufferUsage);
            int formatBytes = (_impl.IndexFormat == IndexFormat.ThirtyTwoBits) ? 4 : 2;

            byte[] byteBuffer = new byte[_impl.IndexCount * formatBytes];
            output.Write("IndexData", byteBuffer);
        }
示例#5
0
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public void Write(ISavableWriter output)
 {
     output.Write("VertexStride", _vertexStride);
     output.Write("ElementCount", _elements.Length);
     for (int i = 0; i < _elements.Length; i++)
     {
         VertexElement element = _elements[i];
         output.WriteEnum <VertexSemantic>("SemanticName", element.SemanticName);
         output.Write("SemanticIndex", element.SemanticIndex);
         output.WriteEnum <VertexFormat>("Format", element.Format);
         output.Write("Offset", element.Offset);
     }
 }
示例#6
0
        /// <summary>
        /// Serializes the object and writes it to the output.
        /// </summary>
        /// <param name="output">Savable Output</param>
        public override void Write(ISavableWriter output)
        {
            SurfaceFormat format   = _impl.Format;
            int           width    = _impl.Width;
            int           height   = _impl.Height;
            int           depth    = _impl.Depth;
            int           mipCount = _impl.MipCount;

            output.Write("Name", _impl.Name);
            output.WriteEnum <SurfaceFormat>("Format", format);
            output.Write("Width", width);
            output.Write("Height", height);
            output.Write("Depth", depth);
            output.Write("MipCount", mipCount);

            int width2  = width;
            int height2 = height;
            int depth2  = depth;

            for (int i = 0; i < mipCount; i++)
            {
                byte[] byteBuffer = new byte[MemoryHelper.CalculateMipSize(width, height, depth, i, format)];
                _impl.GetData <byte>(byteBuffer, i, 0, width2, 0, height2, 0, depth2, 0, byteBuffer.Length);
                width2  = System.Math.Max(width2 >> 1, 1);
                height2 = System.Math.Max(height2 >> 1, 1);
                depth2  = System.Math.Max(depth2 >> 1, 1);
                output.Write(String.Format("MipLevel{0}", i.ToString()), byteBuffer);
            }
        }
示例#7
0
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public void Write(ISavableWriter output)
 {
     output.Write("Name", base.Name);
     output.WriteSavable <VertexDeclaration>("VertexDeclaration", _impl.VertexDeclaration);
     output.Write("VertexCount", _impl.VertexCount);
     output.WriteEnum <ResourceUsage>("BufferUsage", _impl.BufferUsage);
     byte[] byteBuffer = new byte[_impl.VertexDeclaration.VertexStride * _impl.VertexCount];
     GetData <byte>(byteBuffer);
     output.Write("VertexData", byteBuffer);
 }
示例#8
0
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public virtual void Write(ISavableWriter output)
 {
     output.Write("Name", _name);
     output.Write("Viewport", new Vector4(_viewport.X, _viewport.Y, _viewport.Width, _viewport.Height));
     output.Write("ViewportDepth", new Vector2(_viewport.MinDepth, _viewport.MaxDepth));
     output.Write("Position", _position);
     output.Write("Up", _up);
     output.Write("Direction", _direction);
     output.WriteEnum <ProjectionMode>("ProjectionMode", _projectionMode);
     output.Write("ProjectionMatrix", _proj);
 }
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public override void Write(ISavableWriter output)
 {
     base.Write(output);
     output.Write("FlipImage", m_flip);
     output.Write("GenerateMipMaps", m_genMipMaps);
     output.Write("ResizePowerOfTwo", m_resizePowerOfTwo);
     output.WriteEnum <TextureConversionFormat>("TextureFormat", m_textureFormat);
     output.Write("ColorKey", m_colorKey);
     output.Write("ColorKeyEnabled", m_colorKeyEnabled);
     output.Write("PreMultiplyAlpha", m_preMultiplyAlpha);
 }
示例#10
0
        /// <summary>
        /// Serializes the object and writes it to the output.
        /// </summary>
        /// <param name="output">Savable Output</param>
        public override void Write(ISavableWriter output)
        {
            SurfaceFormat format   = _impl.Format;
            int           width    = _impl.Width;
            int           mipCount = _impl.MipCount;

            output.Write("Name", _impl.Name);
            output.WriteEnum <SurfaceFormat>("Format", format);
            output.Write("Width", width);
            output.Write("MipCount", mipCount);

            for (int i = 0; i < mipCount; i++)
            {
                byte[] byteBuffer = new byte[MemoryHelper.CalculateMipSize(width, 1, 1, i, format)];
                _impl.GetData <byte>(byteBuffer, i, 0, width >> i, 0, byteBuffer.Length);
                output.Write(String.Format("MipLevel{0}", i.ToString()), byteBuffer);
            }
        }
示例#11
0
 /// <summary>
 /// Serializes the object and writes it to the output.
 /// </summary>
 /// <param name="output">Savable Output</param>
 public override void Write(ISavableWriter output)
 {
     base.Write(output);
     output.WriteEnum <NormalGeneration>("NormalGeneration", _normalGen);
     output.Write("CreaseAngle", _creaseAngle);
     output.Write("GenerateTangentBasis", _generateTangentBasis);
     output.Write("FlipUVCoordinates", _flipUVs);
     output.Write("SwapWindingOrder", _swapWindingOrder);
     output.Write("Scale", _scale);
     output.Write("XAxisRotation", _xAngle);
     output.Write("YAxisRotation", _yAngle);
     output.Write("ZAxisRotation", _zAngle);
     output.Write("UserMaterialFile", _userMaterialFile);
     output.Write("MaterialNamesCorrespondToGeometry", _materialNamesCorrespondToGeometry);
     output.Write("PreferLitMaterials", _preferLitMaterials);
     output.Write("ImportLights", _importLights);
     output.WriteSavable <ImageLoaderParameters>("ImageLoaderParameters", _imageParameters);
     output.Write("TexturePath", _texturePath);
 }
示例#12
0
        /// <summary>
        /// Serializes the object and writes it to the output.
        /// </summary>
        /// <param name="output">Savable Output</param>
        public override void Write(ISavableWriter output)
        {
            SurfaceFormat format   = _impl.Format;
            int           size     = _impl.Size;
            int           mipCount = _impl.MipCount;

            output.Write("Name", _impl.Name);
            output.WriteEnum <SurfaceFormat>("Format", format);
            output.Write("Size", size);
            output.Write("MipCount", mipCount);

            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < mipCount; j++)
                {
                    byte[] byteBuffer = new byte[MemoryHelper.CalculateMipSize(size, size, 1, j, format)];
                    _impl.GetData <byte>((CubeMapFace)i, byteBuffer, j, null, 0, byteBuffer.Length);
                    output.Write(String.Format("CubeMapFace: {0}, MipLevel{1}", ((CubeMapFace)i).ToString(), j), byteBuffer);
                }
            }
        }