Skip to content
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.29)
cmake_minimum_required(VERSION 3.29)

set(CMAKE_GENERATOR_PLATFORM win32)

Expand All @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions TpfConvert/src/ModfileLoader.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -117,13 +117,14 @@ void ParseSimpleArchive(const libzippp::ZipArchive& archive, std::vector<TexEntr
for (const auto& entry : archive.getEntries()) {
if (!entry.isFile())
continue;
const auto crc_hash = GetCrcFromFilename(entry.getName());
const auto entry_name = entry.getName();
const auto crc_hash = GetCrcFromFilename(entry_name);
if (!crc_hash)
continue;
const auto data_ptr = static_cast<uint8_t*>(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;
}
Expand Down
8 changes: 4 additions & 4 deletions header/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions modules/ModfileLoader.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -143,8 +143,10 @@ void ParseTexmodArchive(std::vector<std::string>& 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();

Expand Down
7 changes: 4 additions & 3 deletions modules/TextureClient.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ std::vector<gsl::owner<TextureFileStruct*>> 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()) {
Expand Down Expand Up @@ -238,7 +239,7 @@ void TextureClient::LoadModsFromModlist(std::pair<std::string, std::string> 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()
Expand Down Expand Up @@ -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)
Expand Down