mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 13:44:56 +00:00
Windows fixes
This commit is contained in:
@@ -1137,7 +1137,7 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath
|
||||
const HECL::SystemString& relPath = path.getRelativePath();
|
||||
|
||||
/* TODO: incorporate hecl hashes */
|
||||
size_t search = relPath.find("TXTR_");
|
||||
size_t search = relPath.find(_S("TXTR_"));
|
||||
if (search != HECL::SystemString::npos)
|
||||
targetMSet.addTexture(relPath.c_str() + search + 5);
|
||||
else
|
||||
|
||||
@@ -87,6 +87,13 @@ public:
|
||||
copy[8] = '\0';
|
||||
m_id = strtoul(copy, nullptr, 16);
|
||||
}
|
||||
UniqueID32(const wchar_t* hexStr)
|
||||
{
|
||||
wchar_t copy[9];
|
||||
wcsncpy(copy, hexStr, 8);
|
||||
copy[8] = L'\0';
|
||||
m_id = wcstoul(copy, nullptr, 16);
|
||||
}
|
||||
|
||||
static constexpr size_t BinarySize() {return 4;}
|
||||
};
|
||||
@@ -131,7 +138,22 @@ public:
|
||||
char copy[17];
|
||||
strncpy(copy, hexStr, 16);
|
||||
copy[16] = '\0';
|
||||
#if _WIN32
|
||||
m_id = _strtoui64(copy, nullptr, 16);
|
||||
#else
|
||||
m_id = strtouq(copy, nullptr, 16);
|
||||
#endif
|
||||
}
|
||||
UniqueID64(const wchar_t* hexStr)
|
||||
{
|
||||
wchar_t copy[17];
|
||||
wcsncpy(copy, hexStr, 16);
|
||||
copy[16] = L'\0';
|
||||
#if _WIN32
|
||||
m_id = _wcstoui64(copy, nullptr, 16);
|
||||
#else
|
||||
m_id = wcstouq(copy, nullptr, 16);
|
||||
#endif
|
||||
}
|
||||
|
||||
static constexpr size_t BinarySize() {return 8;}
|
||||
|
||||
@@ -151,7 +151,11 @@ void PAKBridge::build()
|
||||
HECL::SNPrintf(num, 16, _S("%02u "), ai);
|
||||
areaDeps.name = num + areaDeps.name;
|
||||
|
||||
#if HECL_UCS2
|
||||
std::string lowerName = HECL::WideToUTF8(areaDeps.name);
|
||||
#else
|
||||
std::string lowerName(areaDeps.name);
|
||||
#endif
|
||||
for (char& ch : lowerName)
|
||||
{
|
||||
ch = tolower(ch);
|
||||
|
||||
Reference in New Issue
Block a user