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