1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_ResParticleUpdater.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_RESPARTICLEUPDATER_H_
19 #define NW_GFX_RESPARTICLEUPDATER_H_
20 
21 #include <nw/ut/ut_ResUtil.h>
22 #include <nw/ut/ut_ResDictionary.h>
23 #include <nw/gfx/gfx_ParticleTime.h>
24 #include <nw/gfx/res/gfx_ResSceneObject.h>
25 #include <nw/gfx/res/gfx_ResParticleAnimation.h>
26 #include <nw/gfx/res/gfx_ResParticleAnimationOption.h>
27 #include <nw/gfx/res/gfx_ResParticleForm.h>
28 #include <nw/gfx/res/gfx_ResTypeInfo.h>
29 
30 namespace nw {
31 namespace gfx {
32 
33 class ParticleContext;
34 class ParticleSet;
35 
36 namespace res {
37 
38 //---------------------------------------------------------------------------
39 //! @brief パーティクルストリームの使用種別の定義です。
40 //---------------------------------------------------------------------------
41 enum ParticleUsage
42 {
43     PARTICLEUSAGE_INVALID = -1,      //!< 無効な値です。
44 
45     PARTICLEUSAGE_TRANSLATE = 0,     //!< トランスレートです。
46     PARTICLEUSAGE_SCALE,             //!< スケールです。
47     PARTICLEUSAGE_ROTATE,            //!< ローテートです。
48     PARTICLEUSAGE_COLOR,             //!< RGBカラーです。
49     PARTICLEUSAGE_ALPHA,             //!< アルファです。
50     PARTICLEUSAGE_TEXTURETRANSLATE0, //!< テクスチャ座標のトランスレートです。
51     PARTICLEUSAGE_TEXTURESCALE0,     //!< テクスチャ座標のスケールです。
52     PARTICLEUSAGE_TEXTUREROTATE0,    //!< テクスチャ座標のローテートです。
53     PARTICLEUSAGE_SCALE_EXT,         //!< スケール(拡張)です。
54 
55     PARTICLEUSAGE_ID,                //!< パーティクルIDです。
56     PARTICLEUSAGE_BIRTH,             //!< 生成した時刻です。
57     PARTICLEUSAGE_LIFE,              //!< 寿命です。
58     PARTICLEUSAGE_VELOCITY,          //!< 速度です。
59 
60     PARTICLEUSAGE_ACTIVEINDEX,       //!< 使用中の要素への間接参照インデックスです。
61     PARTICLEUSAGE_FREEINDEX,         //!< 使用可能な要素への間接参照インデックスです。
62 #ifdef NW_GFX_PARTICLE_COMPAT_1_1
63     PARTICLEUSAGE_NEG_TIMELIMIT,     //!< 消滅する時刻の負数(高速化のため)です。
64 #endif
65 
66     PARTICLEUSAGE_COUNT,             //!< 種別の個数です。
67 
68     PARTICLEUSAGE_IS_INT = INT_MAX
69 };
70 
71 //! @details :private
72 struct ResParticleUpdaterData
73 {
74     nw::ut::ResTypeInfo typeInfo;
75     nw::ut::ResBool m_IsResourceCopyEnabled;
76     nw::ut::ResBool m_UpdaterEnabled;
77     u8              padding_0[2];
78     nw::ut::ResS32 m_TargetStream;
79     nw::ut::Offset toParticleAnimation;
80 };
81 
82 
83 //--------------------------------------------------------------------------
84 //! @brief  パーティクルアップデータを表すバイナリリソースクラスです。
85 //--------------------------------------------------------------------------
86 class ResParticleUpdater : public nw::ut::ResCommon< ResParticleUpdaterData >
87 {
88 public:
89     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleUpdater) };
90     enum { SIGNATURE = NW_RES_SIGNATURE32('PUPD') };
91 
92     NW_RES_CTOR( ResParticleUpdater )
93 
NW_RES_FIELD_PRIMITIVE_DECL(bool,IsResourceCopyEnabled)94     NW_RES_FIELD_PRIMITIVE_DECL( bool, IsResourceCopyEnabled )
95     NW_RES_FIELD_PRIMITIVE_DECL( bool, UpdaterEnabled)
96     NW_RES_FIELD_PRIMITIVE_DECL( ParticleUsage, TargetStream )
97     NW_RES_FIELD_CLASS_DECL( ResParticleAnimation, ParticleAnimation )
98 
99     //---------------------------------------------------------------------------
100     //! @brief        インスタンスの型情報を取得します。
101     //!
102     //! @return       型情報です。
103     //---------------------------------------------------------------------------
104     nw::ut::ResTypeInfo     GetTypeInfo() const { return ref().typeInfo; }
105 };
106 
107 //! @details :private
108 struct ResParticleAccelarationUpdaterData : public ResParticleUpdaterData
109 {
110     nw::ut::ResF32 m_Factor;
111 };
112 
113 
114 //--------------------------------------------------------------------------
115 //! @brief  f32を乗算で更新するパーティクルアップデータを表すバイナリリソースクラスです。
116 //--------------------------------------------------------------------------
117 class ResParticleAccelarationUpdater : public ResParticleUpdater
118 {
119 public:
120     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleAccelarationUpdater) };
121     enum { SIGNATURE = NW_RES_SIGNATURE32('ACCE') };
122 
123     NW_RES_CTOR_INHERIT( ResParticleAccelarationUpdater, ResParticleUpdater )
124 
125     NW_RES_FIELD_PRIMITIVE_DECL( f32, Factor ) // GetFactor(), SetFactor()
126 };
127 
128 //! @details :private
129 struct ResParticleFloatUpdaterData : public ResParticleUpdaterData
130 {
131     nw::ut::ResF32 m_DefaultValue;
132 };
133 
134 
135 //--------------------------------------------------------------------------
136 //! @brief  f32を更新するパーティクルアップデータを表すバイナリリソースクラスです(基底クラス)。
137 //--------------------------------------------------------------------------
138 class ResParticleFloatUpdater : public ResParticleUpdater
139 {
140 public:
141     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleFloatUpdater) };
142     enum { SIGNATURE = NW_RES_SIGNATURE32('FLOA') };
143 
144     NW_RES_CTOR_INHERIT( ResParticleFloatUpdater, ResParticleUpdater )
145 
146     NW_RES_FIELD_PRIMITIVE_DECL( f32, DefaultValue )
147 };
148 
149 //! @details :private
150 struct ResParticleFloatImmediateUpdaterData : public ResParticleFloatUpdaterData
151 {
152 };
153 
154 
155 //--------------------------------------------------------------------------
156 //! @brief  f32を即値で更新するパーティクルアップデータを表すバイナリリソースクラスです。
157 //--------------------------------------------------------------------------
158 class ResParticleFloatImmediateUpdater : public ResParticleFloatUpdater
159 {
160 public:
161     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleFloatImmediateUpdater) };
162     enum { SIGNATURE = NW_RES_SIGNATURE32('FIMM') };
163 
164     NW_RES_CTOR_INHERIT( ResParticleFloatImmediateUpdater, ResParticleFloatUpdater )
165 };
166 
167 
168 //! @details :private
169 struct ResParticleFloatImmediate4KeyUpdaterData : public ResParticleUpdaterData
170 {
171     nw::ut::ResU32 m_InTime;
172     nw::ut::ResU32 m_OutTime;
173     nw::ut::ResS32 m_Value0;
174     nw::ut::ResS32 m_Value1;
175     nw::ut::ResS32 m_Value2;
176     nw::ut::ResS32 m_Value3;
177     nw::ut::ResS32 m_Value4;
178 };
179 
180 
181 //--------------------------------------------------------------------------
182 //! @brief  f32を4キーの即値で更新するパーティクルアップデータを表すバイナリリソースクラスです。
183 //--------------------------------------------------------------------------
184 class ResParticleFloatImmediate4KeyUpdater : public ResParticleUpdater
185 {
186 public:
187     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleFloatImmediate4KeyUpdater) };
188     enum { SIGNATURE = NW_RES_SIGNATURE32('FIM4') };
189 
190     NW_RES_CTOR_INHERIT( ResParticleFloatImmediate4KeyUpdater, ResParticleUpdater )
191 
192     NW_RES_FIELD_PRIMITIVE_DECL( u32, InTime )
193     NW_RES_FIELD_PRIMITIVE_DECL( u32, OutTime )
194     NW_RES_FIELD_PRIMITIVE_DECL( s32, Value0 )
195     NW_RES_FIELD_PRIMITIVE_DECL( s32, Value1 )
196     NW_RES_FIELD_PRIMITIVE_DECL( s32, Value2 )
197     NW_RES_FIELD_PRIMITIVE_DECL( s32, Value3 )
198     NW_RES_FIELD_PRIMITIVE_DECL( s32, Value4 )
199 };
200 
201 //! @details :private
202 struct ResParticleVector3Immediate4KeyUpdaterData : public ResParticleUpdaterData
203 {
204     nw::ut::ResU32 m_InTime;
205     nw::ut::ResU32 m_OutTime;
206     nw::ut::ResVec3 m_Value0;
207     nw::ut::ResVec3 m_Value1;
208     nw::ut::ResVec3 m_Value2;
209     nw::ut::ResVec3 m_Value3;
210     nw::ut::ResVec3 m_Value4;
211 };
212 
213 //--------------------------------------------------------------------------
214 //! @brief  VEC3を4キーの即値で更新するパーティクルアップデータを表すバイナリリソースクラスです。
215 //--------------------------------------------------------------------------
216 class ResParticleVector3Immediate4KeyUpdater : public ResParticleUpdater
217 {
218 public:
219     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleVector3Immediate4KeyUpdater) };
220     enum { SIGNATURE = NW_RES_SIGNATURE32('V3I4') };
221 
222     NW_RES_CTOR_INHERIT( ResParticleVector3Immediate4KeyUpdater, ResParticleUpdater )
223 
224     NW_RES_FIELD_PRIMITIVE_DECL( u32, InTime )
225     NW_RES_FIELD_PRIMITIVE_DECL( u32, OutTime )
226     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Value0 )
227     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Value1 )
228     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Value2 )
229     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Value3 )
230     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Value4 )
231 };
232 
233 
234 //! @details :private
235 struct ResParticleGeneralUpdaterData : public ResParticleUpdaterData
236 {
237 };
238 
239 //--------------------------------------------------------------------------
240 //! @brief  位置・速度を更新するパーティクルジェネラアップデータを表すバイナリリソースクラスです。
241 //--------------------------------------------------------------------------
242 class ResParticleGeneralUpdater : public ResParticleUpdater
243 {
244 public:
245     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleGeneralUpdater) };
246     enum { SIGNATURE = NW_RES_SIGNATURE32('GENE') };
247 
248     NW_RES_CTOR_INHERIT( ResParticleGeneralUpdater, ResParticleUpdater )
249 };
250 
251 //! @details :private
252 struct ResParticleGravityUpdaterData : public ResParticleUpdaterData
253 {
254     nw::ut::ResF32 m_Power;
255     nw::ut::ResVec3 m_Direction;
256 };
257 
258 
259 //--------------------------------------------------------------------------
260 //! @brief  重力のパーティクルアップデータを表すバイナリリソースクラスです。
261 //--------------------------------------------------------------------------
262 class ResParticleGravityUpdater : public ResParticleUpdater
263 {
264 public:
265     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleGravityUpdater) };
266     enum { SIGNATURE = NW_RES_SIGNATURE32('GRAV') };
267 
268     NW_RES_CTOR_INHERIT( ResParticleGravityUpdater, ResParticleUpdater )
269 
270     NW_RES_FIELD_PRIMITIVE_DECL( f32, Power )             // GetPower(), SetPower()
271     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Direction ) // GetDirection()
272 };
273 
274 //! @details :private
275 struct ResParticleSpinUpdaterData : public ResParticleUpdaterData
276 {
277     nw::ut::ResF32 m_Power;
278     nw::ut::ResVec3 m_Axis;
279 };
280 
281 
282 //--------------------------------------------------------------------------
283 //! @brief  スピンのパーティクルアップデータを表すバイナリリソースクラスです。
284 //--------------------------------------------------------------------------
285 class ResParticleSpinUpdater : public ResParticleUpdater
286 {
287 public:
288     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleSpinUpdater) };
289     enum { SIGNATURE = NW_RES_SIGNATURE32('SPIN') };
290 
291     NW_RES_CTOR_INHERIT( ResParticleSpinUpdater, ResParticleUpdater )
292 
293     NW_RES_FIELD_PRIMITIVE_DECL( f32, Power )             // GetPower(), SetPower()
294     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Axis ) // GetAxis()
295 };
296 
297 //! @details :private
298 struct ResParticleRandomUpdaterData : public ResParticleUpdaterData
299 {
300     nw::ut::ResVec3 m_Power;
301     nw::ut::ResS32 m_Interval;
302 };
303 
304 
305 //--------------------------------------------------------------------------
306 //! @brief  Vector3をランダム付きで更新するパーティクルアップデータを表すバイナリリソースクラスです。
307 //--------------------------------------------------------------------------
308 class ResParticleRandomUpdater : public ResParticleUpdater
309 {
310 public:
311     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleRandomUpdater) };
312     enum { SIGNATURE = NW_RES_SIGNATURE32('RNDU') };
313 
314     NW_RES_CTOR_INHERIT( ResParticleRandomUpdater, ResParticleUpdater )
315 
316     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Power ) // GetPower()
317     NW_RES_FIELD_PRIMITIVE_DECL( s32, Interval )             // GetInterval(), SetInterval()
318 };
319 
320 //! @details :private
321 struct ResParticleVector2ImmediateUpdaterData : public ResParticleUpdaterData
322 {
323     nw::ut::ResVec2 m_DefaultValue;
324 };
325 
326 
327 //--------------------------------------------------------------------------
328 //! @brief  Vector2を即値で更新するパーティクルアップデータを表すバイナリリソースクラスです。
329 //--------------------------------------------------------------------------
330 class ResParticleVector2ImmediateUpdater : public ResParticleUpdater
331 {
332 public:
333     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleVector2ImmediateUpdater) };
334     enum { SIGNATURE = NW_RES_SIGNATURE32('V2IM') };
335 
336     NW_RES_CTOR_INHERIT( ResParticleVector2ImmediateUpdater, ResParticleUpdater )
337 
338     NW_RES_FIELD_VECTOR2_DECL( nw::math::VEC2, DefaultValue )
339 };
340 
341 //! @details :private
342 struct ResParticleVector3UpdaterData : public ResParticleUpdaterData
343 {
344     nw::ut::ResVec3 m_DefaultValue;
345 };
346 
347 
348 //--------------------------------------------------------------------------
349 //! @brief  Vector3を更新するパーティクルアップデータを表すバイナリリソースクラスです(基底クラス)。
350 //--------------------------------------------------------------------------
351 class ResParticleVector3Updater : public ResParticleUpdater
352 {
353 public:
354     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleVector3Updater) };
355     enum { SIGNATURE = NW_RES_SIGNATURE32('VEC3') };
356 
357     NW_RES_CTOR_INHERIT( ResParticleVector3Updater, ResParticleUpdater )
358 
359     NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, DefaultValue )
360 };
361 
362 //! @details :private
363 struct ResParticleVector3AdditiveUpdaterData : public ResParticleVector3UpdaterData
364 {
365 };
366 
367 
368 //--------------------------------------------------------------------------
369 //! @brief  Vector3を加算で更新するパーティクルアップデータを表すバイナリリソースクラスです。
370 //--------------------------------------------------------------------------
371 class ResParticleVector3AdditiveUpdater : public ResParticleVector3Updater
372 {
373 public:
374     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleVector3AdditiveUpdater) };
375     enum { SIGNATURE = NW_RES_SIGNATURE32('V3AD') };
376 
377     NW_RES_CTOR_INHERIT( ResParticleVector3AdditiveUpdater, ResParticleVector3Updater )
378 };
379 
380 //! @details :private
381 struct ResParticleVector3ImmediateUpdaterData : public ResParticleVector3UpdaterData
382 {
383 };
384 
385 
386 //--------------------------------------------------------------------------
387 //! @brief  Vector3を即値で更新するパーティクルアップデータを表すバイナリリソースクラスです。
388 //--------------------------------------------------------------------------
389 class ResParticleVector3ImmediateUpdater : public ResParticleVector3Updater
390 {
391 public:
392     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleVector3ImmediateUpdater) };
393     enum { SIGNATURE = NW_RES_SIGNATURE32('V3IM') };
394 
395     NW_RES_CTOR_INHERIT( ResParticleVector3ImmediateUpdater, ResParticleVector3Updater )
396 };
397 
398 //! @details :private
399 struct ResParticleVector3RandomAdditiveUpdaterData : public ResParticleVector3UpdaterData
400 {
401 };
402 
403 
404 //--------------------------------------------------------------------------
405 //! @brief  Vector3ランダム加算付きパーティクルアップデータを表すバイナリリソースクラスです。
406 //--------------------------------------------------------------------------
407 class ResParticleVector3RandomAdditiveUpdater : public ResParticleVector3Updater
408 {
409 public:
410     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleVector3RandomAdditiveUpdater) };
411     enum { SIGNATURE = NW_RES_SIGNATURE32('V3RA') };
412 
413     NW_RES_CTOR_INHERIT( ResParticleVector3RandomAdditiveUpdater, ResParticleVector3Updater )
414 };
415 
416 //! @details :private
417 struct ResParticleRotateUpVectorUpdaterData : public ResParticleUpdaterData
418 {
419     nw::ut::ResU32 m_Source;
420 };
421 
422 
423 //--------------------------------------------------------------------------
424 //! @brief  アップベクトル方向へ回転するパーティクルアップデータを表すバイナリリソースクラスです。
425 //--------------------------------------------------------------------------
426 class ResParticleRotateUpVectorUpdater : public ResParticleUpdater
427 {
428 public:
429     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleRotateUpVectorUpdater) };
430     enum { SIGNATURE = NW_RES_SIGNATURE32('RUVU') };
431 
432     enum ParticleRotateUpVectorSource
433     {
434         SOURCE_VELOCITY = 0,
435         SOURCE_DISTANCE
436     };
437 
438     NW_RES_CTOR_INHERIT( ResParticleRotateUpVectorUpdater, ResParticleUpdater )
439 
440     NW_RES_FIELD_PRIMITIVE_DECL( ParticleRotateUpVectorSource, Source )
441 };
442 
443 //! テクスチャの分割数の定義です。
444 enum ParticleTexturePatternUpdaterDivisionType
445 {
446     Division1 = 1,
447     Division2 = 2,
448     Division4 = 4,
449     Division8 = 8,
450     Division16 = 16
451 };
452 
453 //! @details :private
454 struct ResParticleTexturePatternUpdaterData : public ResParticleUpdaterData
455 {
456     nw::ut::ResU32 m_DivisionX;
457     nw::ut::ResU32 m_DivisionY;
458     nw::ut::ResS32 m_TextureIndex;
459 };
460 
461 
462 //--------------------------------------------------------------------------
463 //! @brief  テクスチャパターンパーティクルアップデータを表すバイナリリソースクラスです。
464 //--------------------------------------------------------------------------
465 class ResParticleTexturePatternUpdater : public ResParticleUpdater
466 {
467 public:
468     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleTexturePatternUpdater) };
469     enum { SIGNATURE = NW_RES_SIGNATURE32('TPAT') };
470 
471     NW_RES_CTOR_INHERIT( ResParticleTexturePatternUpdater, ResParticleUpdater )
472 
473     NW_RES_FIELD_PRIMITIVE_DECL( ParticleTexturePatternUpdaterDivisionType, DivisionX )
474     NW_RES_FIELD_PRIMITIVE_DECL( ParticleTexturePatternUpdaterDivisionType, DivisionY )
475     NW_RES_FIELD_PRIMITIVE_DECL( u32, TextureIndex )
476 };
477 
478 //! @details :private
479 struct ResParticleChildUpdaterOptionData
480 {
481     nw::ut::ResTypeInfo typeInfo;
482 };
483 
484 
485 //--------------------------------------------------------------------------
486 //! @brief  パーティクルチャイルドアップデータのオプションを表すバイナリリソースクラスです(基底クラス)。
487 //--------------------------------------------------------------------------
488 class ResParticleChildUpdaterOption : public nw::ut::ResCommon< ResParticleChildUpdaterOptionData >
489 {
490 public:
491     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleChildUpdaterOption) };
492     enum { SIGNATURE = NW_RES_SIGNATURE32('COPT') };
493 
NW_RES_CTOR(ResParticleChildUpdaterOption)494     NW_RES_CTOR( ResParticleChildUpdaterOption )
495 
496     //---------------------------------------------------------------------------
497     //! @brief        インスタンスの型情報を取得します。
498     //!
499     //! @return       型情報です。
500     //---------------------------------------------------------------------------
501     nw::ut::ResTypeInfo     GetTypeInfo() const { return ref().typeInfo; }
502 
503 #ifdef NW_GFX_PARTICLE_COMPAT_1_1
504     bool CheckTiming(ParticleTime birth, ParticleTime life, ParticleTime limit, ParticleTime prevTime, ParticleTime currentTime);
505 #else
506     bool CheckTiming(ParticleTime birth, ParticleTime life, ParticleTime prevTime, ParticleTime currentTime);
507 #endif
508 };
509 
510 //! @details :private
511 struct ResParticleChildUpdaterFirstUpdateOptionData : public ResParticleChildUpdaterOptionData
512 {
513 };
514 
515 
516 //--------------------------------------------------------------------------
517 //! @brief  パーティクルチャイルドで、親の生成時を表すバイナリリソースクラスです。
518 //--------------------------------------------------------------------------
519 class ResParticleChildUpdaterFirstUpdateOption : public ResParticleChildUpdaterOption
520 {
521 public:
522     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleChildUpdaterFirstUpdateOption) };
523     enum { SIGNATURE = NW_RES_SIGNATURE32('COBU') };
524 
525     NW_RES_CTOR_INHERIT( ResParticleChildUpdaterFirstUpdateOption, ResParticleChildUpdaterOption )
526 };
527 
528 //! @details :private
529 struct ResParticleChildUpdaterFinalUpdateOptionData : public ResParticleChildUpdaterOptionData
530 {
531 };
532 
533 
534 //--------------------------------------------------------------------------
535 //! @brief  パーティクルチャイルドで、親の消滅時を表すバイナリリソースクラスです。
536 //--------------------------------------------------------------------------
537 class ResParticleChildUpdaterFinalUpdateOption : public ResParticleChildUpdaterOption
538 {
539 public:
540     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleChildUpdaterFinalUpdateOption) };
541     enum { SIGNATURE = NW_RES_SIGNATURE32('COFU') };
542 
543     NW_RES_CTOR_INHERIT( ResParticleChildUpdaterFinalUpdateOption, ResParticleChildUpdaterOption )
544 };
545 
546 //! @details :private
547 struct ResParticleChildUpdaterIntervalOptionData : public ResParticleChildUpdaterOptionData
548 {
549     nw::ut::ResF32 m_Start;
550     nw::ut::ResF32 m_End;
551     nw::ut::ResS32 m_Interval;
552 };
553 
554 
555 //--------------------------------------------------------------------------
556 //! @brief  パーティクルチャイルドで、寿命の割合で間隔を表すバイナリリソースクラスです。
557 //--------------------------------------------------------------------------
558 class ResParticleChildUpdaterIntervalOption : public ResParticleChildUpdaterOption
559 {
560 public:
561     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleChildUpdaterIntervalOption) };
562     enum { SIGNATURE = NW_RES_SIGNATURE32('COIN') };
563 
564     NW_RES_CTOR_INHERIT( ResParticleChildUpdaterIntervalOption, ResParticleChildUpdaterOption )
565 
566     NW_RES_FIELD_PRIMITIVE_DECL( f32, Start )
567     NW_RES_FIELD_PRIMITIVE_DECL( f32, End )
568     NW_RES_FIELD_PRIMITIVE_DECL( s32, Interval )
569 };
570 
571 //! @details :private
572 struct ResParticleChildUpdaterFrameOptionData : public ResParticleChildUpdaterOptionData
573 {
574     nw::ut::ResS32 m_Start;
575     nw::ut::ResS32 m_End;
576     nw::ut::ResS32 m_Interval;
577 };
578 
579 
580 //--------------------------------------------------------------------------
581 //! @brief  パーティクルチャイルド、フレームで間隔を表すバイナリリソースクラスです。
582 //--------------------------------------------------------------------------
583 class ResParticleChildUpdaterFrameOption : public ResParticleChildUpdaterOption
584 {
585 public:
586     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleChildUpdaterFrameOption) };
587     enum { SIGNATURE = NW_RES_SIGNATURE32('COFN') };
588 
589     NW_RES_CTOR_INHERIT( ResParticleChildUpdaterFrameOption, ResParticleChildUpdaterOption )
590 
591     NW_RES_FIELD_PRIMITIVE_DECL( s32, Start )
592     NW_RES_FIELD_PRIMITIVE_DECL( s32, End )
593     NW_RES_FIELD_PRIMITIVE_DECL( s32, Interval )
594 };
595 
596 //! @details :private
597 struct ResParticleChildUpdaterData : public ResParticleUpdaterData
598 {
599     nw::ut::BinString toParticleSetPath;
600     nw::ut::Offset toParticleForm;
601     nw::ut::Offset toTiming;
602     nw::ut::ResS32 m_EmissionRatio;
603 };
604 
605 
606 //--------------------------------------------------------------------------
607 //! @brief  パーティクルチャイルドアップデータを表すバイナリリソースクラスです。
608 //--------------------------------------------------------------------------
609 class ResParticleChildUpdater : public ResParticleUpdater
610 {
611 public:
612     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleChildUpdater) };
613     enum { SIGNATURE = NW_RES_SIGNATURE32('CHLD') };
614 
615     NW_RES_CTOR_INHERIT( ResParticleChildUpdater, ResParticleUpdater )
616 
617     NW_RES_FIELD_STRING_DECL( ParticleSetPath )                // GetParticleSetPath()
618     NW_RES_FIELD_CLASS_DECL( ResParticleForm, ParticleForm)    // GetParticleForm()
619     NW_RES_FIELD_CLASS_DECL( ResParticleChildUpdaterOption, Timing)    // GetTiming()
620     NW_RES_FIELD_PRIMITIVE_DECL( s32, EmissionRatio )            // GetEmissionRatio()
621 };
622 
623 //! @details :private
624 struct ResParticleUserUpdaterData : public ResParticleUpdaterData
625 {
626     nw::ut::ResU32 m_UserParameter;
627 };
628 
629 
630 //--------------------------------------------------------------------------
631 //! @brief  ユーザー定義のパーティクルアップデータを表すバイナリリソースクラスです。
632 //--------------------------------------------------------------------------
633 class ResParticleUserUpdater : public ResParticleUpdater
634 {
635 public:
636     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleUserUpdater) };
637     enum { SIGNATURE = NW_RES_SIGNATURE32('USER') };
638 
639     typedef void (*UserFunctionType)(
640         ParticleContext*,
641         ParticleSet*,
642         const ResParticleUserUpdater*,
643         f32,
644         f32
645     );
646 
647     NW_RES_CTOR_INHERIT( ResParticleUserUpdater, ResParticleUpdater )
648 
649     NW_RES_FIELD_PRIMITIVE_DECL( u32, UserParameter )            // GetUserParameter()
650 };
651 
652 } // namespace res
653 } // namespace gfx
654 } // namespace nw
655 
656 #endif // NW_GFX_RESPARTICLEUPDATER_H_
657