1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_ResParticleCollection.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: 19592 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_GFX_RESPARTICLECOLLECTION_H_
17 #define NW_GFX_RESPARTICLECOLLECTION_H_
18 
19 #include <nw/ut/ut_ResUtil.h>
20 #include <nw/ut/ut_ResDictionary.h>
21 #include <nw/gfx/res/gfx_ResParticleUpdater.h>
22 
23 namespace nw {
24 namespace gfx {
25 namespace res {
26 
27 //! @details :private
28 struct ResParticleAttributeData
29 {
30     nw::ut::ResTypeInfo typeInfo;
31     nw::ut::ResS32 m_Usage;
32 };
33 
34 
35 //--------------------------------------------------------------------------
36 //! @brief  パーティクルのアトリビュートを表すバイナリリソースクラスです。
37 //---------------------------------------------------------------------------
38 class ResParticleAttribute : public nw::ut::ResCommon< ResParticleAttributeData >
39 {
40 public:
41     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleAttribute) };
42     enum { SIGNATURE = NW_RES_SIGNATURE32('PSAT') };
43 
44     NW_RES_CTOR( ResParticleAttribute )
45 
NW_RES_FIELD_PRIMITIVE_DECL(s32,Usage)46     NW_RES_FIELD_PRIMITIVE_DECL( s32, Usage )
47 
48     //---------------------------------------------------------------------------
49     //! @brief        インスタンスの型情報を取得します。
50     //!
51     //! @return       型情報です。
52     //---------------------------------------------------------------------------
53     nw::ut::ResTypeInfo     GetTypeInfo() const { return ref().typeInfo; }
54 };
55 
56 typedef nw::ut::ResArrayClass<ResParticleAttribute>::type  ResParticleAttributeArray;
57 
58 //! @details :private
59 struct ResParticleStreamAttributeData : public ResParticleAttributeData
60 {
61 };
62 
63 
64 //--------------------------------------------------------------------------
65 //! @brief  パーティクルストリームのアトリビュートを表すバイナリリソースクラスです。
66 //---------------------------------------------------------------------------
67 class ResParticleStreamAttribute : public ResParticleAttribute
68 {
69 public:
70     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleStreamAttribute) };
71     enum { SIGNATURE = NW_RES_SIGNATURE32('PSST') };
72 
73     NW_RES_CTOR_INHERIT( ResParticleStreamAttribute, ResParticleAttribute )
74 };
75 
76 //! @details :private
77 struct ResParticleParameterAttributeData : public ResParticleAttributeData
78 {
79     nw::ut::ResS32 m_Dimension;
80     nw::ut::ResS32 m_DataTableCount;
81     nw::ut::Offset toDataTable;
82 };
83 
84 
85 //--------------------------------------------------------------------------
86 //! @brief  パーティクルパラメータのアトリビュートを表すバイナリリソースクラスです。
87 //---------------------------------------------------------------------------
88 class ResParticleParameterAttribute : public ResParticleAttribute
89 {
90 public:
91     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleParameterAttribute) };
92     enum { SIGNATURE = NW_RES_SIGNATURE32('PSPA') };
93 
NW_RES_CTOR_INHERIT(ResParticleParameterAttribute,ResParticleAttribute)94     NW_RES_CTOR_INHERIT( ResParticleParameterAttribute, ResParticleAttribute )
95 
96     NW_RES_FIELD_PRIMITIVE_DECL( s32, Dimension )
97     NW_RES_FIELD_PRIMITIVE_LIST_DECL( f32, Data )
98 
99     //---------------------------------------------------------------------------
100     //! @brief        インスタンスの型情報を取得します。
101     //!
102     //! @return       型情報です。
103     //---------------------------------------------------------------------------
104     nw::ut::ResTypeInfo     GetTypeInfo() const { return ref().typeInfo; }
105 };
106 
107 //! @details :private
108 struct ResParticleCollectionData
109 {
110     nw::ut::ResS32 m_Capacity;
111     nw::ut::ResS32 m_AttributesTableCount;
112     nw::ut::Offset toAttributesTable;
113 };
114 
115 
116 
117 //--------------------------------------------------------------------------
118 //! @brief  パーティクルコレクションを表すバイナリリソースクラスです。
119 //---------------------------------------------------------------------------
120 class ResParticleCollection : public nw::ut::ResCommon< ResParticleCollectionData >
121 {
122 public:
123     NW_RES_CTOR( ResParticleCollection )
124 
125     NW_RES_FIELD_PRIMITIVE_DECL( s32, Capacity )
126     NW_RES_FIELD_CLASS_LIST_DECL( ResParticleAttribute, Attributes )
127 };
128 
129 } // namespace res
130 } // namespace gfx
131 } // namespace nw
132 
133 #endif // NW_GFX_RESPARTICLECOLLECTION_H_
134