Esempio n. 1
0
        protected override TexLayer Load(IniKeyCollection iniData, LayerHandlerContext context)
        {
            var data = new TexLayer();

            data.Id            = iniData.GetInt16("id", -1);
            data.ImageData     = context.LoadExternalFile(ImageFileKey);
            data.MaskImageData = context.HasExternalFile(MaskFileKey) ? context.LoadExternalFile(MaskFileKey) : null;
            data.Offset        = iniData.GetPoint("off", Point2D.Empty);
            data.Size          = iniData.GetPoint("size");
            data.Mipmap        = iniData.GetEnum("mipmap", TexMipmap.None);
            data.MagFilter     = iniData.GetEnum("magfilter", TexMagFilter.Nearest);

            var defaultMinFilter = (data.Mipmap != TexMipmap.None)
                                ? TexMinFilter.LinearMipmapLinear
                                : TexMinFilter.Linear;

            data.MinFilter = iniData.GetEnum("minfilter", defaultMinFilter);

            return(data);
        }