/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. // Description : Contains a set of effects to be executed (particles, sound, decals, ...) #ifndef _MFX_CONTAINER_H_ #define _MFX_CONTAINER_H_ #pragma once #include "MFXEffectBase.h" struct SMFXRunTimeEffectParams; struct SMFXResourceList; ////////////////////////////////////////////////////////////////////////// class CMFXContainer : public _i_reference_target_t { protected: typedef std::vector TMFXEffects; public: struct SParams { SParams () : effectId(InvalidEffectId) , delay(0.0f) { } TMFXNameId libraryName; // only top level effects have valid lib name TMFXNameId name; // only top level effects have valid effect name TMFXEffectId effectId; // only top level effects have valid ids! float delay; }; public: virtual ~CMFXContainer(); void BuildFromXML(const XmlNodeRef& paramsNode); void Execute(const SMFXRunTimeEffectParams& params); void SetCustomParameter(const char* customParameter, const SMFXCustomParamValue& customParameterValue); void GetResources(SMFXResourceList& resourceList) const; void SetLibraryAndId(const TMFXNameId& libraryName, const TMFXEffectId effectId) { m_params.libraryName = libraryName; m_params.effectId = effectId; } const SParams& GetParams() const { return m_params; } void PreLoadAssets(); void ReleasePreLoadAssets(); void GetMemoryUsage(ICrySizer* pSizer) const; protected: virtual void BuildChildEffects(const XmlNodeRef& paramsNode); private: void LoadParamsFromXml(const XmlNodeRef& paramsNode); protected: TMFXEffects m_effects; private: SParams m_params; }; typedef _smart_ptr TMFXContainerPtr; ////////////////////////////////////////////////////////////////////////// // This is used by dedicated server (no sound, particles, etc...) class CMFXDummyContainer : public CMFXContainer { protected: virtual void BuildChildEffects(const XmlNodeRef& paramsNode) override; }; #endif // _MFX_CONTAINER_H_