1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_ResParticleForm.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_RESPARTICLEFORM_H_
19 #define NW_GFX_RESPARTICLEFORM_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 ResParticleFormData
32 {
33     nw::ut::ResTypeInfo typeInfo;
34     nw::ut::ResBool m_IsResourceCopyEnabled;
35     u8              padding_0[3];
36 };
37 
38 
39 //--------------------------------------------------------------------------
40 //! @brief  パーティクルの発生形状を表すバイナリリソースクラスです。
41 //---------------------------------------------------------------------------
42 class ResParticleForm : public nw::ut::ResCommon< ResParticleFormData >
43 {
44 public:
45     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleForm) };
46     enum { SIGNATURE = NW_RES_SIGNATURE32('INIT') };
47 
48     NW_RES_CTOR( ResParticleForm )
49 
NW_RES_FIELD_PRIMITIVE_DECL(bool,IsResourceCopyEnabled)50     NW_RES_FIELD_PRIMITIVE_DECL( bool, IsResourceCopyEnabled )
51 
52     //---------------------------------------------------------------------------
53     //! @brief        インスタンスの型情報を取得します。
54     //!
55     //! @return       型情報です。
56     //---------------------------------------------------------------------------
57     nw::ut::ResTypeInfo     GetTypeInfo() const { return ref().typeInfo; }
58     void    Setup();
59 };
60 
61 //! @details :private
62 struct ResParticleCubeFormData : public ResParticleFormData
63 {
64     nw::ut::ResF32 m_Inner;
65     nw::ut::ResVec3 m_Scale;
66     nw::ut::ResBool m_EvenInterval;
67     u8              padding_0[3];
68 };
69 
70 
71 //--------------------------------------------------------------------------
72 //! @brief  パーティクルの発生形状(キューブ)を表すバイナリリソースクラスです。
73 //---------------------------------------------------------------------------
74 class ResParticleCubeForm : public ResParticleForm
75 {
76 public:
77     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleCubeForm) };
78     enum { SIGNATURE = NW_RES_SIGNATURE32('CUBE') };
79 
80     NW_RES_CTOR_INHERIT( ResParticleCubeForm, ResParticleForm )
81 
82     NW_RES_FIELD_PRIMITIVE_DECL( f32, Inner )
83     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Scale )
84     NW_RES_FIELD_PRIMITIVE_DECL( bool, EvenInterval )
85 
86     void    Setup();
87 };
88 
89 //! @details :private
90 struct ResParticleCylinderFormData : public ResParticleFormData
91 {
92     nw::ut::ResF32 m_Inner;
93     nw::ut::ResF32 m_AngleWidth;
94     nw::ut::ResF32 m_AngleOffset;
95     nw::ut::ResF32 m_AngleSwing;
96     nw::ut::ResVec3 m_Scale;
97     nw::ut::ResBool m_FixedOffset;
98     nw::ut::ResBool m_EvenInterval;
99     u8              padding_0[2];
100 };
101 
102 
103 //--------------------------------------------------------------------------
104 //! @brief  パーティクルの発生形状(シリンダー)を表すバイナリリソースクラスです。
105 //---------------------------------------------------------------------------
106 class ResParticleCylinderForm : public ResParticleForm
107 {
108 public:
109     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleCylinderForm) };
110     enum { SIGNATURE = NW_RES_SIGNATURE32('CYLI') };
111 
112     NW_RES_CTOR_INHERIT( ResParticleCylinderForm, ResParticleForm )
113 
114     NW_RES_FIELD_PRIMITIVE_DECL( f32, Inner )
115     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleWidth )
116     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleOffset )
117     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleSwing )
118     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Scale )
119     NW_RES_FIELD_PRIMITIVE_DECL( bool, FixedOffset )
120     NW_RES_FIELD_PRIMITIVE_DECL( bool, EvenInterval )
121 
122     void    Setup();
123 };
124 
125 //! @details :private
126 struct ResParticleDiscFormData : public ResParticleFormData
127 {
128     nw::ut::ResF32 m_Inner;
129     nw::ut::ResF32 m_AngleWidth;
130     nw::ut::ResF32 m_AngleOffset;
131     nw::ut::ResF32 m_AngleSwing;
132     nw::ut::ResVec2 m_Scale;
133     nw::ut::ResBool m_FixedOffset;
134     nw::ut::ResBool m_EvenInterval;
135     u8              padding_0[2];
136 };
137 
138 
139 //--------------------------------------------------------------------------
140 //! @brief  パーティクルの発生形状(ディスク)を表すバイナリリソースクラスです。
141 //---------------------------------------------------------------------------
142 class ResParticleDiscForm : public ResParticleForm
143 {
144 public:
145     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleDiscForm) };
146     enum { SIGNATURE = NW_RES_SIGNATURE32('DISC') };
147 
148     NW_RES_CTOR_INHERIT( ResParticleDiscForm, ResParticleForm )
149 
150     NW_RES_FIELD_PRIMITIVE_DECL( f32, Inner )
151     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleWidth )
152     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleOffset )
153     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleSwing )
154     NW_RES_FIELD_VECTOR2_DECL( nw::math::VEC2, Scale )
155     NW_RES_FIELD_PRIMITIVE_DECL( bool, FixedOffset )
156     NW_RES_FIELD_PRIMITIVE_DECL( bool, EvenInterval )
157 
158     void    Setup();
159 };
160 
161 //! @details :private
162 struct ResParticlePointFormData : public ResParticleFormData
163 {
164 };
165 
166 
167 //--------------------------------------------------------------------------
168 //! @brief  パーティクルの発生形状(ポイント)を表すバイナリリソースクラスです。
169 //---------------------------------------------------------------------------
170 class ResParticlePointForm : public ResParticleForm
171 {
172 public:
173     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticlePointForm) };
174     enum { SIGNATURE = NW_RES_SIGNATURE32('POIN') };
175 
176     NW_RES_CTOR_INHERIT( ResParticlePointForm, ResParticleForm )
177 
178     void    Setup();
179 };
180 
181 //! @details :private
182 struct ResParticleRectangleFormData : public ResParticleFormData
183 {
184     nw::ut::ResF32 m_Inner;
185     nw::ut::ResVec2 m_Scale;
186     nw::ut::ResBool m_EvenInterval;
187     u8              padding_0[3];
188 };
189 
190 
191 //--------------------------------------------------------------------------
192 //! @brief  パーティクルの発生形状(レクタングル)を表すバイナリリソースクラスです。
193 //---------------------------------------------------------------------------
194 class ResParticleRectangleForm : public ResParticleForm
195 {
196 public:
197     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleRectangleForm) };
198     enum { SIGNATURE = NW_RES_SIGNATURE32('RECT') };
199 
200     NW_RES_CTOR_INHERIT( ResParticleRectangleForm, ResParticleForm )
201 
202     NW_RES_FIELD_PRIMITIVE_DECL( f32, Inner )
203     NW_RES_FIELD_VECTOR2_DECL( nw::math::VEC2, Scale )
204     NW_RES_FIELD_PRIMITIVE_DECL( bool, EvenInterval )
205 
206     void    Setup();
207 };
208 
209 //! @details :private
210 struct ResParticleSphereFormData : public ResParticleFormData
211 {
212     nw::ut::ResF32 m_Inner;
213     nw::ut::ResF32 m_AngleWidth;
214     nw::ut::ResF32 m_AngleOffset;
215     nw::ut::ResF32 m_AngleSwing;
216     nw::ut::ResVec3 m_Scale;
217     nw::ut::ResBool m_FixedOffset;
218     nw::ut::ResBool m_EvenInterval;
219     u8              padding_0[2];
220 };
221 
222 
223 //--------------------------------------------------------------------------
224 //! @brief  パーティクルの発生形状(スフィア)を表すバイナリリソースクラスです。
225 //---------------------------------------------------------------------------
226 class ResParticleSphereForm : public ResParticleForm
227 {
228 public:
229     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleSphereForm) };
230     enum { SIGNATURE = NW_RES_SIGNATURE32('SPHE') };
231 
232     NW_RES_CTOR_INHERIT( ResParticleSphereForm, ResParticleForm )
233 
234     NW_RES_FIELD_PRIMITIVE_DECL( f32, Inner )
235     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleWidth )
236     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleOffset )
237     NW_RES_FIELD_PRIMITIVE_DECL( f32, AngleSwing )
238     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Scale )
239     NW_RES_FIELD_PRIMITIVE_DECL( bool, FixedOffset )
240     NW_RES_FIELD_PRIMITIVE_DECL( bool, EvenInterval )
241 
242     void    Setup();
243 };
244 
245 } // namespace res
246 } // namespace gfx
247 } // namespace nw
248 
249 #endif // NW_GFX_RESPARTICLEFORM_H_
250