Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
// Iwa_ParticlesManager for Marnie
Toshihiro Shimizu 890ddd
// based on ParticlesManager by Digital Video
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef IWA_PARTICLES_CONTAINER
Toshihiro Shimizu 890ddd
#define IWA_PARTICLES_CONTAINER
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tsmartpointer.h"
Toshihiro Shimizu 890ddd
#include "trenderresourcemanager.h"
Toshihiro Shimizu 890ddd
#include "trandom.h"
Toshihiro Shimizu 890ddd
#include "iwa_particles.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qthreadstorage></qthreadstorage>
Toshihiro Shimizu 890ddd
#include <qmutex></qmutex>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//  Forward declarations
Toshihiro Shimizu 890ddd
class Iwa_Particle;
Toshihiro Shimizu 890ddd
class TRandom;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "iwa_particlesengine.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class Iwa_ParticlesManager : public TRenderResourceManager {
Shinya Kitaoka 120a6e
  T_RENDER_RESOURCE_MANAGER
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  struct FxData;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  struct FrameData {
Shinya Kitaoka 120a6e
    FxData *m_fxData;
Shinya Kitaoka 120a6e
    double m_frame;
Shinya Kitaoka 120a6e
    TRandom m_random;
Shinya Kitaoka 120a6e
    std::list<iwa_particle> m_particles;</iwa_particle>
Shinya Kitaoka 120a6e
    bool m_calculated;
Shinya Kitaoka 120a6e
    int m_maxTrail;
Shinya Kitaoka 120a6e
    int m_totalParticles;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    /*- しきつめ情報 -*/
Shinya Kitaoka 120a6e
    QList<particleorigin> m_particleOrigins;</particleorigin>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    FrameData(FxData *fxData);
Shinya Kitaoka 120a6e
    ~FrameData();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    void buildMaxTrail();
Shinya Kitaoka 120a6e
    void clear();
Shinya Kitaoka 120a6e
  };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  struct FxData : public TSmartObject {
Shinya Kitaoka 120a6e
    DECLARE_CLASS_CODE
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    QThreadStorage<framedata *=""> m_frames;</framedata>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    FxData();
Shinya Kitaoka 120a6e
  };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  Iwa_ParticlesManager();
Shinya Kitaoka 120a6e
  ~Iwa_ParticlesManager();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static Iwa_ParticlesManager *instance();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  FrameData *data(unsigned long fxId);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool isCached(unsigned long fxId);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  std::map<unsigned *="" fxdata="" long,=""> m_fxs;</unsigned>
Shinya Kitaoka 120a6e
  QMutex m_mutex;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int m_renderStatus;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void onRenderStatusStart(int renderStatus);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif