diff options
Diffstat (limited to 'src/dirs.cpp')
-rw-r--r-- | src/dirs.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/dirs.cpp b/src/dirs.cpp index 44b23be0a..394815a83 100644 --- a/src/dirs.cpp +++ b/src/dirs.cpp @@ -1,10 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2019 The ManaPlus Developers + * Copyright (C) 2011-2020 The ManaPlus Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +42,7 @@ #include "utils/cast.h" #include "utils/gettext.h" +#include "utils/performance.h" #ifdef ANDROID #ifdef USE_SDL2 @@ -54,14 +56,14 @@ #include <CoreFoundation/CFBundle.h> #endif // __APPLE__ -#ifdef WIN32 +#ifdef _WIN32 PRAGMA48(GCC diagnostic push) PRAGMA48(GCC diagnostic ignored "-Wshadow") #include <SDL_syswm.h> PRAGMA48(GCC diagnostic pop) #include "fs/specialfolder.h" #undef ERROR -#endif // WIN32 +#endif // _WIN32 #include <sys/stat.h> @@ -243,7 +245,7 @@ void Dirs::mountDataDir() Append_false); #endif // defined __native_client__ -#ifndef WIN32 +#ifndef _WIN32 // Add branding/data to VirtFS search path if (!settings.options.brandingPath.empty()) { @@ -259,7 +261,7 @@ void Dirs::mountDataDir() Append_false); } } -#endif // WIN32 +#endif // _WIN32 } void Dirs::initRootDir() @@ -347,7 +349,7 @@ void Dirs::initLocalDataDir() #elif defined __HAIKU__ settings.localDataDir = pathJoin(VirtFs::getUserDir(), "config/cache/Mana"); -#elif defined WIN32 +#elif defined _WIN32 settings.localDataDir = getSpecialFolderLocation(CSIDL_LOCAL_APPDATA); if (settings.localDataDir.empty()) settings.localDataDir = VirtFs::getUserDir(); @@ -375,7 +377,7 @@ void Dirs::initLocalDataDir() "Exiting."), settings.localDataDir.c_str())); } #ifdef USE_PROFILER - Perfomance::init(pathJoin(settings.localDataDir, "profiler.log")); + Performance::init(pathJoin(settings.localDataDir, "profiler.log")); #endif // USE_PROFILER } @@ -405,7 +407,7 @@ void Dirs::initConfigDir() settings.configDir = pathJoin(VirtFs::getUserDir(), "config/settings/Mana", branding.getValue("appName", "ManaPlus")); -#elif defined WIN32 +#elif defined _WIN32 settings.configDir = getSpecialFolderLocation(CSIDL_APPDATA); if (settings.configDir.empty()) { @@ -497,10 +499,10 @@ void Dirs::initUpdatesDir() settings.updatesDir = updates.str(); } -#ifdef WIN32 +#ifdef _WIN32 if (settings.updatesDir.find(":") != std::string::npos) replaceAll(settings.updatesDir, ":", "_"); -#endif // WIN32 +#endif // _WIN32 const std::string updateDir("/" + settings.updatesDir); @@ -509,7 +511,7 @@ void Dirs::initUpdatesDir() { if (!VirtFs::mkdir(updateDir)) { -#if defined WIN32 +#if defined _WIN32 std::string newDir = pathJoin(settings.localDataDir, settings.updatesDir); if (!CreateDirectory(newDir.c_str(), nullptr) && @@ -521,7 +523,7 @@ void Dirs::initUpdatesDir() errorMessage = _("Error creating updates directory!"); client->setState(State::ERROR); } -#else // defined WIN32 +#else // defined _WIN32 logger->log("Error: %s/%s can't be made, but doesn't exist!", settings.localDataDir.c_str(), @@ -529,7 +531,7 @@ void Dirs::initUpdatesDir() // TRANSLATORS: update server initialisation error errorMessage = _("Error creating updates directory!"); client->setState(State::ERROR); -#endif // defined WIN32 +#endif // defined _WIN32 } } const std::string updateLocal = pathJoin(updateDir, "local"); |