Пример #1
0
 public void Unserialize(GMDataReader reader)
 {
     Name        = reader.ReadStringPointerObject();
     DisplayName = reader.ReadStringPointerObject();
     Size        = reader.ReadInt32();
     if (Size < 0)
     {
         reader.Offset -= 4;
         SizeFloat      = -reader.ReadSingle();
     }
     Bold        = reader.ReadWideBoolean();
     Italic      = reader.ReadWideBoolean();
     RangeStart  = reader.ReadUInt16();
     Charset     = reader.ReadByte();
     AntiAlias   = reader.ReadByte();
     RangeEnd    = reader.ReadInt32();
     TextureItem = reader.ReadPointer <GMTextureItem>();
     ScaleX      = reader.ReadSingle();
     ScaleY      = reader.ReadSingle();
     if (reader.VersionInfo.FormatID >= 17)
     {
         AscenderOffset = reader.ReadInt32();
     }
     Glyphs = new GMPointerList <GMGlyph>();
     Glyphs.Unserialize(reader);
 }
Пример #2
0
        public void Unserialize(GMDataReader reader)
        {
            Name        = reader.ReadStringPointerObject();
            Transparent = reader.ReadWideBoolean();
            Smooth      = reader.ReadWideBoolean();
            Preload     = reader.ReadWideBoolean();
            Texture     = reader.ReadPointerObject <GMTextureItem>();

            if (reader.VersionInfo.Major >= 2)
            {
                TileUnknown1 = reader.ReadUInt32();
                if (TileUnknown1 != 2)
                {
                    reader.Warnings.Add(new GMWarning("Expected 2 in BGND"));
                }
                TileWidth         = reader.ReadUInt32();
                TileHeight        = reader.ReadUInt32();
                TileOutputBorderX = reader.ReadUInt32();
                TileOutputBorderY = reader.ReadUInt32();
                TileColumns       = reader.ReadUInt32();
                uint tileFrameCount = reader.ReadUInt32();
                uint tileCount      = reader.ReadUInt32();
                TileUnknown2 = reader.ReadUInt32();
                if (TileUnknown2 != 0)
                {
                    reader.Warnings.Add(new GMWarning("Expected 0 in BGND"));
                }
                TileFrameLength = reader.ReadInt64();

                Tiles = new List <List <uint> >((int)tileCount);
                for (int i = 0; i < tileCount; i++)
                {
                    List <uint> tileFrames = new List <uint>((int)tileFrameCount);
                    Tiles.Add(tileFrames);
                    for (int j = 0; j < tileFrameCount; j++)
                    {
                        tileFrames.Add(reader.ReadUInt32());
                    }
                }
            }
        }
Пример #3
0
        public void ReplaceWith(Bitmap bitmap)
        {
            _Bitmap = bitmap;

            BoundWidth   = (ushort)bitmap.Width;
            BoundHeight  = (ushort)bitmap.Height;
            SourceX      = 0;
            SourceY      = 0;
            SourceWidth  = BoundWidth;
            SourceHeight = BoundHeight;
            TargetX      = 0;
            TargetY      = 0;
            TargetWidth  = BoundWidth;
            TargetHeight = BoundHeight;

            TexturePageID     = -1;
            _TileHorizontally = false;
            _TileVertically   = false;
            _HasExtraBorder   = false;
            _EmptyBorder      = false;
            _DuplicateOf      = null;
            _PackItem         = null;
        }