afxEffectGroup.h
Engine/source/afx/afxEffectGroup.h
Classes:
Detailed Description
1 2 3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames 5// Copyright (C) 2015 Faust Logic, Inc. 6// 7// Permission is hereby granted, free of charge, to any person obtaining a copy 8// of this software and associated documentation files (the "Software"), to 9// deal in the Software without restriction, including without limitation the 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11// sell copies of the Software, and to permit persons to whom the Software is 12// furnished to do so, subject to the following conditions: 13// 14// The above copyright notice and this permission notice shall be included in 15// all copies or substantial portions of the Software. 16// 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23// IN THE SOFTWARE. 24// 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 26 27#ifndef _AFX_EFFECT_GROUP_H_ 28#define _AFX_EFFECT_GROUP_H_ 29 30//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 31 32#include "console/typeValidators.h" 33 34#include "afx/afxEffectDefs.h" 35#include "afx/afxEffectWrapper.h" 36 37class afxEffectWrapperData; 38 39struct afxGroupTimingData 40{ 41 F32 delay; 42 F32 lifetime; 43 F32 fade_in_time; 44 F32 fade_out_time; 45 46 afxGroupTimingData() 47 { 48 delay = 0.0f; 49 lifetime = 0.0f; 50 fade_in_time = 0.0f; 51 fade_out_time = 0.0f; 52 } 53}; 54 55class afxEffectGroupData : public afxEffectBaseData 56{ 57 typedef afxEffectBaseData Parent; 58 59 class egValidator : public TypeValidator 60 { 61 U32 id; 62 public: 63 egValidator(U32 id) { this->id = id; } 64 void validateType(SimObject *object, void *typePtr); 65 }; 66 67 bool do_id_convert; 68 69public: 70 afxEffectList fx_list; 71 bool group_enabled; 72 S32 group_count; 73 U8 idx_offset; 74 bool assign_idx; 75 afxGroupTimingData timing; 76 afxEffectBaseData* dummy_fx_entry; 77 78private: 79 void pack_fx(BitStream* stream, const afxEffectList& fx, bool packed); 80 void unpack_fx(BitStream* stream, afxEffectList& fx); 81 82public: 83 /*C*/ afxEffectGroupData(); 84 /*C*/ afxEffectGroupData(const afxEffectGroupData&, bool = false); 85 86 virtual void reloadReset(); 87 88 virtual void packData(BitStream*); 89 virtual void unpackData(BitStream*); 90 91 bool preload(bool server, String &errorStr); 92 93 virtual void gather_cons_defs(Vector<afxConstraintDef>& defs); 94 95 virtual bool allowSubstitutions() const { return true; } 96 97 static void initPersistFields(); 98 99 DECLARE_CONOBJECT(afxEffectGroupData); 100 DECLARE_CATEGORY("AFX"); 101}; 102 103//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 104#endif // _AFX_EFFECT_GROUP_H_ 105