Example #1
0
 public override void LoadState(System.IO.BinaryReader stream)
 {
     base.LoadState(stream);
     prg_page = stream.ReadInt32();
     irq_counter = stream.ReadInt32();
     irq_enabled = stream.ReadBoolean();
 }
Example #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="metadata"></param>
        public StreamHeader(System.IO.BinaryReader reader, byte[] metadata)
        {
            _offset = reader.ReadInt32();
            _size = reader.ReadInt32();

            int position = (int)reader.BaseStream.Position;
            int length = Array.IndexOf<byte>(metadata, 0, position, 32);
            _name = Encoding.ASCII.GetString(metadata, position, length - position);

            if (_name.Equals("#Strings"))
            {
                _kind = HeapType.String;
            }
            else if (_name.Equals("#US"))
            {
                _kind = HeapType.UserString;
            }
            else if (_name.Equals("#Blob"))
            {
                _kind = HeapType.Blob;
            }
            else if (_name.Equals("#GUID"))
            {
                _kind = HeapType.Guid;
            }
            else if (_name.Equals("#~"))
            {
                _kind = HeapType.Tables;
            }
            else
            {
                throw new NotSupportedException("Offset: " + _offset + " \\ Size: " + _size + " \\ Name: " + _name.ToString());
            }
        }
Example #3
0
        public int[] offset; // Offset to each of the individual texture [numtex]

        #endregion Fields

        #region Methods

        public void Read(System.IO.BinaryReader source)
        {
            numtex = source.ReadInt32();
            offset = new int[numtex];
            for (int i=0; i<numtex; ++i)
                offset[i] = source.ReadInt32();
        }
Example #4
0
 public override void LoadState(System.IO.BinaryReader stream)
 {
     base.LoadState(stream);
     chr_aaa = stream.ReadInt32();
     chr_bbb = stream.ReadInt32();
     chr_hhh = stream.ReadInt32();
 }
Example #5
0
        public Vector3 vectorT; // T vector, vertical in texture space

        #endregion Fields

        #region Methods

        public void Read(System.IO.BinaryReader source)
        {
            vectorS.X = source.ReadSingle();
            vectorS.Y = source.ReadSingle();
            vectorS.Z = source.ReadSingle();
            distS = source.ReadSingle();

            vectorT.X = source.ReadSingle();
            vectorT.Y = source.ReadSingle();
            vectorT.Z = source.ReadSingle();
            distT = source.ReadSingle();

            lm_vectorS.X = source.ReadSingle();
            lm_vectorS.Y = source.ReadSingle();
            lm_vectorS.Z = source.ReadSingle();
            lm_distS = source.ReadSingle();

            lm_vectorT.X = source.ReadSingle();
            lm_vectorT.Y = source.ReadSingle();
            lm_vectorT.Z = source.ReadSingle();
            lm_distT = source.ReadSingle();

            flags = source.ReadInt32();
            texdata = source.ReadInt32();
        }
Example #6
0
 public override void LoadState(System.IO.BinaryReader stream)
 {
     base.LoadState(stream);
     bank = stream.ReadInt32();
     mode = stream.ReadInt32();
     offset = stream.ReadInt32();
 }
Example #7
0
 public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin)
 {
     IGORR.Server.Logic.MapChanger changer = new IGORR.Server.Logic.MapChanger(map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID);
     changer.targetMapID = bin.ReadInt32();
     changer.targetPos = new Microsoft.Xna.Framework.Vector2(bin.ReadInt32(),bin.ReadInt32());
     return changer;
 }
Example #8
0
 public override void LoadState(System.IO.BinaryReader stream)
 {
     base.LoadState(stream);
     SRAM_PRG_Page = stream.ReadInt32();
     irqEnable = stream.ReadBoolean();
     irqCounter = stream.ReadInt32();
 }
Example #9
0
 public void Read(System.IO.BinaryReader source)
 {
     planenum = source.ReadInt32();
     front = source.ReadInt32();
     back = source.ReadInt32();
     box.Read(source);
 }
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.entityId = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posX = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posY = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posZ = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.xpValue = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
 }
Example #11
0
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.entityID = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.isLightningBolt = DataInput.ReadByte();
     this.posX = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posY = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posZ = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
 }
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.entityId = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posX = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posY = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posZ = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.destroyedStage = DataInput.ReadByte();
 }
Example #13
0
 public override void Read(ref System.IO.BinaryReader stream)
 {
     A = stream.ReadInt32();
     B = stream.ReadByte();
     C = stream.ReadInt32();
     D = stream.ReadInt32();
     E = stream.ReadInt32();
 }
Example #14
0
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.xPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.yPosition = DataInput.ReadByte();
     this.zPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.type = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     this.metadata = DataInput.ReadByte();
 }
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.entityId = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.title = readString(DataInput, 14);
     this.xPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.yPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.zPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.direction = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
 }
Example #16
0
 public override void LoadState(System.IO.BinaryReader stream)
 {
     base.LoadState(stream);
     flag_r = stream.ReadBoolean();
     flag_m = stream.ReadBoolean();
     nt_reg0 = stream.ReadInt32();
     nt_reg1 = stream.ReadInt32();
     temp = stream.ReadInt32();
 }
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.xLocation = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.yLocation = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     this.zLocation = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.instrumentType = DataInput.ReadByte();
     this.pitch = DataInput.ReadByte();
     this.blockId = IPAddress.NetworkToHostOrder(DataInput.ReadInt16()) &4095;
 }
Example #18
0
 public override object Deserialize(System.IO.BinaryReader binaryReader)
 {
     bool hasValue = binaryReader.ReadBoolean ();
     if (!hasValue)
         return null;
     int typeID = binaryReader.ReadByte ();
     switch (typeID) {
     case 1:
         return binaryReader.ReadBoolean ();
     case 2:
         return binaryReader.ReadByte ();
     case 128:
         return binaryReader.ReadSByte ();
     case 3:
         return binaryReader.ReadInt16 ();
     case 129:
         return binaryReader.ReadUInt16 ();
     case 4:
         return binaryReader.ReadInt32 ();
     case 130:
         return binaryReader.ReadUInt32 ();
     case 5:
         return binaryReader.ReadInt64 ();
     case 131:
         return binaryReader.ReadUInt64 ();
     case 9:
         return binaryReader.ReadDouble ();
     case 16:
         return binaryReader.ReadString ();
     case 144:
         return binaryReader.ReadChar ();
     case 24:
         return new DateTime (binaryReader.ReadInt64 ());
     case 32:
         return new Guid (binaryReader.ReadBytes (16));
     case 36:
         return binaryReader.ReadBytes (binaryReader.ReadInt32 ());
     case 37:
         {
             int count = binaryReader.ReadInt32 ();
             string[] r = new string[count];
             for (int n = 0; n != count; n++)
                 r [n] = binaryReader.ReadString ();
             return r;
         }
     case 38:
         {
             int count = binaryReader.ReadInt32 ();
             long[] r = new long[count];
             for (int n = 0; n != count; n++)
                 r [n] = binaryReader.ReadInt64 ();
             return r;
         }
     default:
         throw new Exception (string.Format ("Serialization for type <{0}> is not supported", typeID));
     }
 }
Example #19
0
 /// <summary>
 /// Load state
 /// </summary>
 /// <param name="stream">The stream that should be used to read data</param>
 public virtual void LoadState(System.IO.BinaryReader stream)
 {
     Enabled = stream.ReadBoolean();
     Volume = stream.ReadByte();
     dutyStep = stream.ReadInt32();
     freqTimer = stream.ReadInt32();
     frequency = stream.ReadInt32();
     cycles = stream.ReadInt32();
 }
Example #20
0
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.soundName = readString(DataInput, 256);
     this.effectX = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.effectY = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.effectZ = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.volume = (float)IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.pitch = DataInput.ReadByte();
 }
Example #21
0
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.sfxID = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posX = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.posY = DataInput.ReadByte() & 255;
     this.posZ = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.auxData = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.disableRelativeVolume = DataInput.ReadBoolean();
 }
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.entityId = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.xPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.yPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.zPosition = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.yaw = DataInput.ReadByte();
     this.pitch = DataInput.ReadByte();
 }
Example #23
0
        public uint planenum; // index of the splitting plane (in the plane array)

        #endregion Fields

        #region Methods

        public void Read(System.IO.BinaryReader source)
        {
            planenum = source.ReadUInt32();
            front = source.ReadInt32();
            back = source.ReadInt32();
            box.Read(source);
            first_face = source.ReadUInt16();
            num_faces = source.ReadUInt16();
        }
Example #24
0
        public static DDCaps Read(System.IO.BinaryReader r)
        {
            DDCaps caps = new DDCaps();
            caps.caps1 = r.ReadInt32();
            caps.caps2 = r.ReadInt32();
            r.ReadInt64(); // reserved[2]

            return caps;
        }
Example #25
0
 /// <summary>
 /// Load state
 /// </summary>
 /// <param name="stream">The stream that should be used to read data</param>
 public void LoadState(System.IO.BinaryReader stream)
 {
     AccumRate = stream.ReadByte();
     accumClock = stream.ReadInt32();
     accumulationRegister = stream.ReadByte();
     frequency = stream.ReadInt32();
     freqTimer = stream.ReadInt32();
     cycles = stream.ReadInt32();
     enabled = stream.ReadBoolean();
 }
Example #26
0
		public void LoadStateBinary(System.IO.BinaryReader reader)
		{
			int length = reader.ReadInt32();
			byte[] data = reader.ReadBytes(length);
			LoadCoreBinary(data);
			// other variables
			IsLagFrame = reader.ReadBoolean();
			LagCount = reader.ReadInt32();
			Frame = reader.ReadInt32();
		}
Example #27
0
 public RecievePacket handleData(System.IO.BinaryReader br, System.IO.BinaryWriter bw, System.Net.Sockets.TcpClient client)
 {
     List<object> l = new List<object>();
     l.Add(br.ReadInt32());
     l.Add(br.ReadInt32());
     l.Add(br.ReadInt32());
     l.Add(br.ReadInt32());
     l.Add(br.ReadDouble());
     return new RecievePacket(l);
 }
Example #28
0
 public override void LoadState(System.IO.BinaryReader stream)
 {
     base.LoadState(stream);
     prescaler = stream.ReadInt32();
     irq_counter = stream.ReadInt32();
     irq_mode_cycle = stream.ReadBoolean();
     irq_reload = stream.ReadInt32();
     irq_enable = stream.ReadBoolean();
     irq_enable_on_ak = stream.ReadBoolean();
 }
Example #29
0
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.xCh = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.zCh = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.includeInitialize = DataInput.ReadBoolean();
     this.yChMin = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     this.yChMax = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     this.tempLength = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     DataInput.ReadBytes(this.tempLength);
 }
Example #30
0
        public int width, height; // source image

        #endregion Fields

        #region Methods

        public void Read(System.IO.BinaryReader source)
        {
            reflectivity.X = source.ReadSingle();
            reflectivity.Y = source.ReadSingle();
            reflectivity.Z = source.ReadSingle();
            nameStringTableID = source.ReadInt32();
            width = source.ReadInt32();
            height = source.ReadInt32();
            view_width = source.ReadInt32();
            view_height = source.ReadInt32();
        }