#ifndef _BGMController_H_ #define _BGMController_H_ #include "STL.h" /////////////////////////////////////////////////////////////////////////////////// // class ITriggerEvent; class CRegionTrigger; struct IDirectSound8; struct D3DXVECTOR3; struct IDirect3DDevice8; struct SVector2; typedef struct _iobuf FILE; typedef vector TRIGGERLIST; typedef vector POLYGON; typedef pair TRIGGERREGION; typedef vector TRIGGERREGIONS; /////////////////////////////////////////////////////////////////////////////////// // class CBGMController { protected: typedef vector EVENT; typedef vector EVENTS; typedef pair EVENTARGUNIT; typedef vector EVENTARG; typedef vector EVENTARGS; typedef vector OBJIDS; typedef vector CONTAINER_OBJID; typedef vector VERTEXVECTOR; typedef vector TRIGGERVERTEXES; CRegionTrigger * m_pRegionTrigger; EVENTS * m_pEvents; EVENTARGS * m_pEventArgs; unsigned m_iTriggerSelected; unsigned m_iPointSelected; unsigned m_iLastDeleted; TRIGGERREGIONS * m_pTriggerRegions; CONTAINER_OBJID * m_pContainer_ObjID; TRIGGERLIST const * m_pPrevTrigger; TRIGGERVERTEXES * m_pVertexes; protected: CBGMController( IDirectSound8 * ); CBGMController( const CBGMController & ); CBGMController & operator=( const CBGMController & ); void BeginEvent( int ); void EndEvent( int ); void AddPointToVertexes( unsigned, float x, float y, float z ); void MovePointAtVertexes( unsigned, unsigned, float x, float y, float z ); void DeletePointAtVertexes( unsigned, unsigned ); public: static CBGMController & GetInstance( IDirectSound8 * = 0 ); ~CBGMController(); void Create( const char * szFilename, bool forEdit = false ); void Create( FILE *, bool forEdit = false ); void Save( const char * szFilename ); void Save( FILE * ); void Destroy(); void DestroyAllEvents(); void Update( float x, float y, float z ); //Æ®¸®°Å ¿¡µðÆÃÀ» À§ÇÑ ÇÔ¼öµé bool IsValidTriggerSelected(); bool IsValidPointSelected(); unsigned AddTrigger(); void DeleteTrigger(); bool SelectTrigger( unsigned ); unsigned GetSelectTrigger() { return m_iTriggerSelected; } int AddEvent( int eventID, const char * szArg ); bool SetEvent( int Event, int eventType, const char * szArg ); bool GetEvent( int Event, int & eventType, char * szArg ); bool DeleteEvent( int ); unsigned AddPoint( float x, float y, float z, long objID ); void MovePoint( float x, float y, float z ); void SetObjID( long objID ); void DeletePoint(); // bool SelectPoint( unsigned ); bool SelectPoint( unsigned triggerIndex, unsigned pointIndex ); void SelectClosestPoint( float x, float y, float z, float limitDistance ); void GetPoint( float & x, float & y, float & z, long & objID ); //Æ®¸®°Å¿Í Æ÷ÀÎÆ®°¡ °°ÀÌ ¼±ÅÃµÊ void Rebuild( float Epsilon ); void Render( IDirect3DDevice8 * ); int GetPolygonCount(); int GetVertexCount( int i ); void GetVertex( int i, int j, float & x, float & y, float & z ); unsigned LastDeletedPoint() { return m_iLastDeleted; } }; /////////////////////////////////////////////////////////////////////////////////// #endif