MCPcopy Create free account
hub / github.com/crosire/reshade / get_base_path

Function get_base_path

source/dll_main.cpp:74–89  ·  view source on GitHub ↗

Returns the path that should be used as base for relative paths.

Source from the content-addressed store, hash-verified

72/// Returns the path that should be used as base for relative paths.
73/// </summary>
74std::filesystem::path get_base_path(bool default_to_target_executable_path = false)
75{
76 std::filesystem::path path_override;
77
78 // Cannot use global config here yet, since it uses base path for look up, so look at config file next to target executable instead
79 if (reshade::ini_file::load_cache(g_target_executable_path.parent_path() / L"ReShade.ini").get("INSTALL", "BasePath", path_override) &&
80 resolve_env_path(path_override))
81 return path_override;
82
83 WCHAR buf[4096];
84 path_override.assign(buf, buf + GetEnvironmentVariableW(L"RESHADE_BASE_PATH_OVERRIDE", buf, ARRAYSIZE(buf)));
85 if (resolve_env_path(path_override))
86 return path_override;
87
88 return default_to_target_executable_path ? g_target_executable_path.parent_path() : g_reshade_dll_path.parent_path();
89}
90
91/// <summary>
92/// Returns the path to the Windows System32 directory.

Callers 2

WinMainFunction · 0.85
DllMainFunction · 0.85

Calls 2

resolve_env_pathFunction · 0.85
getMethod · 0.45

Tested by 1

WinMainFunction · 0.68