1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_ResParticleSet.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_RESPARTICLESET_H_
19 #define NW_GFX_RESPARTICLESET_H_
20 
21 #include <nw/ut/ut_ResUtil.h>
22 #include <nw/gfx/res/gfx_ResSceneObject.h>
23 #include <nw/gfx/res/gfx_ResParticleCollection.h>
24 #include <nw/gfx/res/gfx_ResParticleShape.h>
25 #include <nw/gfx/res/gfx_ResParticleInitializer.h>
26 #include <nw/gfx/res/gfx_ResParticleUpdater.h>
27 #include <nw/gfx/res/gfx_ResParticleShapeBuilder.h>
28 #include <nw/gfx/res/gfx_ResTypeInfo.h>
29 
30 namespace nw {
31 namespace gfx {
32 namespace res {
33 
34 typedef ut::ResArrayClass<ResParticleInitializer>::type::iterator ResParticleInitializerArrayIterator;
35 typedef ut::ResArrayClass<const ResParticleInitializer>::type::const_iterator ResParticleInitializerArrayConstIterator;
36 typedef ut::ResArrayClass<ResParticleInitializer>::type ResParticleInitializerArray;
37 typedef ut::ResArrayClass<const ResParticleInitializer>::type ResParticleInitializerArrayConst;
38 
39 typedef ut::ResArrayClass<ResParticleUpdater>::type::iterator ResParticleUpdaterArrayIterator;
40 typedef ut::ResArrayClass<const ResParticleUpdater>::type::const_iterator ResParticleUpdaterArrayConstIterator;
41 typedef ut::ResArrayClass<ResParticleUpdater>::type ResParticleUpdaterArray;
42 typedef ut::ResArrayClass<const ResParticleUpdater>::type ResParticleUpdaterArrayConst;
43 
44 //! @details :private
45 struct ResParticleSetData : public ResSceneNodeData
46 {
47     nw::ut::Offset toParticleCollection;
48     nw::ut::ResS32 m_ParticleInitializersTableCount;
49     nw::ut::Offset toParticleInitializersTable;
50     nw::ut::ResS32 m_ParticleUpdatersTableCount;
51     nw::ut::Offset toParticleUpdatersTable;
52     nw::ut::Offset toParticleShapeBuilder;
53     nw::ut::ResS32 m_ParticleShapeIndex;
54     nw::ut::ResU32 m_ParticleSetPriority;
55     nw::ut::ResBool m_IsForceWorld;
56     nw::ut::ResBool m_IsBufferFlushEnabled;
57     nw::ut::ResBool m_IsInheritParentVelocity;
58 };
59 
60 
61 //--------------------------------------------------------------------------
62 //! @brief  パーティクルセットを表すバイナリリソースクラスです。
63 //--------------------------------------------------------------------------
64 class ResParticleSet : public ResSceneNode
65 {
66 public:
67     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleSet) };
68     enum { SIGNATURE = NW_RES_SIGNATURE32('PSET') };
69 
70     NW_RES_CTOR_INHERIT( ResParticleSet, ResSceneNode )
71 
72     NW_RES_FIELD_CLASS_DECL( ResParticleCollection, ParticleCollection )         // GetParticleCollection()
73     NW_RES_FIELD_CLASS_LIST_DECL( ResParticleInitializer, ParticleInitializers ) // GetParticleInitializers(int idx), GetParticleInitializersCount()
74     NW_RES_FIELD_CLASS_LIST_DECL( ResParticleUpdater, ParticleUpdaters )         // GetParticleUpdaters(int idx), GetParticleUpdatersCount()
75     NW_RES_FIELD_CLASS_DECL( ResParticleShapeBuilder, ParticleShapeBuilder )         // GetParticleShpaBuilder()
76     NW_RES_FIELD_PRIMITIVE_DECL( s32, ParticleShapeIndex)                            // GetParticleShapeIndex()
77     NW_RES_FIELD_PRIMITIVE_DECL( u32, ParticleSetPriority)                       // GetParticleSetPriority()
78     NW_RES_FIELD_PRIMITIVE_DECL( bool, IsForceWorld)                             // GetIsForceWorld()
79     NW_RES_FIELD_PRIMITIVE_DECL( bool, IsBufferFlushEnabled)                     // GetIsBufferFlushEnabled()
80     NW_RES_FIELD_PRIMITIVE_DECL( bool, IsInheritParentVelocity)                     // GetIsInheritParentVelocity()
81 
82     void    Setup();
83 };
84 typedef nw::ut::ResArrayPatricia<ResParticleSet>::type  ResParticleSetArray;
85 
86 } // namespace res
87 } // namespace gfx
88 } // namespace nw
89 
90 #endif // NW_GFX_RESPARTICLESET_H_
91