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