summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-01-26 21:46:12 +1300
committerMatthew Parlane <parlane@gmail.com>2013-01-26 21:46:12 +1300
commitca4ea817e094c0725b526184f41f41e506a68637 (patch)
tree7a93c40339fd30444383ed0984cbfcb061a10bf7 /Source/Core/Common
parent1083884b8b9566a05dd03e03f978ec3ece58f4dd (diff)
parent2f28d938cf640390cd8979c6104f3dbe8795e1e6 (diff)
Merge branch 'master' into wii-network
Conflicts: Source/Core/Common/Src/CommonPaths.h Source/Core/Common/Src/FileUtil.h Source/Core/Core/Src/HLE/HLE.cpp Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/Common.h3
-rw-r--r--Source/Core/Common/Src/CommonPaths.h2
-rw-r--r--Source/Core/Common/Src/FileSearch.cpp35
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp2
-rw-r--r--Source/Core/Common/Src/FileUtil.h2
5 files changed, 23 insertions, 21 deletions
diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h
index 884a1e6c16..c3cab37dd8 100644
--- a/Source/Core/Common/Src/Common.h
+++ b/Source/Core/Common/Src/Common.h
@@ -81,8 +81,9 @@ private:
#define GC_ALIGNED16_DECL(x) __declspec(align(16)) x
#define GC_ALIGNED64_DECL(x) __declspec(align(64)) x
-// Since it is always around on windows
+// Since they are always around on windows
#define HAVE_WX 1
+ #define HAVE_OPENAL 1
#define HAVE_PORTAUDIO 1
diff --git a/Source/Core/Common/Src/CommonPaths.h b/Source/Core/Common/Src/CommonPaths.h
index f4c62df588..01180c67e3 100644
--- a/Source/Core/Common/Src/CommonPaths.h
+++ b/Source/Core/Common/Src/CommonPaths.h
@@ -90,11 +90,11 @@
#define SHADERS_DIR "Shaders"
#define WII_SYSCONF_DIR "shared2" DIR_SEP "sys"
#define WII_WC24CONF_DIR "shared2" DIR_SEP "wc24"
+#define THEMES_DIR "Themes"
// Filenames
// Files in the directory returned by GetUserPath(D_CONFIG_IDX)
#define DOLPHIN_CONFIG "Dolphin.ini"
-#define DSP_CONFIG "DSP.ini"
#define DEBUGGER_CONFIG "Debugger.ini"
#define LOGGER_CONFIG "Logger.ini"
diff --git a/Source/Core/Common/Src/FileSearch.cpp b/Source/Core/Common/Src/FileSearch.cpp
index c60ce9beda..595dfe7000 100644
--- a/Source/Core/Common/Src/FileSearch.cpp
+++ b/Source/Core/Common/Src/FileSearch.cpp
@@ -25,6 +25,7 @@
#endif
#include <string>
+#include <algorithm>
#include "FileSearch.h"
@@ -72,36 +73,36 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
#else
- size_t dot_pos = _searchString.rfind(".");
+ // TODO: super lame/broken
- if (dot_pos == std::string::npos)
- return;
+ auto end_match(_searchString);
+
+ // assuming we have a "*.blah"-like pattern
+ if (!end_match.empty() && end_match[0] == '*')
+ end_match.erase(0, 1);
+
+ // ugly
+ if (end_match == ".*")
+ end_match.clear();
- std::string ext = _searchString.substr(dot_pos);
DIR* dir = opendir(_strPath.c_str());
if (!dir)
return;
- dirent* dp;
-
- while (true)
+ while (auto const dp = readdir(dir))
{
- dp = readdir(dir);
-
- if (!dp)
- break;
-
- std::string s(dp->d_name);
+ std::string found(dp->d_name);
- if ( (!ext.compare(".*") && s.compare(".") && s.compare("..")) ||
- ((s.size() > ext.size()) && (!strcasecmp(s.substr(s.size() - ext.size()).c_str(), ext.c_str())) ))
+ if ((found != ".") && (found != "..")
+ && (found.size() >= end_match.size())
+ && std::equal(end_match.rbegin(), end_match.rend(), found.rbegin()))
{
std::string full_name;
if (_strPath.c_str()[_strPath.size()-1] == DIR_SEP_CHR)
- full_name = _strPath + s;
+ full_name = _strPath + found;
else
- full_name = _strPath + DIR_SEP + s;
+ full_name = _strPath + DIR_SEP + found;
m_FileNames.push_back(full_name);
}
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index cc6ae5d328..4120162e5c 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -678,10 +678,10 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
paths[D_DUMPDSP_IDX] = paths[D_USER_IDX] + DUMP_DSP_DIR DIR_SEP;
paths[D_LOGS_IDX] = paths[D_USER_IDX] + LOGS_DIR DIR_SEP;
paths[D_MAILLOGS_IDX] = paths[D_USER_IDX] + MAIL_LOGS_DIR DIR_SEP;
+ paths[D_THEMES_IDX] = paths[D_USER_IDX] + THEMES_DIR DIR_SEP;
paths[D_WIISYSCONF_IDX] = paths[D_WIIUSER_IDX] + WII_SYSCONF_DIR DIR_SEP;
paths[D_WIIWC24_IDX] = paths[D_WIIUSER_IDX] + WII_WC24CONF_DIR DIR_SEP;
paths[F_DOLPHINCONFIG_IDX] = paths[D_CONFIG_IDX] + DOLPHIN_CONFIG;
- paths[F_DSPCONFIG_IDX] = paths[D_CONFIG_IDX] + DSP_CONFIG;
paths[F_DEBUGGERCONFIG_IDX] = paths[D_CONFIG_IDX] + DEBUGGER_CONFIG;
paths[F_LOGGERCONFIG_IDX] = paths[D_CONFIG_IDX] + LOGGER_CONFIG;
paths[F_MAINLOG_IDX] = paths[D_LOGS_IDX] + MAIN_LOG;
diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h
index 7ed8f8f868..7465c9ee99 100644
--- a/Source/Core/Common/Src/FileUtil.h
+++ b/Source/Core/Common/Src/FileUtil.h
@@ -51,8 +51,8 @@ enum {
D_MAILLOGS_IDX,
D_WIISYSCONF_IDX,
D_WIIWC24_IDX,
+ D_THEMES_IDX,
F_DOLPHINCONFIG_IDX,
- F_DSPCONFIG_IDX,
F_DEBUGGERCONFIG_IDX,
F_LOGGERCONFIG_IDX,
F_MAINLOG_IDX,