client sources moved to C++20

This commit is contained in:
d1str4ught
2025-09-22 00:45:08 +02:00
parent 5b1d3c6bce
commit b4637e4782
3 changed files with 22 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
project(m2dev-client-src)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH

View File

@@ -48,6 +48,8 @@
#include "SpeedTreeWrapper.h"
#include "VertexShaders.h"
#include <filesystem>
using namespace std;
LPDIRECT3DVERTEXDECLARATION9 CSpeedTreeWrapper::ms_dwBranchVertexShader = nullptr;
@@ -429,15 +431,28 @@ bool CSpeedTreeWrapper::LoadTree(const char * pszSptFile, const BYTE * c_pbBlock
m_pTextureInfo = new CSpeedTreeRT::STextures;
m_pSpeedTree->GetTextures(*m_pTextureInfo);
std::filesystem::path path = pszSptFile;
path = path.parent_path();
auto branchTexture = path / m_pTextureInfo->m_pBranchTextureFilename;
branchTexture.replace_extension(".dds");
// load branch textures
LoadTexture((CFileNameHelper::GetPath(string(pszSptFile)) + CFileNameHelper::NoExtension(string(m_pTextureInfo->m_pBranchTextureFilename)) + ".dds").c_str(), m_BranchImageInstance);
LoadTexture(branchTexture.generic_string().c_str(), m_BranchImageInstance);
#ifdef WRAPPER_RENDER_SELF_SHADOWS
auto selfShadowTexture = path / m_pTextureInfo->m_pSelfShadowFilename;
selfShadowTexture.replace_extension(".dds");
if (m_pTextureInfo->m_pSelfShadowFilename != NULL)
LoadTexture((CFileNameHelper::GetPath(string(pszSptFile)) + CFileNameHelper::NoExtension(string(m_pTextureInfo->m_pSelfShadowFilename)) + ".dds").c_str(), m_ShadowImageInstance);
LoadTexture(selfShadowTexture.generic_string().c_str(), m_ShadowImageInstance);
#endif
auto compositeTexture = path / m_pTextureInfo->m_pCompositeFilename;
compositeTexture.replace_extension(".dds");
if (m_pTextureInfo->m_pCompositeFilename)
LoadTexture((CFileNameHelper::GetPath(string(pszSptFile)) + CFileNameHelper::NoExtension(string(m_pTextureInfo->m_pCompositeFilename)) + ".dds").c_str(), m_CompositeImageInstance);
LoadTexture(compositeTexture.generic_string().c_str(), m_CompositeImageInstance);
// setup the index and vertex buffers
SetupBuffers();

View File

@@ -15,6 +15,7 @@
#include "PackLib/PackManager.h"
#include <filesystem>
#include <format>
extern "C" {
extern int _fltused;
@@ -250,11 +251,9 @@ bool PackInitialize(const char * c_pszFolder)
"uiloading",
};
std::filesystem::path folderPath = c_pszFolder;
CPackManager::instance().AddPack((folderPath / "root.pck").generic_string());
CPackManager::instance().AddPack(std::format("{}/root.pck", c_pszFolder));
for (const std::string& packFileName : packFiles) {
CPackManager::instance().AddPack((folderPath / (packFileName + ".pck")).generic_string());
CPackManager::instance().AddPack(std::format("{}/{}.pck", c_pszFolder, packFileName));
}
NANOEND