mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Better error messages, Dolphin will create save directories if not present.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@37 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -128,6 +128,7 @@ void CPUInfoStruct::Detect()
|
||||
// Interpret CPU brand string and cache information.
|
||||
if (i == 0x80000001)
|
||||
{
|
||||
// This block seems bugged.
|
||||
nFeatureInfo2 = CPUInfo[1]; // ECX
|
||||
bSSE5 = (nFeatureInfo2 & (1 << 11)) ? true : false;
|
||||
bLZCNT = (nFeatureInfo2 & (1 << 5)) ? true : false;
|
||||
|
@ -51,3 +51,25 @@ void File::Explore(const std::string &path)
|
||||
ShellExecuteEx(&shex);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns true if successful, or path already exists.
|
||||
bool File::CreateDir(const std::string &path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (::CreateDirectory(path.c_str(), NULL))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
PanicAlert("%s already exists", path.c_str());
|
||||
return true;
|
||||
}
|
||||
PanicAlert("Error creating directory: %i", error);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
@ -10,6 +10,7 @@ public:
|
||||
static void Launch(const std::string &filename);
|
||||
static void Explore(const std::string &path);
|
||||
static bool IsDirectory(const std::string &filename);
|
||||
static bool CreateDir(const std::string &filename);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user