mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -05:00
Merge branch 'main' of https://github.com/geode-sdk/geode
This commit is contained in:
commit
a968153331
2 changed files with 13 additions and 8 deletions
|
@ -18,10 +18,10 @@ int loadGeode(PVOID module) {
|
|||
}
|
||||
|
||||
DWORD WINAPI load(PVOID module) {
|
||||
std::array<TCHAR, MAX_PATH> szFileName;
|
||||
GetModuleFileName(NULL, szFileName.data(), MAX_PATH);
|
||||
std::array<WCHAR, MAX_PATH> szFileName;
|
||||
GetModuleFileNameW(NULL, szFileName.data(), MAX_PATH);
|
||||
|
||||
ghc::filesystem::path path(szFileName.data());
|
||||
const ghc::filesystem::path path(szFileName.data());
|
||||
auto workingDir = path.parent_path();
|
||||
auto updatesDir = workingDir / "geode" / "update";
|
||||
auto resourcesDir = workingDir / "geode" / "resources";
|
||||
|
|
|
@ -116,12 +116,17 @@ CCPoint cocos::getMousePos() {
|
|||
}
|
||||
|
||||
ghc::filesystem::path dirs::getGameDir() {
|
||||
std::array<TCHAR, MAX_PATH> szFileName;
|
||||
GetModuleFileName(NULL, szFileName.data(), MAX_PATH);
|
||||
// only fetch the path once, since ofc it'll never change
|
||||
// throughout the execution
|
||||
static const auto path = [] {
|
||||
std::array<WCHAR, MAX_PATH> buffer;
|
||||
GetModuleFileNameW(NULL, buffer.data(), MAX_PATH);
|
||||
|
||||
ghc::filesystem::path path(szFileName.data());
|
||||
auto currentPath = path.parent_path();
|
||||
return currentPath;
|
||||
const ghc::filesystem::path path(buffer.data());
|
||||
return path.parent_path();
|
||||
}();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue