Beispiel #1
0
        public void Delete(ShaderPack pack)
        {
            if (_enabledPack == pack)
            {
                _enabledPack = null;
            }

            Packs.Remove(pack);
            _shaderPackService.DeleteFromDisk(pack);
        }
Beispiel #2
0
        public ShaderPackViewModel(
            GamePathService gamePathService,
            ShaderPackService shaderPackService,
            LanguageService languageService)
        {
            _gamePathService   = gamePathService;
            _shaderPackService = shaderPackService;
            _languageService   = languageService;

            Packs        = new BindableCollection <ShaderPack>();
            _enabledPack = null;
        }
Beispiel #3
0
        public ShaderPool()
        {
            DepthOnly = new ShaderPack("ConeLight.fragment.glsl");

            GenericMaterial = new ShaderPack("Generic.fragment.glsl");

            ForwardMaterial = new ShaderPack("Forward.fragment.glsl");

            NoFragment = new ShaderPack();

            Packs = new ShaderPack[] { DepthOnly, GenericMaterial, ForwardMaterial, NoFragment };
        }
Beispiel #4
0
        public async void Reload()
        {
            Packs.Clear();

            foreach (var pack in await _shaderPackService.LoadAllAsync())
            {
                if (pack.IsEnabled)
                {
                    _enabledPack = pack;
                }

                Packs.Add(pack);
            }
        }
Beispiel #5
0
 public DrawCommand(string text, Vector2 position, Color color, float scale = 0.5f, int maxlife = -1,
                    ShaderPack?shaderPack = null, float layerDepth = 0)
 {
     this.type       = DrawType.drawString;
     this.position   = position;
     this.color      = color;
     this.permColor  = color;
     this.layerDepth = layerDepth;
     this.scale      = scale;
     this.text       = text;
     this.maxlife    = maxlife;
     this.life       = maxlife;
     this.shaderPack = shaderPack ?? ShaderPack.Default;
 }
Beispiel #6
0
        public void OnEnableStatusChanged(ShaderPack pack)
        {
            if (pack.IsEnabled)
            {
                if (_enabledPack != null)
                {
                    _enabledPack.IsEnabled = false;
                }

                _enabledPack = pack;
            }
            else if (pack == _enabledPack)
            {
                _enabledPack = null;
            }

            NotifyOfPropertyChange(nameof(Packs));
        }
Beispiel #7
0
 public DrawCommand(Textures texture, Vector2 position, Rectangle?sourceRect, Color color, float rotation,
                    Vector2 origin, Vector2 scalevect,
                    float layerDepth = 0,
                    int maxlife      = -1, ShaderPack?shaderPack = null)
 {
     this.type       = DrawType.vectScaled;
     this.texture    = texture;
     this.position   = position;
     this.color      = color;
     this.permColor  = color;
     this.scalevect  = scalevect;
     this.rotation   = rotation;
     this.sourceRect = sourceRect;
     this.origin     = origin;
     this.layerDepth = layerDepth;
     this.maxlife    = maxlife;
     this.life       = maxlife;
     this.shaderPack = shaderPack ?? new ShaderPack(color);
 }
Beispiel #8
0
 public DrawCommand(Texture2D texture, Vector2 position, Rectangle?sourceRect, Color color, float rotation,
                    Vector2 origin, float scale, float layerDepth = 0,
                    int maxlife           = -1,
                    ShaderPack?shaderPack = null)
 {
     this.type       = DrawType.direct;
     this.texture2d  = texture;
     this.position   = position;
     this.color      = color;
     this.permColor  = color;
     this.scale      = scale;
     this.rotation   = rotation;
     this.sourceRect = sourceRect;
     this.origin     = origin;
     this.layerDepth = layerDepth;
     this.maxlife    = maxlife;
     this.life       = maxlife;
     this.shaderPack = shaderPack ?? ShaderPack.Default;
 }
Beispiel #9
0
 public void Enable(ShaderPack pack)
 {
     pack.IsEnabled = true;
     OnEnableStatusChanged(pack);
 }
Beispiel #10
0
 public ShaderPool()
 {
     DepthOnly = new ShaderPack();
     GenericMaterial = new ShaderPack("Generic.fragment.glsl");
     DistanceOnly = new ShaderPack("DistanceOnly.fragment.glsl");
 }