[fix] conflit

This commit is contained in:
kimnuri
2025-11-12 17:59:28 +09:00
5 changed files with 52 additions and 35 deletions
@@ -646,7 +646,6 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
} }
#pragma endregion #pragma endregion
SAFE_RELEASE(pContainerObject);
return S_OK; return S_OK;
} }
@@ -23,10 +23,6 @@ HRESULT CContainerObject::Initialize(void* pArg)
return E_FAIL; return E_FAIL;
} }
if (FAILED(Ready_Components(pArg))) {
return E_FAIL;
}
return S_OK; return S_OK;
} }
+33 -4
View File
@@ -196,11 +196,14 @@ HRESULT CMaterial::Read_MaterialFile(const _char* pMaterialFilePath, const _char
/* Texture */ /* Texture */
case 1: case 1:
// value // value
iBeginIndex = (_uint)strText.find("Environment"); iBeginIndex = (_uint)strText.find("/");
iEndIndex = (_uint)strText.find('.'); iEndIndex = (_uint)strText.find('.');
if (256 < iBeginIndex || 256 < iEndIndex) if (256 < iBeginIndex || 256 < iEndIndex)
{
Value = "none"; Value = "none";
return S_OK;
}
else else
Value = strText.substr(iBeginIndex, iEndIndex - iBeginIndex); Value = strText.substr(iBeginIndex, iEndIndex - iBeginIndex);
@@ -258,7 +261,7 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
else if (!strcmp(FileType.c_str(), "MROH")) else if (!strcmp(FileType.c_str(), "MROH"))
eTexture = aiTextureType::aiTextureType_METALNESS; eTexture = aiTextureType::aiTextureType_METALNESS;
else if (!strcmp(FileType.c_str(), "MROA")) else if (!strcmp(FileType.c_str(), "MROA"))
eTexture = aiTextureType::aiTextureType_DIFFUSE_ROUGHNESS; eTexture = aiTextureType::aiTextureType_SPECULAR;
else if (!strcmp(FileType.c_str(), "SRO")) else if (!strcmp(FileType.c_str(), "SRO"))
eTexture = aiTextureType::aiTextureType_SPECULAR; eTexture = aiTextureType::aiTextureType_SPECULAR;
else if (!strcmp(FileType.c_str(), "SROH")) else if (!strcmp(FileType.c_str(), "SROH"))
@@ -268,7 +271,7 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
else if (!strcmp(FileType.c_str(), "HDR")) else if (!strcmp(FileType.c_str(), "HDR"))
return S_OK; return S_OK;
else if (!strcmp(FileType.c_str(), "MSK")) else if (!strcmp(FileType.c_str(), "MSK"))
eTexture = aiTextureType::aiTextureType_MAYA_BASE; eTexture = aiTextureType::aiTextureType_AMBIENT_OCCLUSION;
else if (!strcmp(FileType.c_str(), "basecolor")) else if (!strcmp(FileType.c_str(), "basecolor"))
eTexture = aiTextureType::aiTextureType_DIFFUSE; eTexture = aiTextureType::aiTextureType_DIFFUSE;
else if (!strcmp(FileType.c_str(), "E")) else if (!strcmp(FileType.c_str(), "E"))
@@ -312,7 +315,33 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
strTexturePath = CMyTools::ToString(szTextureFilePath); strTexturePath = CMyTools::ToString(szTextureFilePath);
} }
m_SaveMaterial.Path[ENUM_CLASS(eTexture)].push_back(strTexturePath); _string strPrefix = "../Bin/Resources/Models/MapMesh/";
_string strSearchString = "MeshTable";
_string strResultPath = {};
size_t mapRePos = strTexturePath.find(strSearchString);
if (mapRePos != std::string::npos)
{
size_t startPos = mapRePos + strSearchString.length();
// 'MapRe' 뒤에 오는 경로 건너뛰기
if (startPos < strTexturePath.length() &&
(strTexturePath[startPos] == '\\' || strTexturePath[startPos] == '/')) {
startPos++;
}
// 'MapRe' 이후의 나머지 경로를 추출
strResultPath = strPrefix + strTexturePath.substr(startPos);
}
else
{
MSG_BOX("FAILED to Find Path");
}
replace(strResultPath.begin(), strResultPath.end(), '\\', '/');
m_SaveMaterial.Path[ENUM_CLASS(eTexture)].push_back(strResultPath);
m_SRVs[ENUM_CLASS(eTexture)].push_back(pSRV); m_SRVs[ENUM_CLASS(eTexture)].push_back(pSRV);
return S_OK; return S_OK;
+18 -25
View File
@@ -394,21 +394,15 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
vector<_string> MaterialFilePathes; vector<_string> MaterialFilePathes;
string strFolderPath = pModelFilePath; string strFolderPath = pModelFilePath;
size_t iFolderPos = strFolderPath.find("Environment"); size_t iFolderPos = strFolderPath.find("MeshTable");
strFolderPath = strFolderPath.substr(0, iFolderPos); strFolderPath = strFolderPath.substr(0, iFolderPos) + "MeshTable/";
_splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, nullptr, 0); _splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, nullptr, 0);
string FileName = szFileName;
auto iPos = FileName.find_last_of('.');
FileName = FileName.substr(0, iPos);
strcpy_s(szMeshFilePath, szDrive); strcpy_s(szMeshFilePath, szDrive);
strcat_s(szMeshFilePath, szDir); strcat_s(szMeshFilePath, szDir);
strcat_s(szMeshFilePath, FileName.c_str()); strcat_s(szMeshFilePath, szFileName);
strcat_s(szMeshFilePath, ".props.txt"); strcat_s(szMeshFilePath, ".props.txt");
ifstream file(szMeshFilePath); ifstream file(szMeshFilePath);
@@ -430,12 +424,11 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
{ {
getline(file, strText); getline(file, strText);
// value _int iBeginIndex = (_int)strText.find_first_of("/");
_int iBeginIndex = (_int)strText.find("Environment");
_int iEndIndex = (_int)strText.find('.'); _int iEndIndex = (_int)strText.find('.');
if (-1 == iBeginIndex || -1 == iEndIndex) { if (-1 == iBeginIndex || -1 == iEndIndex) {
MSG_BOX("Fail Path _ NotExist"); // Not Exsist MSG_BOX("Fail Path _ NotExist"); // Not Exsist
return S_OK; return E_FAIL;
} }
if ((_int)strText.size() < iEndIndex - iBeginIndex) if ((_int)strText.size() < iEndIndex - iBeginIndex)
{ {
@@ -443,7 +436,7 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
return E_FAIL; return E_FAIL;
} }
string strPath = strFolderPath + strText.substr(iBeginIndex, iEndIndex - iBeginIndex); string strPath = strFolderPath + strText.substr(iBeginIndex + 1, iEndIndex - iBeginIndex - 1);
MaterialFilePathes.push_back(strPath); MaterialFilePathes.push_back(strPath);
} }
@@ -501,7 +494,7 @@ _bool CModel::SaveAssimpModel(const _char* filename)
_splitpath_s(filename, nullptr, 0, nullptr, 0, nullptr, 0, szExt, MAX_PATH); _splitpath_s(filename, nullptr, 0, nullptr, 0, nullptr, 0, szExt, MAX_PATH);
strcat_s(szModel, sizeof(_char) * MAX_PATH, szExt); strcat_s(szModel, sizeof(_char) * MAX_PATH, szExt);
_string savePath = filename; _string savePath = filename;
SaveModel modelData; SaveModel modelData;
modelData.MeshCount = m_pAIScene->mNumMeshes; modelData.MeshCount = m_pAIScene->mNumMeshes;
@@ -511,8 +504,8 @@ _bool CModel::SaveAssimpModel(const _char* filename)
{ {
aiMesh* mesh = m_pAIScene->mMeshes[i]; aiMesh* mesh = m_pAIScene->mMeshes[i];
SaveMesh saveMesh{}; SaveMesh saveMesh{};
saveMesh.MeshName = mesh->mName.C_Str(); saveMesh.MeshName = mesh->mName.C_Str();
saveMesh.MeshNameSize = (_int)saveMesh.MeshName.size() + 1; saveMesh.MeshNameSize = (_int)saveMesh.MeshName.size() + 1;
saveMesh.VertexCount = mesh->mNumVertices; saveMesh.VertexCount = mesh->mNumVertices;
saveMesh.IndexCount = mesh->mNumFaces * 3; saveMesh.IndexCount = mesh->mNumFaces * 3;
@@ -720,7 +713,7 @@ _bool CModel::SaveAssimpModel(const _char* filename)
for (auto& Anim : modelData.Animations) for (auto& Anim : modelData.Animations)
{ {
fwrite(&Anim.AnimNameSize, sizeof(_uint), 1, fp); fwrite(&Anim.AnimNameSize, sizeof(_uint), 1, fp);
fwrite(Anim.AnimName.data(), 1,Anim.AnimNameSize, fp); fwrite(Anim.AnimName.data(), 1, Anim.AnimNameSize, fp);
fwrite(&Anim.mDuration, sizeof(_float), 1, fp); fwrite(&Anim.mDuration, sizeof(_float), 1, fp);
fwrite(&Anim.mTicksPerSecond, sizeof(_float), 1, fp); fwrite(&Anim.mTicksPerSecond, sizeof(_float), 1, fp);
fwrite(&Anim.ChannelCount, sizeof(_uint), 1, fp); fwrite(&Anim.ChannelCount, sizeof(_uint), 1, fp);
@@ -763,7 +756,7 @@ _int CModel::SaveNodeRecursive(const aiNode* pAINode, std::vector<SaveNode>& out
{ {
SaveNode node{}; SaveNode node{};
node.NodeName = pAINode->mName.C_Str(); node.NodeName = pAINode->mName.C_Str();
node.NodeNameSize =(_uint)node.NodeName.size() + 1; node.NodeNameSize = (_uint)node.NodeName.size() + 1;
node.ParentIndex = parentIndex; node.ParentIndex = parentIndex;
const aiMatrix4x4& m = pAINode->mTransformation; const aiMatrix4x4& m = pAINode->mTransformation;
@@ -869,21 +862,21 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
return S_OK; return S_OK;
} }
m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath); m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath);
XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix); XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix);
Ready_Bones(m_pSaveModel->Nodes, 0, -1); Ready_Bones(m_pSaveModel->Nodes, 0, -1);
if (FAILED(Ready_Meshes())){ if (FAILED(Ready_Meshes())) {
return E_FAIL; return E_FAIL;
} }
if (FAILED(Ready_Materials(pModelFilePath))){ if (FAILED(Ready_Materials(pModelFilePath))) {
return E_FAIL; return E_FAIL;
} }
if (FAILED(Ready_Animations())){ if (FAILED(Ready_Animations())) {
return E_FAIL; return E_FAIL;
} }
@@ -941,7 +934,7 @@ _bool CModel::LoadData(const _char* filename)
fread(&mesh.Bones[i].OffsetMatrix, sizeof(XMFLOAT4X4), 1, fp); fread(&mesh.Bones[i].OffsetMatrix, sizeof(XMFLOAT4X4), 1, fp);
fread(&mesh.Bones[i].WeightsCount, sizeof(_uint), 1, fp); fread(&mesh.Bones[i].WeightsCount, sizeof(_uint), 1, fp);
mesh.Bones[i].Weights.resize(mesh.Bones[i].WeightsCount); mesh.Bones[i].Weights.resize(mesh.Bones[i].WeightsCount);
for (size_t j = 0;j < mesh.Bones[i].WeightsCount; j++) for (size_t j = 0; j < mesh.Bones[i].WeightsCount; j++)
{ {
fread(&mesh.Bones[i].Weights[j].VertexId, sizeof(_uint), 1, fp); fread(&mesh.Bones[i].Weights[j].VertexId, sizeof(_uint), 1, fp);
fread(&mesh.Bones[i].Weights[j].Weight, sizeof(_float), 1, fp); fread(&mesh.Bones[i].Weights[j].Weight, sizeof(_float), 1, fp);
@@ -1018,7 +1011,7 @@ _bool CModel::LoadData(const _char* filename)
mat.Path[k][j] = temp; mat.Path[k][j] = temp;
} }
} }
NewModel.Materials.push_back(mat); NewModel.Materials.push_back(mat);
} }
@@ -1111,7 +1104,7 @@ HRESULT CModel::Ready_Animations()
return S_OK; return S_OK;
} }
CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath,_fmatrix PreTransformMatrix) CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix)
{ {
CModel* pInstance = new CModel(pDevice, pContext); CModel* pInstance = new CModel(pDevice, pContext);
+1 -1
View File
@@ -191,7 +191,7 @@ class ENGINE_DLL CGameInstance final : public CBase
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix); HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix);
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); // 모델 불러왔던 경로에 그대로 있음
#pragma endregion #pragma endregion