예제 #1
0
        public void Room_Load(Stream _s)
        {
            int num  = _s.ReadInteger();
            int num2 = _s.ReadInteger();

            for (int i = 0; i < num2; i++)
            {
                Stream stream = _s;
                if (num == 800)
                {
                    stream = _s.ReadStreamC();
                }
                bool flag = stream.ReadBoolean();
                KeyValuePair <string, GMRoom> item = default(KeyValuePair <string, GMRoom>);
                if (flag)
                {
                    string key   = stream.ReadString();
                    GMRoom value = new GMRoom(this, stream);
                    item = new KeyValuePair <string, GMRoom>(key, value);
                }
                Rooms.Add(item);
            }
            RoomMaxId     = _s.ReadInteger();
            RoomMaxTileId = _s.ReadInteger();
        }
예제 #2
0
 public static void TagBackgroundTilesets(GMAssets _assets)
 {
     foreach (KeyValuePair <string, GMRoom> room in _assets.Rooms)
     {
         GMRoom value = room.Value;
         if (value != null)
         {
             foreach (GMTile tile in value.Tiles)
             {
                 _assets.Backgrounds[tile.Index].Value.Tileset = true;
             }
         }
     }
 }
예제 #3
0
 private static void WriteRooms(IList <KeyValuePair <string, GMRoom> > _data, Stream _s, IFF _iff)
 {
     WriteDataKVP(_data, _s, _iff, delegate(KeyValuePair <string, GMRoom> _kvp, Stream __s, IFF __iff, long __index)
     {
         __s.PatchOffset(__index);
         __iff.AddString(__s, _kvp.Key);
         GMRoom value = _kvp.Value;
         __iff.AddString(__s, value.Caption);
         __s.WriteInteger(value.Width);
         __s.WriteInteger(value.Height);
         __s.WriteInteger(value.Speed);
         __s.WriteBoolean(value.Persistent);
         __s.WriteInteger(value.Colour);
         __s.WriteBoolean(value.ShowColour);
         __iff.AddString(__s, value.Code);
         __s.WriteBoolean(value.EnableViews);
         long position = __s.Position;
         __s.WriteInteger(0);
         long position2 = __s.Position;
         __s.WriteInteger(0);
         long position3 = __s.Position;
         __s.WriteInteger(0);
         long position4 = __s.Position;
         __s.WriteInteger(0);
         __s.PatchOffset(position);
         WriteDataList(value.Backgrounds, __s, __iff, delegate(GMBack _back, Stream ___s, IFF ___iff, long ___index)
         {
             ___s.PatchOffset(___index);
             ___s.WriteBoolean(_back.Visible);
             ___s.WriteBoolean(_back.Foreground);
             ___s.WriteInteger(_back.Index);
             ___s.WriteInteger(_back.X);
             ___s.WriteInteger(_back.Y);
             ___s.WriteBoolean(_back.HTiled);
             ___s.WriteBoolean(_back.VTiled);
             ___s.WriteInteger(_back.HSpeed);
             ___s.WriteInteger(_back.VSpeed);
             ___s.WriteBoolean(_back.Stretch);
         });
         __s.PatchOffset(position2);
         WriteDataList(value.Views, __s, __iff, delegate(GMView _view, Stream ___s, IFF ___iff, long ___index)
         {
             ___s.PatchOffset(___index);
             ___s.WriteBoolean(_view.Visible);
             ___s.WriteInteger(_view.XView);
             ___s.WriteInteger(_view.YView);
             ___s.WriteInteger(_view.WView);
             ___s.WriteInteger(_view.HView);
             ___s.WriteInteger(_view.XPort);
             ___s.WriteInteger(_view.YPort);
             ___s.WriteInteger(_view.WPort);
             ___s.WriteInteger(_view.HPort);
             ___s.WriteInteger(_view.HBorder);
             ___s.WriteInteger(_view.VBorder);
             ___s.WriteInteger(_view.HSpeed);
             ___s.WriteInteger(_view.VSpeed);
             ___s.WriteInteger(_view.Index);
         });
         __s.PatchOffset(position3);
         WriteDataList(value.Instances, __s, __iff, delegate(GMInstance _inst, Stream ___s, IFF ___iff, long ___index)
         {
             ___s.PatchOffset(___index);
             ___s.WriteInteger(_inst.X);
             ___s.WriteInteger(_inst.Y);
             ___s.WriteInteger(_inst.Index);
             ___s.WriteInteger(_inst.Id);
             ___iff.AddString(___s, _inst.Code);
             ___s.WriteSingle((float)_inst.ScaleX);
             ___s.WriteSingle((float)_inst.ScaleY);
             ___s.WriteInteger((int)_inst.Colour);
             ___s.WriteSingle((float)_inst.Rotation);
         });
         __s.PatchOffset(position4);
         WriteDataList(value.Tiles, __s, __iff, delegate(GMTile _tile, Stream ___s, IFF ___iff, long ___index)
         {
             ___s.PatchOffset(___index);
             ___s.WriteInteger(_tile.X);
             ___s.WriteInteger(_tile.Y);
             ___s.WriteInteger(_tile.Index);
             ___s.WriteInteger(_tile.XO);
             ___s.WriteInteger(_tile.YO);
             ___s.WriteInteger(_tile.W);
             ___s.WriteInteger(_tile.H);
             ___s.WriteInteger(_tile.Depth);
             ___s.WriteInteger(_tile.Id);
             ___s.WriteSingle((float)_tile.XScale);
             ___s.WriteSingle((float)_tile.YScale);
             ___s.WriteInteger(_tile.Blend + ((int)(_tile.Alpha * 255.0) << 24));
         });
     });
 }