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