diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/common_paths.h | 2 | ||||
-rw-r--r-- | src/common/file_util.cpp | 13 | ||||
-rw-r--r-- | src/common/file_util.h | 1 | ||||
-rw-r--r-- | src/common/key_map.cpp | 8 | ||||
-rw-r--r-- | src/common/logging/backend.cpp | 1 | ||||
-rw-r--r-- | src/common/logging/log.h | 4 |
6 files changed, 22 insertions, 7 deletions
diff --git a/src/common/common_paths.h b/src/common/common_paths.h index a5342a610..37304d236 100644 --- a/src/common/common_paths.h +++ b/src/common/common_paths.h @@ -19,7 +19,7 @@ #define EMU_DATA_DIR USER_DIR #else #ifdef _WIN32 -#define EMU_DATA_DIR "Citra Emulator" +#define EMU_DATA_DIR "Citra" #else #define EMU_DATA_DIR "citra-emu" #endif diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 407ed047a..b6161f2dc 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -594,6 +594,15 @@ std::string& GetExeDirectory() { } return exe_path; } + +std::string AppDataRoamingDirectory() { + PWSTR pw_local_path = nullptr; + // Only supported by Windows Vista or later + SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &pw_local_path); + std::string local_path = Common::UTF16ToUTF8(pw_local_path); + CoTaskMemFree(pw_local_path); + return local_path; +} #else /** * @return The user’s home directory on POSIX systems @@ -671,6 +680,10 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string& new if (paths[D_USER_IDX].empty()) { #ifdef _WIN32 paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; + if (!FileUtil::IsDirectory(paths[D_USER_IDX])) { + paths[D_USER_IDX] = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; + } + paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP; #else diff --git a/src/common/file_util.h b/src/common/file_util.h index 204b06f14..ac58607c5 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -154,6 +154,7 @@ std::string GetBundleDirectory(); #ifdef _WIN32 std::string& GetExeDirectory(); +std::string AppDataRoamingDirectory(); #endif size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename); diff --git a/src/common/key_map.cpp b/src/common/key_map.cpp index 79b3fcb18..97cafe9c9 100644 --- a/src/common/key_map.cpp +++ b/src/common/key_map.cpp @@ -49,7 +49,7 @@ static bool circle_pad_right = false; static bool circle_pad_modifier = false; static void UpdateCirclePad(EmuWindow& emu_window) { - constexpr float SQRT_HALF = 0.707106781; + constexpr float SQRT_HALF = 0.707106781f; int x = 0, y = 0; if (circle_pad_right) @@ -61,9 +61,9 @@ static void UpdateCirclePad(EmuWindow& emu_window) { if (circle_pad_down) --y; - float modifier = circle_pad_modifier ? Settings::values.pad_circle_modifier_scale : 1.0; - emu_window.CirclePadUpdated(x * modifier * (y == 0 ? 1.0 : SQRT_HALF), - y * modifier * (x == 0 ? 1.0 : SQRT_HALF)); + float modifier = circle_pad_modifier ? Settings::values.pad_circle_modifier_scale : 1.0f; + emu_window.CirclePadUpdated(x * modifier * (y == 0 ? 1.0f : SQRT_HALF), + y * modifier * (x == 0 ? 1.0f : SQRT_HALF)); } int NewDeviceId() { diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 88209081d..7fd397fe5 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -43,6 +43,7 @@ namespace Log { SUB(Service, AM) \ SUB(Service, PTM) \ SUB(Service, LDR) \ + SUB(Service, MIC) \ SUB(Service, NDM) \ SUB(Service, NIM) \ SUB(Service, NWM) \ diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 8d3a2d03e..96d0dfb8c 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -60,6 +60,7 @@ enum class Class : ClassType { Service_AM, ///< The AM (Application manager) service Service_PTM, ///< The PTM (Power status & misc.) service Service_LDR, ///< The LDR (3ds dll loader) service + Service_MIC, ///< The MIC (Microphone) service Service_NDM, ///< The NDM (Network daemon manager) service Service_NIM, ///< The NIM (Network interface manager) service Service_NWM, ///< The NWM (Network wlan manager) service @@ -84,8 +85,7 @@ enum class Class : ClassType { Audio_DSP, ///< The HLE implementation of the DSP Audio_Sink, ///< Emulator audio output backend Loader, ///< ROM loader - - Count ///< Total number of logging classes + Count ///< Total number of logging classes }; /// Logs a message to the global logger. |