private static void WriteSprites(IList <KeyValuePair <string, GMSprite> > _data, Stream _s, IFF _iff) { WriteDataKVP(_data, _s, _iff, delegate(KeyValuePair <string, GMSprite> _kvp, Stream __s, IFF __iff, long __index) { __s.Align(4); __s.PatchOffset(__index); __iff.AddString(__s, _kvp.Key); GMSprite value = _kvp.Value; __s.WriteInteger(value.Width); __s.WriteInteger(value.Height); __s.WriteInteger(value.BBoxLeft); __s.WriteInteger(value.BBoxRight); __s.WriteInteger(value.BBoxBottom); __s.WriteInteger(value.BBoxTop); __s.WriteBoolean(value.Transparent); __s.WriteBoolean(value.Smooth); __s.WriteBoolean(value.Preload); __s.WriteInteger(value.BBoxMode); __s.WriteBoolean(value.ColCheck); __s.WriteInteger(value.XOrig); __s.WriteInteger(value.YOrig); __s.WriteInteger(value.Images.Count); ms_tpageSprites.BeginGroup(_kvp.Key); for (int i = 0; i < value.Images.Count; i++) { if (value.Images[i].Width * value.Images[i].Height > 0) { TexturePageEntry o = ms_tpageSprites.AddImage(value.Images[i].Bitmap, true, false); __iff.AddPatch(__s, o); } else { __s.WriteInteger(0); } } ms_tpageSprites.EndGroup(); IList <byte[]> masks = value.Masks; if (masks != null) { __s.WriteInteger(value.Masks.Count); foreach (byte[] item in masks) { __s.Write(item, 0, item.Length); } } else { __s.WriteInteger(0); } }); }
public void Sprite_Load(Stream _s) { int num = _s.ReadInteger(); int num2 = _s.ReadInteger(); for (int i = 0; i < num2; i++) { Stream s = _s; if (num == 800) { s = _s.ReadStreamC(); } bool flag = s.ReadBoolean(); KeyValuePair <string, GMSprite> item = default(KeyValuePair <string, GMSprite>); if (flag) { string key = s.ReadString(); GMSprite value = new GMSprite(this, s); item = new KeyValuePair <string, GMSprite>(key, value); } Sprites.Add(item); } }