diff --git a/CMakeLists.txt b/CMakeLists.txt index 86b9342..9b9c5ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.29) +cmake_minimum_required(VERSION 3.29) set(CMAKE_GENERATOR_PLATFORM win32) @@ -10,9 +10,9 @@ if(NOT(CMAKE_SIZEOF_VOID_P EQUAL 4)) endif() set(VERSION_MAJOR 1) -set(VERSION_MINOR 7) +set(VERSION_MINOR 8) set(VERSION_PATCH 0) -set(VERSION_TWEAK 3) +set(VERSION_TWEAK 0) set(VERSION_RC "${CMAKE_CURRENT_BINARY_DIR}/version.rc") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in" "${VERSION_RC}" @ONLY) diff --git a/TpfConvert/src/ModfileLoader.ixx b/TpfConvert/src/ModfileLoader.ixx index 31c2c75..908db9b 100644 --- a/TpfConvert/src/ModfileLoader.ixx +++ b/TpfConvert/src/ModfileLoader.ixx @@ -14,7 +14,7 @@ export struct TexEntry { namespace { HashType GetCrcFromFilename(const std::string& filename) { - const static std::regex re(R"(0x[0-9a-f]{4,16})", std::regex::optimize | std::regex::icase); + const static std::regex re(R"(0x[0-9a-fA-F]{4,16})", std::regex::optimize); std::smatch match; if (!std::regex_search(filename, match, re)) { return 0; @@ -117,13 +117,14 @@ void ParseSimpleArchive(const libzippp::ZipArchive& archive, std::vector(entry.readAsBinary()); const auto size = entry.getSize(); std::vector vec(data_ptr, data_ptr + size); - std::filesystem::path tex_name(entry.getName()); + std::filesystem::path tex_name(entry_name); entries.emplace_back(std::move(vec), crc_hash, tex_name.extension().string()); delete[] data_ptr; } diff --git a/header/Defines.h b/header/Defines.h index 89e9dae..5171552 100644 --- a/header/Defines.h +++ b/header/Defines.h @@ -37,20 +37,20 @@ struct TextureFileStruct { inline void Message([[maybe_unused]] const char* format, ...) { #ifdef _DEBUG -#if 0 + //const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + //[[maybe_unused]] const auto success = SetConsoleTextAttribute(hConsole, 0); // white va_list args; va_start(args, format); vprintf(format, args); va_end(args); #endif -#endif } inline void Info([[maybe_unused]] const char* format, ...) { #ifdef _DEBUG - const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); - [[maybe_unused]] const auto success = SetConsoleTextAttribute(hConsole, 0); // white + //const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + //[[maybe_unused]] const auto success = SetConsoleTextAttribute(hConsole, 0); // white va_list args; va_start(args, format); vprintf(format, args); diff --git a/modules/ModfileLoader.ixx b/modules/ModfileLoader.ixx index c953479..9659daf 100644 --- a/modules/ModfileLoader.ixx +++ b/modules/ModfileLoader.ixx @@ -14,7 +14,7 @@ namespace { bool use_64_bit_crc = false; HashType GetCrcFromFilename(const std::string& filename) { - const static std::regex re(R"(0x[0-9a-f]{4,16})", std::regex::optimize | std::regex::icase); + const static std::regex re(R"(0x[0-9a-fA-F]{4,16})", std::regex::optimize); std::smatch match; if (!std::regex_search(filename, match, re)) { return 0; @@ -143,8 +143,10 @@ void ParseTexmodArchive(std::vector& lines, libzippp::ZipArchive& a // match[1] | match[2] const static auto address_file_regex = std::regex(R"(^[\\/.]*([^|]+)\|([^\r\n]+))", std::regex::optimize); std::smatch match; - if (!std::regex_search(line, match, address_file_regex)) + if (!std::regex_search(line, match, address_file_regex)) { + Warning("Failed to parse texmod.def archive line: %s - %s", line.c_str(), line.c_str()); continue; + } const auto address_string = match[1].str(); const auto file_path = match[2].str(); diff --git a/modules/TextureClient.ixx b/modules/TextureClient.ixx index 787bcb5..3e8af03 100644 --- a/modules/TextureClient.ixx +++ b/modules/TextureClient.ixx @@ -167,7 +167,8 @@ std::vector> ProcessModfile(const std::filesystem { const auto hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); if (FAILED(hr)) return {}; - Message("Initialize: loading file %s... ", modfile.c_str()); + const auto modfile_str = modfile.string(); + Message("Initialize: loading file %s... ", modfile_str.c_str()); auto file_loader = ModfileLoader(modfile); auto entries = file_loader.GetContents(); if (entries.empty()) { @@ -238,7 +239,7 @@ void TextureClient::LoadModsFromModlist(std::pair modf } should_update = true; } - Message("Finished loading mods from %s: Loaded %u bytes (%u mb)", modfile_tuple.first.c_str(), loaded_size, loaded_size / 1024 / 1024); + Message("Finished loading mods from %s: Loaded %u bytes (%u mb)\n", modfile_tuple.first.c_str(), loaded_size, loaded_size / 1024 / 1024); } void TextureClient::Initialize() @@ -319,7 +320,7 @@ int TextureClient::RemoveTexture(uModTexturePtr auto pTexture) int TextureClient::LookUpToMod(uModTexturePtr auto pTexture) { - Message("TextureClient::LookUpToMod( %p): hash: %#lX, %p\n", pTexture, pTexture->Hash, this); + Message("TextureClient::LookUpToMod( %p): hash: %#lX\n", pTexture, pTexture->Hash); int ret = RETURN_OK; if (pTexture->CrossRef_D3Dtex != nullptr)