mirror of https://github.com/axmolengine/axmol.git
Combine Studio change for get program file full path.
This commit is contained in:
parent
b8ebd51561
commit
f4d317f1fd
|
@ -137,7 +137,13 @@ static void _checkPath()
|
||||||
if (s_resourcePath.empty())
|
if (s_resourcePath.empty())
|
||||||
{
|
{
|
||||||
WCHAR *pUtf16ExePath = nullptr;
|
WCHAR *pUtf16ExePath = nullptr;
|
||||||
_get_wpgmptr(&pUtf16ExePath);
|
#ifdef CC_STUDIO_ENABLED_VIEW
|
||||||
|
WCHAR utf16Path[CC_MAX_PATH] = { 0 };
|
||||||
|
GetModuleFileNameW(NULL, utf16Path, CC_MAX_PATH - 1);
|
||||||
|
pUtf16ExePath = &(utf16Path[0]);
|
||||||
|
#else
|
||||||
|
_get_wpgmptr(&pUtf16ExePath); // CocoStudio Notice : This function won't work under studio, will cause a assert in system library
|
||||||
|
#endif
|
||||||
|
|
||||||
// We need only directory part without exe
|
// We need only directory part without exe
|
||||||
WCHAR *pUtf16DirEnd = wcsrchr(pUtf16ExePath, L'\\');
|
WCHAR *pUtf16DirEnd = wcsrchr(pUtf16ExePath, L'\\');
|
||||||
|
|
Loading…
Reference in New Issue