[patch] parse 1024 textures

This commit is contained in:
kimnuri
2025-12-30 12:38:11 +09:00
parent dc9c51266a
commit 02c41f6975
11 changed files with 80 additions and 35 deletions
@@ -138,7 +138,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath)
size_t iPos = strEffectPath.rfind('.'); // 뒤에서부터 '/' 검색
if (iPos != std::string::npos)
if (iPos != string::npos)
{
strExt += strEffectPath.substr(iPos + 1);
strEffectName = strEffectPath.substr(0, iPos);
@@ -146,7 +146,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath)
size_t pos = strEffectName.rfind('\\'); // 뒤에서부터 '/' 검색
if (pos != std::string::npos)
if (pos != string::npos)
strEffectName = strEffectName.substr(pos + 1);
if (!strcmp(strExt.c_str(), "trail"))
@@ -332,8 +332,8 @@ HRESULT CLevel_GamePlay::Ready_Background()
#endif //
#ifdef 기무리
isReady_Background = true;
isReady_Hogsmeade = false;
isReady_Hogwart = false;
isReady_Hogsmeade = true;
isReady_Hogwart = true;
#endif //
#ifdef 인혁
isReady_Background = false;
+3 -2
View File
@@ -372,8 +372,8 @@ HRESULT CLoader::Loading_For_GamePlay()
#endif //
#ifdef 기무리
isLoad_Background = true;
isLoad_Hogwart = false;
isLoad_UI_SEQUANTIAL = false;
isLoad_Hogwart = true;
isLoad_UI_SEQUANTIAL = true;
isLoad_NPC = true;
isLoad_Monster = true;
#endif //
@@ -1238,6 +1238,7 @@ HRESULT CLoader::Loading_For_GamePlay()
#pragma region UI_ANI
if (true == isLoad_UI_SEQUANTIAL) {
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic\\Ancient_Magic%d.png"), 152))))
{
@@ -298,9 +298,9 @@ CGameObject* CMapElement_Door::Clone(void* pArg, CGameObject* pOwner)
void CMapElement_Door::Free()
{
if (nullptr != m_pRigidBody) {
m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor());
}
//if (nullptr != m_pRigidBody) {
// m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor());
//}
__super::Free();
SAFE_RELEASE(m_pRigidBody);
@@ -107,7 +107,7 @@ HRESULT CEffect_Container::Load_Directory(const _char* pPath)
size_t iPos = {};
_string strFilePath = szFilePath;
while ((iPos = strFilePath.find(".trail")) != std::string::npos) {
while ((iPos = strFilePath.find(".trail")) != string::npos) {
strFilePath.erase(iPos, 6);
};
@@ -149,7 +149,7 @@ HRESULT CEffect_Container::Load_Directory(const _char* pPath)
size_t iPos = {};
_string strFilePath = szFilePath;
while ((iPos = strFilePath.find(".bin")) != std::string::npos) {
while ((iPos = strFilePath.find(".bin")) != string::npos) {
strFilePath.erase(iPos, 4);
};
@@ -227,7 +227,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath)
size_t iPos = strEffectPath.rfind('.'); // 뒤에서부터 '/' 검색
if (iPos != std::string::npos)
if (iPos != string::npos)
{
strExt += strEffectPath.substr(iPos + 1);
strEffectName = strEffectPath.substr(0, iPos);
@@ -235,7 +235,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath)
size_t pos = strEffectName.rfind('\\'); // 뒤에서부터 '/' 검색
if (pos != std::string::npos)
if (pos != string::npos)
strEffectName = strEffectName.substr(pos + 1);
if (!strcmp(strExt.c_str(), "trail"))
@@ -255,7 +255,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath)
/*이펙트 로드 로드*/
size_t iPos = {};
while ((iPos = strEffectPath.find(".trail")) != std::string::npos) {
while ((iPos = strEffectPath.find(".trail")) != string::npos) {
strEffectPath.erase(iPos, 6);
};
@@ -291,7 +291,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath)
size_t iPosition = {};
_string strFilePath = strEffectPath;
while ((iPosition = strFilePath.find(".bin")) != std::string::npos) {
while ((iPosition = strFilePath.find(".bin")) != string::npos) {
strFilePath.erase(iPosition, 4);
};
@@ -158,7 +158,7 @@ HRESULT CEffect_Editor::Packaging(const _char* pDirectoryPath)
size_t pos = strDirectoryPath.rfind('/'); // 뒤에서부터 '/' 검색
if (pos != std::string::npos)
if (pos != string::npos)
strPerfectFilePath += strDirectoryPath.substr(pos + 1);
strPerfectFilePath += ".bin";
@@ -281,7 +281,7 @@ HRESULT CEffect_Editor::ReSaveFile(const _char* pDirectoryPath)
size_t iPos;
while ((iPos = strPath.find(ext)) != std::string::npos) {
while ((iPos = strPath.find(ext)) != string::npos) {
strPath.erase(iPos, ext.length());
};
+7 -7
View File
@@ -47,14 +47,14 @@ void CIMGUIUI::CanvaswstringTostring(vector<wstring>& panelNames)
wname.c_str(), (int)wname.size(),
nullptr, 0, nullptr, nullptr);
std::string result(size, 0);
string result(size, 0);
WideCharToMultiByte(CP_UTF8, 0,
wname.c_str(), (int)wname.size(),
&result[0], size, nullptr, nullptr);
// 변환된 string 저장
m_iCanvasNamestring.push_back(std::move(result));
m_iCanvasNamestring.push_back(move(result));
}
// vector<const char*> 업데이트
@@ -64,7 +64,7 @@ void CIMGUIUI::CanvaswstringTostring(vector<wstring>& panelNames)
m_iCanvasCount = 999;
}
void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
void CIMGUIUI::PanelwstringTostring(vector<wstring>& panelNames)
{
m_iPanelNamestring.clear();
m_iPanelName.clear();
@@ -79,14 +79,14 @@ void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
wname.c_str(), (int)wname.size(),
nullptr, 0, nullptr, nullptr);
std::string result(size, 0);
string result(size, 0);
WideCharToMultiByte(CP_UTF8, 0,
wname.c_str(), (int)wname.size(),
&result[0], size, nullptr, nullptr);
// 변환된 string 저장
m_iPanelNamestring.push_back(std::move(result));
m_iPanelNamestring.push_back(move(result));
}
// vector<const char*> 업데이트
@@ -111,14 +111,14 @@ void CIMGUIUI::ElementwstringTostring(vector<wstring>& panelNames)
wname.c_str(), (int)wname.size(),
nullptr, 0, nullptr, nullptr);
std::string result(size, 0);
string result(size, 0);
WideCharToMultiByte(CP_UTF8, 0,
wname.c_str(), (int)wname.size(),
&result[0], size, nullptr, nullptr);
// 변환된 string 저장
m_pElementNamestring.push_back(std::move(result));
m_pElementNamestring.push_back(move(result));
}
// vector<const char*> 업데이트
@@ -14,8 +14,7 @@ ID3D11ShaderResourceView* CResource_Manager::Add_Texture(const _char* pFilePath,
}
filesystem::path pathFile = pFilePath;
const _wstring wstrKeyOriginal = pathFile.filename().wstring();
{ // 브레이스 해제 금지
{ // 브레이스 해제 금지0
shared_lock<shared_mutex> sharedLock(m_smtxTexture);
auto iter = m_Resources[iLevel].find(wstrKeyOriginal);
@@ -28,22 +27,24 @@ ID3D11ShaderResourceView* CResource_Manager::Add_Texture(const _char* pFilePath,
SAFE_ADDREF(iter->second);
return iter->second;
}
else {
#ifdef _DEBUG
else {
lock_guard<mutex> statisticsLock(m_mtxStatistics);
m_mapCacheMiss[wstrKeyOriginal]++;
#endif // _DEBUG
}
#endif // _DEBUG
// sharedLock 소멸
} // 브레이스 해제 금지
} // 브레이스 해제 금지0
#ifdef USE_LOWTEXTURE
Replacer_SrcFilePath(pathFile);
#endif // USE_LOWTEXTURE
ID3D11ShaderResourceView* pSRV = Load_SRV(pathFile);
if (pSRV == nullptr){
return nullptr;
}
{ // 브레이스 해제 금지
{ // 브레이스 해제 금지1
unique_lock<shared_mutex> uniqueLock(m_smtxTexture);
auto iter = m_Resources[iLevel].find(wstrKeyOriginal);
@@ -57,7 +58,7 @@ ID3D11ShaderResourceView* CResource_Manager::Add_Texture(const _char* pFilePath,
m_Resources[iLevel].emplace(wstrKeyOriginal, pSRV);
// sharedLock 소멸
} // 브레이스 해제 금지
} // 브레이스 해제 금지1
#ifdef _DEBUG
++m_iCount;
@@ -122,6 +123,35 @@ ID3D11ShaderResourceView* CResource_Manager::Load_SRV(const filesystem::path& pa
return pSRV;
}
HRESULT CResource_Manager::Replacer_SrcFilePath(filesystem::path& pathFile)
{
if (true == pathFile.is_absolute()) {
const std::filesystem::path inputRootPath = pathFile.root_path();
const std::filesystem::path inputRelativePath = pathFile.relative_path();
auto relativePathIterator = inputRelativePath.begin();
if (relativePathIterator == inputRelativePath.end()){
return E_FAIL;
}
else if ("MeshTable" != (*relativePathIterator).string()) {
return E_FAIL;
}
++relativePathIterator;
std::filesystem::path outputPath = inputRootPath / "MeshTableTexture";
for (; relativePathIterator != inputRelativePath.end(); ++relativePathIterator)
{
outputPath /= *relativePathIterator;
}
pathFile = outputPath;
}
else {
return E_FAIL;
}
return S_OK;
}
CResource_Manager* CResource_Manager::Create(ID3D11Device* pDevice, _uint iResourceCount, _uint iNumLevel)
{
CResource_Manager* pInstance = new CResource_Manager(pDevice);
+14 -1
View File
@@ -21,34 +21,47 @@
#define ASSERT_JINHO(expression)
#define ASSERT_HYUNBIN(expression)
#define ASSERT_INHYUK(expression)
#define OPTIONAL_TRUE_KEYINPUTGUICHECK
#define OPTIONAL_TRUE_KEYINPUTGUICHECK
#define USE_LOWTEXTURE
#ifndef _DEBUG
#undef USE_LOWTEXTURE
#endif // !_DEBUG
#ifdef _DEBUG
#ifdef 기무리
#undef ASSERT_NURI
#define ASSERT_NURI(expression) assert(expression)
#define MSG_BOX(_message) MessageBox(NULL, TEXT(_message), L"System Message", MB_OK); assert(false);
//#undef USE_LOWTEXTURE
//#undef OPTIONAL_TRUE_KEYINPUTGUICHECK
//#define OPTIONAL_TRUE_KEYINPUTGUICHECK true||
#elif 진우
#undef ASSERT_JINWOO
#define ASSERT_JINWOO(expression) assert(expression)
#undef USE_LOWTEXTURE
//#undef OPTIONAL_TRUE_KEYINPUTGUICHECK
//#define OPTIONAL_TRUE_KEYINPUTGUICHECK true||
#elif gimch
#undef ASSERT_JINHO
#define ASSERT_JINHO(expression) assert(expression)
#undef USE_LOWTEXTURE
#undef OPTIONAL_TRUE_KEYINPUTGUICHECK
#define OPTIONAL_TRUE_KEYINPUTGUICHECK true||
#elif Bin
#undef ASSERT_HYUNBIN
#define ASSERT_HYUNBIN(expression) assert(expression)
#undef USE_LOWTEXTURE
//#undef OPTIONAL_TRUE_KEYINPUTGUICHECK
//#define OPTIONAL_TRUE_KEYINPUTGUICHECK ||true
#elif 인혁
#undef ASSERT_INHYUK
#define ASSERT_INHYUK(expression) assert(expression)
#undef USE_LOWTEXTURE
//#undef OPTIONAL_TRUE_KEYINPUTGUICHECK
//#define OPTIONAL_TRUE_KEYINPUTGUICHECK || true
#endif
#endif // _DEBUG
#pragma endregion
+2 -2
View File
@@ -148,7 +148,7 @@ class ENGINE_DLL CModel final : public CComponent
HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex);
// 바이너리
_bool SaveAssimpModel(const _char* filename);
_int SaveNodeRecursive(const aiNode* pAINode, std::vector<SaveNode>& outNodes, _int parentIndex);
_int SaveNodeRecursive(const aiNode* pAINode, vector<SaveNode>& outNodes, _int parentIndex);
//
#endif // EDITOR_PROJECT
@@ -304,7 +304,7 @@ class ENGINE_DLL CModel final : public CComponent
// 바이너리
HRESULT Ready_Meshes();
HRESULT Ready_Materials(const _char* pModelFilePath, _uint iLevel);
HRESULT Ready_Bones(const std::vector<SaveNode>& allNodes, _int currentIndex, _int parentIndex);
HRESULT Ready_Bones(const vector<SaveNode>& allNodes, _int currentIndex, _int parentIndex);
HRESULT Ready_Animations(const vector<CBone*>& Bones);
//
@@ -21,6 +21,7 @@ class CResource_Manager final : public CBase
private:
HRESULT Initialize(_uint iResourceCount, _uint iNumLevel);
ID3D11ShaderResourceView* Load_SRV(const filesystem::path& pathFile);
HRESULT Replacer_SrcFilePath(filesystem::path& pathFile);
private:
#ifdef _DEBUG