Наследование: Glare.Assets.FolderAsset
Пример #1
0
        internal Graphic(GraphicArchive archive, AssetLoader loader, int index, int length, int width, int height, PaletteAsset palette, int[] aux = null, int auxOffset = 0)
            : base(archive, loader)
        {
            BinaryReader reader = loader.Reader;

            Name = index.ToString();
            if (length == 0)
            {
                return;
            }

            if (width >= 0 && height >= 0)
            {
                int[] indices = reader.ReadBytesAsInt32(width * height);
                Setup(palette, width, height, indices);
            }
            else
            {
                byte format = reader.ReadByte();
                width  = reader.ReadByte();
                height = reader.ReadByte();
                Load(reader, width, height, palette, format, aux, auxOffset);
            }

            Center = new Vector2i(width / 2 - 4, height - 4);
        }
Пример #2
0
        internal Graphic(GraphicArchive archive, AssetLoader loader, int index, int length, int width, int height, PaletteAsset palette, int[] aux = null, int auxOffset = 0)
            : base(archive, loader)
        {
            BinaryReader reader = loader.Reader;

            Name = index.ToString();
            if (length == 0)
                return;

            if (width >= 0 && height >= 0) {
                int[] indices = reader.ReadBytesAsInt32(width * height);
                Setup(palette, width, height, indices);
            } else {
                byte format = reader.ReadByte();
                width = reader.ReadByte();
                height = reader.ReadByte();
                Load(reader, width, height, palette, format, aux, auxOffset);
            }

            Center = new Vector2i(width / 2 - 4, height - 4);
        }