[Fix] 트롤 상태 수정

[Fix] 플레이어 , 고블린 메테리얼 수정
This commit is contained in:
hyunbin14
2025-12-06 15:58:13 +09:00
parent 8ae6803840
commit 907fe74f4c
33 changed files with 1218 additions and 432 deletions
@@ -355,6 +355,9 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
else if (!strcmp(FileType.c_str(), "SRXO")) {
eTexture = aiTextureType::aiTextureType_SPECULAR;
}
else if (!strcmp(FileType.c_str(), "A")) {
eTexture = aiTextureType::aiTextureType_AMBIENT;
}
else
{
#ifndef 기무리
+76 -1
View File
@@ -733,6 +733,75 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
return S_OK;
}
HRESULT CModel::Ready_Materials_FromFile_Anim(const aiScene* pAIScene, const _char* pModelFilePath)
{
m_iNumMaterials = pAIScene->mNumMaterials;
m_Materials.reserve(m_iNumMaterials);
_char szDrive[MAX_PATH] = {};
_char szDir[MAX_PATH] = {};
_char szFileName[MAX_PATH] = {};
_char szMeshFilePath[MAX_PATH] = {};
vector<_string> MaterialFilePathes;
string strFolderPath = pModelFilePath;
size_t iFolderPos = strFolderPath.find("MeshTable");
strFolderPath = strFolderPath.substr(0, iFolderPos) + "MeshTable/";
_splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, nullptr, 0);
strcpy_s(szMeshFilePath, szDrive);
strcat_s(szMeshFilePath, szDir);
strcat_s(szMeshFilePath, szFileName);
strcat_s(szMeshFilePath, ".props.txt");
ifstream file(szMeshFilePath);
if (!file.is_open())
{
return S_OK;
}
string strText = {};
_uint iNumParameter = {};
getline(file, strText);
getline(file, strText);
for (_uint i = 0; i < m_iNumMaterials; ++i)
{
getline(file, strText);
_int iBeginIndex = (_int)strText.find_first_of("/");
_int iEndIndex = (_int)strText.find('.');
if (-1 == iBeginIndex || -1 == iEndIndex) {
MSG_BOX("Fail Path _ NotExist");
return E_FAIL;
}
if ((_int)strText.size() < iEndIndex - iBeginIndex)
{
MSG_BOX("Fail Path");
return E_FAIL;
}
string strPath = strFolderPath + strText.substr(iBeginIndex + 1, iEndIndex - iBeginIndex - 1);
MaterialFilePathes.push_back(strPath);
}
for (size_t i = 0; i < m_iNumMaterials; ++i) {
CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, MaterialFilePathes[i].c_str(), strFolderPath.c_str());
if (nullptr == pMaterial) {
return E_FAIL;
}
m_Materials.push_back(pMaterial);
}
m_Materials.shrink_to_fit();
return S_OK;
}
HRESULT CModel::Ready_Materials_Independent(MODEL eType, const aiScene* pAIScene, const _char* pModelFilePath)
{
m_iNumMaterials = pAIScene->mNumMaterials;
@@ -1123,6 +1192,12 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
return E_FAIL;
}
}
else if (MODEL::ANIM_LOCAL == eType)
{
if (FAILED(Ready_Materials_FromFile_Anim(m_pAIScene, pModelFilePath))) {
return E_FAIL;
}
}
else if (MODEL::INDEPENDENT == eType) {
if (FAILED(Ready_Materials_Independent(eType, m_pAIScene, pModelFilePath))) {
return E_FAIL;
@@ -1732,7 +1807,7 @@ HRESULT CModel::Initialize(void* pArg)
SAFE_ADDREF(m_pTransform);
if (m_eType == MODEL::ANIM)
if (m_eType == MODEL::ANIM || m_eType == MODEL::ANIM_LOCAL)
{
Initialize_RootBone();
InItialize_BoneIndex();
+18 -6
View File
@@ -118,7 +118,7 @@ HRESULT CUnit::Ready_Components(void *pArg)
if (FAILED(Add_Component<CFSM>(g_iStaticLevel, &m_pFSM))){
return E_FAIL;
}
return S_OK;
}
@@ -129,24 +129,36 @@ void CUnit::Play_Event()
_float ratio = m_pModelCom->Get_CurrentTrackProgressRatio();
_uint curAnim = m_pModelCom->Get_AnimIndex();
if (curAnim == iter->AnimIndex && ratio >= iter->fRatio)
if (curAnim == iter->AnimIndex)
{
iter->Callback();
iter = m_PendingEvents.erase(iter);
if (!iter->bExecuted && ratio >= iter->fRatio)
{
iter->Callback();
iter->bExecuted = true;
if (!iter->bKeep)
{
iter = m_PendingEvents.erase(iter);
continue;
}
}
}
else
{
++iter;
iter->bExecuted = false;
}
++iter;
}
}
void CUnit::Add_Event(_uint AnimIndex, function<void()> Callback, _float fRatio)
void CUnit::Add_Event(_uint AnimIndex, function<void()> Callback, _float fRatio,_bool bKeep)
{
PendingEvent Desc;
Desc.AnimIndex = AnimIndex;
Desc.fRatio = fRatio;
Desc.Callback = Callback;
Desc.bKeep = bKeep;
m_PendingEvents.push_back(Desc);
}
+1 -1
View File
@@ -29,7 +29,7 @@ enum class PXBODYSTATE {
enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON };
enum class MOUSEMOVESTATE { X, Y, W };
enum class D3DTS { VIEW, PROJ, VIEW_INV, PROJ_INV, END };
enum class MODEL { ANIM, NONANIM, INDEPENDENT, ENVIROMENT };
enum class MODEL { ANIM, NONANIM, INDEPENDENT, ENVIROMENT, ANIM_LOCAL};
enum class NAVI_POINT { A, B, C, END };
enum class NAVI_LINE { AB, BC, CA, END };
+28 -27
View File
@@ -5,33 +5,34 @@ enum ESTATE : _u64Flag
{
NOT_DEFINE = 0,
IDLE = 1ULL << 0,
IDLE_TURN = 1ULL << 1,
MOVE = 1ULL << 2,
WALK = 1ULL << 3,
JOG = 1ULL << 4,
SPRINT = 1ULL << 5,
JUMP = 1ULL << 6,
LAND = 1ULL << 7,
DODGE = 1ULL << 8,
COMBAT = 1ULL << 9,
LIGHT_ATTACK = 1ULL << 10,
SPELL = 1ULL << 11,
SKILL = 1ULL << 12,
SKILL2 = 1ULL << 13,
ANCIENT_THROW = 1ULL << 14,
MAPHELP = 1ULL << 15,
POTION = 1ULL << 16,
STOP = 1ULL << 17,
HIT = 1ULL << 18,
BROOM_RIDE = 1ULL << 19,
MOUNT_B = 1ULL << 20,
DISMOUNT = 1ULL << 21,
RUSH = 1ULL << 22,
THROW_ROCK = 1ULL << 23,
BACKHAND_SWING = 1ULL << 24,
SWING = 1ULL << 25,
SLAM = 1ULL << 26,
BLINK = 1ULL << 27,
IDLEBREAK = 1ULL << 1,
IDLE_TURN = 1ULL << 2,
MOVE = 1ULL << 3,
WALK = 1ULL << 4,
JOG = 1ULL << 5,
SPRINT = 1ULL << 6,
JUMP = 1ULL << 7,
LAND = 1ULL << 8,
DODGE = 1ULL << 9,
COMBAT = 1ULL << 10,
LIGHT_ATTACK = 1ULL << 11,
SPELL = 1ULL << 12,
SKILL = 1ULL << 13,
SKILL2 = 1ULL << 14,
ANCIENT_THROW = 1ULL << 15,
MAPHELP = 1ULL << 16,
POTION = 1ULL << 17,
STOP = 1ULL << 18,
HIT = 1ULL << 19,
BROOM_RIDE = 1ULL << 20,
MOUNT_B = 1ULL << 21,
DISMOUNT = 1ULL << 22,
RUSH = 1ULL << 23,
THROW_ROCK = 1ULL << 24,
BACKHAND_SWING = 1ULL << 25,
SWING = 1ULL << 26,
SLAM = 1ULL << 27,
BLINK = 1ULL << 28,
END
};
NS_END
+1
View File
@@ -94,6 +94,7 @@ class ENGINE_DLL CModel final : public CComponent
HRESULT Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath);
HRESULT Ready_Materials_FromFile(const aiScene* pAIScene, const _char* pModelFilePath);
HRESULT Ready_Materials_Independent(MODEL eType, const aiScene* pAIScene, const _char* pModelFilePath);
HRESULT Ready_Materials_FromFile_Anim(const aiScene* pAIScene, const _char* pModelFilePath);
HRESULT Ready_Animations(const aiScene* pAIScene);
HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex);
// 바이너리
+2 -1
View File
@@ -4,7 +4,7 @@
NS_BEGIN(STATEANIM)
enum ESTATE
{
IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4,
IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4,
MOVE,
WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START,WALK_STOP,
JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN,
@@ -13,6 +13,7 @@ enum ESTATE
LAND,
DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT,
COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2,
ATTACK_END,
MAPHELP,POTION,
ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,LUMOS_STOP,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW,
SPELL_FAIL,
+3 -1
View File
@@ -18,6 +18,8 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
_float fRatio = 0.f;
_uint AnimIndex = 0;
function<void()> Callback;
_bool bKeep = { false };
_bool bExecuted = { false };
};
protected:
CUnit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -84,7 +86,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
protected:
HRESULT Ready_Components(void*pArg);
void Play_Event();
void Add_Event(_uint AnimIndex, function<void()> Callback, _float fRatio = 0.f);
void Add_Event(_uint AnimIndex, function<void()> Callback, _float fRatio = 0.f, _bool bKeep = false);
public:
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
virtual void Free() override;