1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-19 17:09:40 +00:00

removed path configuration and made screenshots just save in a folder

This commit is contained in:
p4r4digm 2020-04-20 09:22:50 -07:00
parent 2b54e6216b
commit 0741fe5b80
4 changed files with 13 additions and 15 deletions

View file

@ -686,7 +686,7 @@ void OMW::Engine::go()
#endif
mScreenCaptureOperation = new WriteScreenshotToFileOperation(
mCfgMgr.getScreenshotPath(Settings::Manager::getString("screenshot path", "General")).string(),
mCfgMgr.getScreenshotPath().string(),
Settings::Manager::getString("screenshot format", "General"));
mScreenCaptureHandler = new osgViewer::ScreenCaptureHandler(mScreenCaptureOperation);

View file

@ -32,6 +32,14 @@ ConfigurationManager::ConfigurationManager(bool silent)
boost::filesystem::create_directories(mFixedPath.getUserDataPath());
mLogPath = mFixedPath.getUserConfigPath();
mScreenshotPath = mFixedPath.getUserDataPath() / "screenshots";
// probably not necessary but validate the creation of the screenshots directory and fallback to the original behavior if it fails
boost::system::error_code dirErr;
if (!boost::filesystem::create_directories(mScreenshotPath, dirErr) && !boost::filesystem::is_directory(mScreenshotPath)) {
mScreenshotPath = mFixedPath.getUserDataPath();
}
}
ConfigurationManager::~ConfigurationManager()
@ -196,17 +204,9 @@ const boost::filesystem::path& ConfigurationManager::getLogPath() const
return mLogPath;
}
const boost::filesystem::path ConfigurationManager::getScreenshotPath(std::string const& screenshotSettings) const
const boost::filesystem::path& ConfigurationManager::getScreenshotPath() const
{
boost::filesystem::path ssPath = screenshotSettings;
if (ssPath.is_relative()) {
ssPath = mFixedPath.getUserDataPath() / ssPath;
}
boost::system::error_code dirErr;
if (!boost::filesystem::create_directories(ssPath, dirErr) && !boost::filesystem::is_directory(ssPath)) {
ssPath = mFixedPath.getUserDataPath();
}
return ssPath;
return mScreenshotPath;
}
} /* namespace Cfg */

View file

@ -41,7 +41,7 @@ struct ConfigurationManager
const boost::filesystem::path& getCachePath() const;
const boost::filesystem::path& getLogPath() const;
const boost::filesystem::path getScreenshotPath(std::string const& screenshotSetting) const;
const boost::filesystem::path& getScreenshotPath() const;
private:
typedef Files::FixedPath<> FixedPathType;
@ -58,6 +58,7 @@ struct ConfigurationManager
FixedPathType mFixedPath;
boost::filesystem::path mLogPath;
boost::filesystem::path mScreenshotPath;
TokensMappingContainer mTokensMapping;

View file

@ -284,9 +284,6 @@ anisotropy = 4
# File format for screenshots. (jpg, png, tga, and possibly more).
screenshot format = png
# Directory to store screenshots in. Supports relative and absolute paths. Relative paths will be to the user data folder.
screenshot path =./
# Texture magnification filter type. (nearest or linear).
texture mag filter = linear