diff --git a/GlitchyEngine/src/Renderer/Effect.bf b/GlitchyEngine/src/Renderer/Effect.bf index a4f1748..03fdf1e 100644 --- a/GlitchyEngine/src/Renderer/Effect.bf +++ b/GlitchyEngine/src/Renderer/Effect.bf @@ -7,103 +7,6 @@ using GlitchyEngine.Content; namespace GlitchyEngine.Renderer; -/*/// Obsolete because of the ContentManager? -public class EffectLibrary -{ - private Dictionary _effects = new .() ~ delete _; - - private List _ownedStrings = new .() ~ DeleteContainerAndItems!(_); - - public this() - { - } - - public ~this() - { - for(let pair in _effects) - { - pair.value.ReleaseRef(); - } - } - - public void Add(Effect effect, String effectName = null) - { - Debug.Profiler.ProfileResourceFunction!(); - - String name; - - if(effectName == null) - { - name = effect.Name; - } - else - { - name = new String(effectName); - _ownedStrings.Add(name); - } - - Log.EngineLogger.AssertDebug(!Exists(name), "Can't add two effects with the same name to library."); - - _effects.Add(name, effect..AddRef()); - } - - /** - * Loads the effect with the given file name. - * @param filepath The path to the effect file. - * @param effectName The optional custom effect name which will be used to identify the effect. - * @returns The loaded Effect. Note: This function will increment the reference counter of the effect, so the programmer must decrement it once it's not used anymore. - * If the return-value is not needed, use LoadNoRefInc instead. - */ - public Effect Load(String filepath, String effectName = null) - { - Debug.Profiler.ProfileResourceFunction!(); - - String name = effectName; - - if(name == null) - { - name = scope:: String(); - Path.GetFileNameWithoutExtension(filepath, name); - } - - if (Exists(name)) - { - return Get(name); - } - else - { - Log.EngineLogger.AssertDebug(!Exists(name), "Can't add two effects with the same name to library."); - - Effect effect = new Effect(filepath, name); - Add(effect); - - return effect; - } - } - - /** - * Loads the effect with the given file name. - * @param filepath The path to the effect file. - * @param effectName The optional custom effect name which will be used to identify the effect. - */ - public void LoadNoRefInc(String filepath, String effectName = null) - { - var v = Load(filepath, effectName); - v.ReleaseRef(); - } - - public Effect Get(String effectName) - { - Debug.Profiler.ProfileResourceFunction!(); - - Log.EngineLogger.AssertDebug(Exists(effectName), "Effect not found!"); - - return _effects.GetValue(effectName).Get()..AddRef(); - } - - public bool Exists(String effectName) => _effects.ContainsKey(effectName); -}*/ - public enum TextureDimension { Unknown,