private void ReadShipViewer(BinaryReader Reader)
        {
            string ShipString = Reader.ReadString();

            ShipModel            = AssetManager.Load <Model>(ShipString);
            ModelTransformMatrix = Matrix.CreateScale(1 / ShipScale) * Matrix.CreateRotationY(ModelRotation);

            ShipEffect                = AssetManager.LoadEffect(Reader.ReadString());
            WorldParam                = ShipEffect.Parameters["World"];
            ViewParam                 = ShipEffect.Parameters["View"];
            ProjectionParam           = ShipEffect.Parameters["Projection"];
            ViewPosParam              = ShipEffect.Parameters["CameraPosition"];
            ForwardInstancedTechnique = ShipEffect.Techniques["ForwardInstancedTechnique"];
            ForwardTechnique          = ShipEffect.Techniques["ForwardTechnique"];
            ColorParameter            = ShipEffect.Parameters["DrawColor"];

            ShipTexture = AssetManager.Load <Texture2D>(Reader.ReadString());

            DrawColor        = SaveHelper.ReadVector4();
            SpecularColor    = SaveHelper.ReadVector4();
            SpecularExponent = Reader.ReadSingle();
        }
        private void WriteWeaponPoints(BinaryWriter Writer)
        {
            int WeaponCount = 0;

            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipWeaponPoint)))
                {
                    WeaponCount++;
                }
            }

            Writer.Write((Int32)WeaponCount);

            foreach (GameObject g in Children)
            {
                if (g.GetType().Equals(typeof(ShipWeaponPoint)))
                {
                    ShipWeaponPoint s = (ShipWeaponPoint)g;
                    SaveHelper.Write(s.Position.get());
                    Writer.Write((Int32)s.Layer.get());
                }
            }
        }
Esempio n. 3
0
 public static void DummyRead(BinaryReader Reader)
 {
     SaveHelper.ReadVector2();
 }
Esempio n. 4
0
 public override void Read(BinaryReader Reader)
 {
     set(SaveHelper.ReadVector2());
     base.Read(Reader);
 }
Esempio n. 5
0
 public override void Write(BinaryWriter Writer)
 {
     SaveHelper.Write(get());
     base.Write(Writer);
 }
Esempio n. 6
0
 public static void DummyRead(BinaryReader Reader)
 {
     SaveHelper.ReadVector4();
     Reader.ReadSingle();
 }