/*---------------------------------------------------------------------------* Project: NintendoWare File: gfx_ResParticleModel.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Revision: 19618 $ *---------------------------------------------------------------------------*/ #ifndef NW_GFX_RESPARTICLEMODEL_H_ #define NW_GFX_RESPARTICLEMODEL_H_ #include #include #include #include #include #include #include namespace nw { namespace gfx { namespace res { //! @details :private struct ResParticleModelData : public ResModelData { nw::ut::ResS32 m_ParticleSetsTableCount; nw::ut::Offset toParticleSetsTable; }; //-------------------------------------------------------------------------- //! @brief パーティクルモデルを表すバイナリリソースクラスです。 //-------------------------------------------------------------------------- class ResParticleModel : public ResModel { public: enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResParticleModel) }; enum { SIGNATURE = NW_RES_SIGNATURE32('PMDL') }; enum { BINARY_REVISION = REVISION_RES_EMITTER }; NW_RES_CTOR_INHERIT( ResParticleModel, ResModel ) NW_RES_FIELD_CLASS_LIST_DECL( ResParticleSet, ParticleSets ) // GetParticleSets(int idx), GetParticleSetsCount() void Setup(); //--------------------------------------------------------------------------- //! @brief ResParticleModel 内の全ての ResParticleSet を巡回して TFunction を適用します。 //! //! @tparam TFunction ResParticleSet を引数に取る関数(オブジェクト)の型です。 //! @param[in] function 適応する関数(オブジェクト)です。 //--------------------------------------------------------------------------- template void ForeachParticleSet(TFunction function) { if (this->IsValid()) { for (s32 i = 0; i < this->GetParticleSetsCount(); ++i) { ResParticleSet resParticleSet = this->GetParticleSets(i); function(resParticleSet); } } } }; } // namespace res } // namespace gfx } // namespace nw #endif // NW_GFX_RESPARTICLEMODEL_H_