/* ==================================================================== * ¸ñ Àû : ¸ðµå ±×·¡ÇÈ ¸®¼Ò½º¿¡ ´ëÇÑ ·Îµù ÀÎÅÍÆäÀ̽º Á¦°ø ¹× º¸°ü ¸Þ¸ð¸® Á¦°ø * ÀÛ ¼º ÀÚ : À̹ý¼® * ÀÛ ¼º ÀÏ : 2006.01 * ÁÖÀÇ»çÇ× : ¾²·¹µå¿ë ÀÎÅÍÆäÀ̽º´Â º°µµÀÇ ¿ëµµÀ̹ǷΠÀÓÀÇ »ç¿ëÀ» Á¦ÇÑÇÑ´Ù. * À̰÷¿¡ ·ÎµåµÇ´Â °´Ã¼¹× ÅØ½ºÃÄ´Â ¸ðµÎ À¯ÀÏÇÏ´Ù. * =================================================================== */ #pragma once #include "TexturePalette.h" #include "ModelInstance.h" #ifndef _OBJ_LINK_INFO #define _OBJ_LINK_INFO enum eLINK { eLINK_HEAD = 0, eLINK_BODY, eLINK_FOOT, eLINK_RHAND, eLINK_LHAND, eLINK_LARM, eLINK_HEAD2, eLINK_RWEAPON = 10, eLINK_LWEAPON, }; enum ePART { ePART_HAIR = 0, ePART_FACE, ePART_BODY1, ePART_BODY2, ePART_HAND, ePART_FOOT, ePART_MAX, /// ±Í ºÐ¸®°´Ã¼ ePART_EAR = 100, }; #endif class cCallbackStreamPACK; class cMonsterSceneNode; /// ¸®¼Ò½º °ü¸®ÀÚ class cResourceManager { static cResourceManager* mpSingleton; public: cResourceManager(); ~cResourceManager(); enum { eCHARACTEREFFECT = 0, eOBJECTEFFECT, /// ÆÄÀÏ¿¡ ÁöÁ¤µÈ Á¤º¸¸¦ ±×´ë·Î »ç¿ëÇÑ´Ù. eFILEEFFECT, }; /// ÃʱâÈ­ bool Init(); void Close(); // /// Á¾·á // void Exit(); // /// ±âº» °´Ã¼ ·Îµå ÇÔ¼ö bool LoadNIF( const cString& pathName, NiAVObject** nifRoot = 0); bool LoadMapNIF( const cString& pathName ); // // /// ¾²·¹µå¸¦ ÀÌ¿ëÇÑ °´Ã¼ ·Îµå(ÀÓÀÇ »ç¿ëÀ» Á¦ÇÑÇÑ´Ù) // void LoadThreadNIF( const char* fileName ); // // /// ·Îµå ¾²·¹µå Á¾·áºÎ // void FinishThread(); // // /// ÅØ½ºÃ³ // void ChangeStageImageTexture( NiTexture* tex ); NiTexture* LoadTexture( const cString& pathName, bool useMipMap = true ); LPDIRECT3DTEXTURE9 LoadD3DTexture( const cString& pathName, bool useMipMap = true, DWORD filter = D3DX_FILTER_LINEAR, DWORD mipFilter = D3DX_FILTER_LINEAR ); // LPDIRECT3DTEXTURE9 GetD3DTexture( const cString& pathName ); // NiTexture* LoadMapTexture( const cString& pathName, bool useMipMap = true ); /// »ç¿îµå NiAudioSource* LoadStageSound( const cString& fileName ); NiAudioSource* LoadTotalSound( const cString& fileName ); // // /// ¾²·¹µå¿ë 󸮺Π// void Process(); // /// ·ÎµåµÈ nifÆÄÀÏ °´Ã¼¸¦ ÀúÀå°ø°£¿¡ Ãß°¡ÇÑ´Ù. void AddObject( NiNode* n, const cString& pathName, bool mapObj ); // /// °´Ã¼ Á¦°Å¿ë ÀÎÅÍÆäÀ̽º void RemoveObject( const char* objectName ); // void RemoveAllMapTexture(); // void RemoveAllTexture(); // // /// °´Ã¼ ÂüÁ¶¿ë ÀÎÅÍÆäÀ̽º NiNode* GetObjectByName( const cString& pathName ); NiAudioSource* GetStageSoundByName( const cString& fileName ); NiAudioSource* GetTotalSoundByName( const cString& fileName ); // /// °´Ã¼ º¹»ç¿ë ÀÎÅÍÆäÀ̽º NiNode* CloneObjectByName( const cString& pathName ); NiAudioSource* CloneStageSoundByName( const cString& fileName ); NiAudioSource* CloneTotalSoundByName( const cString& fileName ); NiNodePtr DeepCopyObjectByName( const cString& pathName ); // /// kfm ÆÄÀÏ ¸ðµ¨ cModelInstance* LoadKFM( const cString& pathName ); void AddModel( cModelInstance* model, const cString& pathName ); void RemoveAllModels(); /// ±×¸²ÀÚ ÅØ½ºÃ³ NiTexture* GetShadowTexture() const; NiTexture* GetFieldTargetTexture() const; cModelInstance* GetModelByName( const cString& pathName ); /// const char* GetManagedPartName( unsigned int partIdx ); const char* GetManagedDummyName( unsigned int dummyIdx ); /// Àӽà ¸Þ¸ð¸® ÇØÁ¦ ÇÔ¼ö [12/15/2009 Jo_Client] void Clean(); public: /// ´ÜÀÏü¸¦ ¸®ÅÏ static cResourceManager* GetSingleton(); protected: void CheckStreams( NiAVObject* obj ); protected: /// ¾²·¹µå ·Îµù Ŭ·¡½º cCallbackStreamPACK* mpStreamPAK; /// Å©¸®Æ¼Äà ¼½¼Ç static NiCriticalSection mObjectListCriticalSection; static NiCriticalSection mSoundListCriticalSection; /// ÅØ½ºÃ³ ÆÈ·¹Æ® cTexturePalettePtr mTexturePalette; cTexturePalettePtr mMapTexturePalette; /// 3D ¿ÀºêÁ§Æ® NiTStringPointerMap mObjectMap; tArray mMapObjNameArray; /// ¸ðµ¨ NiTStringPointerMap mModelMap; /// »ç¿îµå typedef tPointerHashMap cSoundMap; cSoundMap mStageSound; // stage change - clear cSoundMap mTotalSound; // game /// ÅØ½ºÃ³ typedef tHashMap cD3DTextureMap; cD3DTextureMap mD3DTextureMap; /// ±×¸²ÀÚ ÅØ½ºÃ³ NiTexture* mShadowTexture; NiTexture* mFieldTargetTexture; NiTexturePtr mStageImageTexture; /// ij¸¯ÅÍ ÆÄÆ®º° °ü¸® Geom°´Ã¼ÀÇ À̸§ (±×·¡ÇÈ Á¦À۽à °áÁ¤µÈ À̸§À» µî·ÏÇÑ´Ù.) NiTPointerMap mPartsNameMap; /// °ü¸® Dummy°´Ã¼ÀÇ À̸§ (±×·¡ÇÈ Á¦À۽à °áÁ¤µÈ À̸§À» µî·ÏÇÑ´Ù.) NiTPointerMap mDummyNameMap; }; inline NiTexture* cResourceManager::GetShadowTexture() const { return mShadowTexture; } inline NiTexture* cResourceManager::GetFieldTargetTexture() const { return mFieldTargetTexture; } inline cResourceManager* cResourceManager::GetSingleton() { return mpSingleton; } #define RESOURCEMAN cResourceManager::GetSingleton()