2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 18:24:55 +00:00

Windows fixes

This commit is contained in:
Jack Andersen
2015-11-10 10:12:43 -10:00
parent b94e14cd55
commit 58e394d5df
7 changed files with 31 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
project(PathShagged) project(PathShagged)
if(MSVC) if(MSVC)
# Shaddup MSVC # Shaddup MSVC
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305) add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305)
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-multichar -fno-exceptions") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-multichar -fno-exceptions")
endif() endif()

View File

@@ -1137,7 +1137,7 @@ bool WriteCMDL(const HECL::ProjectPath& outPath, const HECL::ProjectPath& inPath
const HECL::SystemString& relPath = path.getRelativePath(); const HECL::SystemString& relPath = path.getRelativePath();
/* TODO: incorporate hecl hashes */ /* TODO: incorporate hecl hashes */
size_t search = relPath.find("TXTR_"); size_t search = relPath.find(_S("TXTR_"));
if (search != HECL::SystemString::npos) if (search != HECL::SystemString::npos)
targetMSet.addTexture(relPath.c_str() + search + 5); targetMSet.addTexture(relPath.c_str() + search + 5);
else else

View File

@@ -87,6 +87,13 @@ public:
copy[8] = '\0'; copy[8] = '\0';
m_id = strtoul(copy, nullptr, 16); 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;} static constexpr size_t BinarySize() {return 4;}
}; };
@@ -131,7 +138,22 @@ public:
char copy[17]; char copy[17];
strncpy(copy, hexStr, 16); strncpy(copy, hexStr, 16);
copy[16] = '\0'; copy[16] = '\0';
#if _WIN32
m_id = _strtoui64(copy, nullptr, 16);
#else
m_id = strtouq(copy, nullptr, 16); 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;} static constexpr size_t BinarySize() {return 8;}

View File

@@ -151,7 +151,11 @@ void PAKBridge::build()
HECL::SNPrintf(num, 16, _S("%02u "), ai); HECL::SNPrintf(num, 16, _S("%02u "), ai);
areaDeps.name = num + areaDeps.name; areaDeps.name = num + areaDeps.name;
#if HECL_UCS2
std::string lowerName = HECL::WideToUTF8(areaDeps.name);
#else
std::string lowerName(areaDeps.name); std::string lowerName(areaDeps.name);
#endif
for (char& ch : lowerName) for (char& ch : lowerName)
{ {
ch = tolower(ch); ch = tolower(ch);

Submodule MathLib updated: 8937bfc0c6...fca8742f99

View File

@@ -167,7 +167,7 @@ void CMain::LoadAudio()
int CMain::appMain(boo::IApplication* app) int CMain::appMain(boo::IApplication* app)
{ {
Zeus::detectCPU(); Zeus::detectCPU();
mainWindow = app->newWindow("Metroid Prime 1 Reimplementation vZygote"); mainWindow = app->newWindow(_S("Metroid Prime 1 Reimplementation vZygote"));
mainWindow->showWindow(); mainWindow->showWindow();
TOneStatic<CGameGlobalObjects> globalObjs; TOneStatic<CGameGlobalObjects> globalObjs;
InitializeSubsystems(); InitializeSubsystems();

2
hecl

Submodule hecl updated: e42eecf237...8e82d2d42b