1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: gfx_ResParticleAnimationOption.h 4 5 Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain proprietary 8 information of Nintendo and/or its licensed developers and are protected by 9 national and international copyright laws. They may not be disclosed to third 10 parties or copied or duplicated in any form, in whole or in part, without the 11 prior written consent of Nintendo. 12 13 The content herein is highly confidential and should be handled accordingly. 14 15 $Revision: $ 16 *---------------------------------------------------------------------------*/ 17 18 #ifndef NW_GFX_RESPARTICLEANIMATIONOPTION_H_ 19 #define NW_GFX_RESPARTICLEANIMATIONOPTION_H_ 20 21 #include <nw/ut/ut_ResUtil.h> 22 #include <nw/ut/ut_ResDictionary.h> 23 #include <nw/ut/ut_ResDeclMacros.h> 24 #include <nw/gfx/res/gfx_ResTypeInfo.h> 25 26 namespace nw { 27 namespace gfx { 28 namespace res { 29 30 //! @details :private 31 struct ResParticleAnimationOptionData 32 { 33 nw::ut::ResTypeInfo typeInfo; 34 nw::ut::ResF32 m_AnimationDuration; 35 }; 36 37 38 //-------------------------------------------------------------------------- 39 //! @brief パーティクルアニメーションのオプションを表すバイナリリソースクラスです。 40 //--------------------------------------------------------------------------- 41 class ResParticleAnimationOption : public nw::ut::ResCommon< ResParticleAnimationOptionData > 42 { 43 public: 44 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleAnimationOption) }; 45 enum { SIGNATURE = NW_RES_SIGNATURE32('AOPT') }; 46 47 NW_RES_CTOR( ResParticleAnimationOption ) 48 NW_RES_FIELD_PRIMITIVE_DECL(f32,AnimationDuration)49 NW_RES_FIELD_PRIMITIVE_DECL( f32, AnimationDuration ) 50 51 //--------------------------------------------------------------------------- 52 //! @brief インスタンスの型情報を取得します。 53 //! 54 //! @return 型情報です。 55 //--------------------------------------------------------------------------- 56 nw::ut::ResTypeInfo GetTypeInfo() const { return ref().typeInfo; } 57 58 static u32 GetHash(u32 key1, u32 key2, u32 key3, u32 key4); 59 ParticleTime EvaluateAnimationFrame(u32 id, ParticleTime birth, ParticleTime life, ParticleTime time, int updaterIndex) const; 60 }; 61 62 //! @details :private 63 struct ResParticleFittingAnimationOptionData : public ResParticleAnimationOptionData 64 { 65 }; 66 67 68 //-------------------------------------------------------------------------- 69 //! @brief パーティクルフィッティングアニメーションのオプションを表すバイナリリソースクラスです。 70 //--------------------------------------------------------------------------- 71 class ResParticleFittingAnimationOption : public ResParticleAnimationOption 72 { 73 public: 74 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleFittingAnimationOption) }; 75 enum { SIGNATURE = NW_RES_SIGNATURE32('FITT') }; 76 77 NW_RES_CTOR_INHERIT( ResParticleFittingAnimationOption, ResParticleAnimationOption ) 78 }; 79 80 //! @details :private 81 struct ResParticleFrameLoopAnimationOptionData : public ResParticleAnimationOptionData 82 { 83 nw::ut::ResU32 m_LoopDuration; 84 nw::ut::ResBool m_RandomOffset; 85 u8 padding_0[3]; 86 }; 87 88 89 //-------------------------------------------------------------------------- 90 //! @brief パーティクルフレームループアニメーションのオプションを表すバイナリリソースクラスです。 91 //--------------------------------------------------------------------------- 92 class ResParticleFrameLoopAnimationOption : public ResParticleAnimationOption 93 { 94 public: 95 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleFrameLoopAnimationOption) }; 96 enum { SIGNATURE = NW_RES_SIGNATURE32('FLOO') }; 97 98 NW_RES_CTOR_INHERIT( ResParticleFrameLoopAnimationOption, ResParticleAnimationOption ) 99 100 NW_RES_FIELD_PRIMITIVE_DECL( u32, LoopDuration ) 101 NW_RES_FIELD_PRIMITIVE_DECL( bool, RandomOffset ) 102 }; 103 104 //! @details :private 105 struct ResParticleRandomAnimationOptionData : public ResParticleAnimationOptionData 106 { 107 }; 108 109 110 //-------------------------------------------------------------------------- 111 //! @brief パーティクルランダムアニメーションのオプションを表すバイナリリソースクラスです。 112 //--------------------------------------------------------------------------- 113 class ResParticleRandomAnimationOption : public ResParticleAnimationOption 114 { 115 public: 116 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleRandomAnimationOption) }; 117 enum { SIGNATURE = NW_RES_SIGNATURE32('RAND') }; 118 119 NW_RES_CTOR_INHERIT( ResParticleRandomAnimationOption, ResParticleAnimationOption ) 120 }; 121 122 } // namespace res 123 } // namespace gfx 124 } // namespace nw 125 126 #endif // NW_GFX_RESPARTICLEANIMATIONOPTION_H_ 127