var gdjs;(function(l){const s=GlobalPIXIModule.PIXI;class o{initializeEffect(e,t,n){const i=l.PixiFiltersTools.getFilterCreator(e.effectType);if(!i)return console.warn(`Effect: "${e.name}", on layer: "${n.getName()}", has an unknown effect type: "${e.effectType}". Was it registered properly? Is the effect type correct?`),!1;const r={pixiFilter:i.makePIXIFilter(n,e),updateDoubleParameter:i.updateDoubleParameter,updateStringParameter:i.updateStringParameter,updateBooleanParameter:i.updateBooleanParameter,updatePreRender:i.updatePreRender};return n.isLightingLayer&&n.isLightingLayer()&&(r.pixiFilter.blendMode=s.BLEND_MODES.ADD),t[e.name]=r,!0}applyEffect(e,t){return e.filters=(e.filters||[]).concat(t.pixiFilter),!0}updatePreRender(e,t){for(const n in e){const i=e[n];i.updatePreRender(i.pixiFilter,t)}}addEffect(e,t,n,i){let r=!0;return r=this.initializeEffect(e,t,i)&&r,r=this.updateAllEffectParameters(t,e)&&r,t[e.name]&&(r=this.applyEffect(n,t[e.name])&&r),r}removeEffect(e,t,n){const i=e[n];return i?(t.filters=(t.filters||[]).filter(r=>r!==i.pixiFilter),delete e[n],!0):!1}clearEffects(e){return e&&(e.filters=[]),!0}setEffectDoubleParameter(e,t,n,i){const r=e[t];return r?(r.updateDoubleParameter(r.pixiFilter,n,i),!0):!1}setEffectStringParameter(e,t,n,i){const r=e[t];return r?(r.updateStringParameter(r.pixiFilter,n,i),!0):!1}setEffectBooleanParameter(e,t,n,i){const r=e[t];return r?(r.updateBooleanParameter(r.pixiFilter,n,i),!0):!1}updateAllEffectParameters(e,t){let n=!0,i=!0,r=!0;for(let a in t.doubleParameters)n=this.setEffectDoubleParameter(e,t.name,a,t.doubleParameters[a])&&n;for(let a in t.stringParameters)i=this.setEffectStringParameter(e,t.name,a,t.stringParameters[a])&&i;for(let a in t.booleanParameters)r=this.setEffectBooleanParameter(e,t.name,a,t.booleanParameters[a])&&r;return n&&i&&r}hasEffect(e,t){return!!e[t]}enableEffect(e,t,n){const i=e[t];!i||l.PixiFiltersTools.enableEffect(i,n)}isEffectEnabled(e,t){const n=e[t];return n?l.PixiFiltersTools.isEffectEnabled(n):!1}}l.EffectsManager=o})(gdjs||(gdjs={}));
//# sourceMappingURL=pixi-effects-manager.js.map
