set data_path to exe location on Windows because the open file dialog change the working directory, change the render loop to update only in case of an event or the animated or redraw is true
This commit is contained in:
@@ -57,6 +57,22 @@ void App::initLog()
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString* docpath = [paths objectAtIndex:0];
|
||||
data_path = [docpath cStringUsingEncoding:NSASCIIStringEncoding];
|
||||
#elif _WIN32
|
||||
//CHAR my_documents[MAX_PATH];
|
||||
//HRESULT result = SHGetFolderPathA(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
|
||||
|
||||
//HMODULE hModule = GetModuleHandle(NULL);
|
||||
//CHAR path[MAX_PATH];
|
||||
//GetModuleFileNameA(hModule, path, MAX_PATH);
|
||||
//CHAR out_drive[MAX_PATH];
|
||||
//CHAR out_path[MAX_PATH];
|
||||
//_splitpath(path, out_drive, out_path, nullptr, nullptr);
|
||||
//sprintf_s(path, "%s%s", out_drive, out_path);
|
||||
//data_path = path;
|
||||
|
||||
CHAR path[MAX_PATH];
|
||||
GetCurrentDirectoryA(sizeof(path), path);
|
||||
data_path = path;
|
||||
#endif
|
||||
|
||||
LogRemote::I.start();
|
||||
|
||||
Reference in New Issue
Block a user