| 1 |
#ifndef CMODELPLUGIN_H_INCLUDED |
| 2 |
#define CMODELPLUGIN_H_INCLUDED |
| 3 |
|
| 4 |
#include "CLensFlare.h" |
| 5 |
#include "CParticle.h" |
| 6 |
#include "CSoundEffector.h" |
| 7 |
#include "CModelSwitch.h" |
| 8 |
#include "CTextureAnimation.h" |
| 9 |
#include "CNamedObject.h" |
| 10 |
#include "CPlugin.h" |
| 11 |
|
| 12 |
class CMoverState; |
| 13 |
|
| 14 |
/* |
| 15 |
* モデルプラグイン |
| 16 |
*/ |
| 17 |
class CModelPlugin: public CPlugin{ |
| 18 |
protected: |
| 19 |
vector<int> m_TempSwitch; // 一時スイッチバッファ |
| 20 |
int m_SelectSwitchID; // 選択されているスイッチ番号 |
| 21 |
int m_PartsNum; // パーツ数 |
| 22 |
CModelSwitch *m_SelectSwitch; // 選択されているスイッチ |
| 23 |
CModelInst *m_LinkInst; // リンクインスタンス |
| 24 |
list<CModelSwitch> m_ModelSwitch; // モデルスイッチ |
| 25 |
list<CTextureAnimation> m_Animation; // テクスチャアニメーション |
| 26 |
list<CMoverState *> m_MoverState; // ムーバー状態 |
| 27 |
list<CHeadlight> m_Headlight; // ヘッドライト |
| 28 |
list<CParticle> m_Particle; // パーティクル |
| 29 |
list<CSoundEffector> m_SoundEffector; // サウンドエフェクタ |
| 30 |
CEffectorSwitchEntry m_Effector; // エフェクタ |
| 31 |
public: |
| 32 |
CModelPlugin(char *); |
| 33 |
virtual ~CModelPlugin(){} |
| 34 |
virtual char *DirName() = 0; |
| 35 |
virtual char *TextName2() = 0; |
| 36 |
virtual bool Load() = 0; |
| 37 |
virtual void SetPreview() = 0; |
| 38 |
virtual CNamedObject *FindObject(const string &) = 0; |
| 39 |
virtual bool IsSoundEnabled() = 0; |
| 40 |
CMoverState **AddMover(){ |
| 41 |
m_MoverState.push_back(NULL); |
| 42 |
return &*--m_MoverState.end(); |
| 43 |
} |
| 44 |
char *ReadModelSwitch(char *); |
| 45 |
char *ReadEffect(char *); |
| 46 |
CHeadlight *AddHeadlight(const CHeadlight &headlight){ |
| 47 |
m_Headlight.push_back(headlight); |
| 48 |
return &*m_Headlight.rbegin(); |
| 49 |
} |
| 50 |
CParticle *AddParticle(const CParticle &particle){ |
| 51 |
m_Particle.push_back(particle); |
| 52 |
return &*m_Particle.rbegin(); |
| 53 |
} |
| 54 |
CSoundEffector *AddSoundEffector(const CSoundEffector &soundeffector){ |
| 55 |
m_SoundEffector.push_back(soundeffector); |
| 56 |
return &*m_SoundEffector.rbegin(); |
| 57 |
} |
| 58 |
void LoadData(); |
| 59 |
CModelSwitch *FindModelSwitch(const string &); |
| 60 |
CModelSwitch *GetModelSwitch(int); |
| 61 |
CTextureAnimation *FindAnimation(const string &); |
| 62 |
void ListSwitch(CListView *, CListView *, CModelInst *); |
| 63 |
void EditSwitch(CListView *, CListView *); |
| 64 |
bool SetSwitch(vector<int> &); |
| 65 |
void SetSwitch(CModelInst *); |
| 66 |
void CopySwitch(vector<int> &); |
| 67 |
void SetTempSwitch(){ SetSwitch(m_TempSwitch); } |
| 68 |
void StoreTempSwitch(){ CopySwitch(m_TempSwitch); } |
| 69 |
void CheckGroupCommonSwitch(CModelInst *, CModelSwitch *, int); |
| 70 |
void CheckGroupCommonSwitchAll(CModelInst *, CModelInst *); |
| 71 |
void SetPartsInst(CModelInst *); |
| 72 |
void SetAnimation(CModelInst *); |
| 73 |
void SetMoverState(CModelInst *); |
| 74 |
void LoadSoundWave(CModelInst *); |
| 75 |
CModelInst *GetLinkInst(){ return m_LinkInst; } |
| 76 |
void FreeInst(){ m_LinkInst = NULL; } |
| 77 |
void AddPartsNum(int n){ m_PartsNum += n; } |
| 78 |
int GetPartsNum(){ return m_PartsNum; } |
| 79 |
int GetMoverNum(){ return m_MoverState.size(); } |
| 80 |
int GetAnimationNum(){ return m_Animation.size(); } |
| 81 |
int GetParticleNum(){ return m_Particle.size(); } |
| 82 |
int GetSoundNum(){ return m_SoundEffector.size(); } |
| 83 |
void SimulateEffect(CModelInst *); |
| 84 |
CPLUGIN_CASTFUNC(CModelPlugin); |
| 85 |
}; |
| 86 |
|
| 87 |
/* |
| 88 |
* モデルプラグインリスト |
| 89 |
*/ |
| 90 |
class CModelPluginList: public CPluginList{ |
| 91 |
protected: |
| 92 |
public: |
| 93 |
virtual char *DirName() = 0; |
| 94 |
virtual char *TextName2() = 0; |
| 95 |
virtual CPlugin *NewEntry(char *) = 0; |
| 96 |
CPLUGINLIST_CASTFUNC(CModelPlugin); |
| 97 |
}; |
| 98 |
|
| 99 |
#endif |