Original Post
I am wondering if this is teh correct way to go about getting the saved game folder and applaction settings for windows.
I have the def for windows in case I want to port it. (core::stringc and irr::io::path are part of the engine so I am not worreied about that)
[source lang="cpp"]
#ifdef _WINDOWS
#include
#include "shlobj.h"
#include
core::stringc GetSettingFilePath(){
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE,
NULL,
0,
szPath))){
core::stringc DirectoryPth = "";
DirectoryPth.append(szPath);
DirectoryPth.append("\\Costumeverse\\kitsuneWorld.settings");
return DirectoryPth;
}
}
#include
#define PRODUCT_TITLE TEXT("Costumeverse")
#define KF_FLAG_CREATE 0x8000
#define KF_FLAG_DONT_VERIFY 0x4000
#define KF_FLAG_NO_ALIAS 0x1000
#define KF_FLAG_INIT 0x0800
#define KF_FLAG_DEFAULT_PATH 0x0400
#define KF_FLAG_NOT_PARENT_RELATIVE 0x0200
#define KF_FLAG_SIMPLE_IDLIST 0x0100
typedef HRESULT (WINAPI *PSHGetKnownFolderPath)(const GUID &rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath); // free *ppszPath with CoTaskMemFree
irr::io::path getSavePath()
{
// Get Save Path
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_PROFILE|CSIDL_FLAG_CREATE,
NULL,
0,
szPath))){
core::stringc DirectoryPth = "";
DirectoryPth.append(szPath);
DirectoryPth.append("\\Saved Games\\Costumeverse\\");
return DirectoryPth;
}
}
#endif
[/source]
I have the def for windows in case I want to port it. (core::stringc and irr::io::path are part of the engine so I am not worreied about that)
[source lang="cpp"]
#ifdef _WINDOWS
#include
#include "shlobj.h"
#include
core::stringc GetSettingFilePath(){
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE,
NULL,
0,
szPath))){
core::stringc DirectoryPth = "";
DirectoryPth.append(szPath);
DirectoryPth.append("\\Costumeverse\\kitsuneWorld.settings");
return DirectoryPth;
}
}
#include
#define PRODUCT_TITLE TEXT("Costumeverse")
#define KF_FLAG_CREATE 0x8000
#define KF_FLAG_DONT_VERIFY 0x4000
#define KF_FLAG_NO_ALIAS 0x1000
#define KF_FLAG_INIT 0x0800
#define KF_FLAG_DEFAULT_PATH 0x0400
#define KF_FLAG_NOT_PARENT_RELATIVE 0x0200
#define KF_FLAG_SIMPLE_IDLIST 0x0100
typedef HRESULT (WINAPI *PSHGetKnownFolderPath)(const GUID &rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath); // free *ppszPath with CoTaskMemFree
irr::io::path getSavePath()
{
// Get Save Path
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_PROFILE|CSIDL_FLAG_CREATE,
NULL,
0,
szPath))){
core::stringc DirectoryPth = "";
DirectoryPth.append(szPath);
DirectoryPth.append("\\Saved Games\\Costumeverse\\");
return DirectoryPth;
}
}
#endif
[/source]