Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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-fA-F]{4,16})", std::regex::optimize);
const static std::regex re(R"(0[xX][0-9a-fA-F]{4,16})", std::regex::optimize);
std::smatch match;
if (!std::regex_search(filename, match, re)) {
return 0;
Expand Down
7 changes: 5 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-fA-F]{4,16})", std::regex::optimize);
const static std::regex re(R"(0[xX][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 @@ -124,9 +124,12 @@ void ParseSimpleArchive(const libzippp::ZipArchive& archive, std::vector<TexEntr
for (const auto& entry : archive.getEntries()) {
if (!entry.isFile())
continue;
const auto entry_name = entry.getName();
const auto crc_hash = GetCrcFromFilename(entry.getName());
if (!crc_hash)
if (!crc_hash) {
Warning("Entry with name %s could not be parsed", entry_name.c_str());
continue;
}
const auto data_ptr = static_cast<BYTE*>(entry.readAsBinary());
const auto size = entry.getSize();
std::vector vec(data_ptr, data_ptr + size);
Expand Down