diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f007dbcc..9c2f5a29a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,6 +214,9 @@ endif (APPLE) # Other files +configure_file(${OpenMW_SOURCE_DIR}/files/settings-default.cfg + "${OpenMW_BINARY_DIR}/settings-default.cfg") + configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg.local "${OpenMW_BINARY_DIR}/openmw.cfg") configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg @@ -288,6 +291,7 @@ if(DPKG_PROGRAM) INSTALL(FILES "${OpenMW_SOURCE_DIR}/apps/launcher/resources/images/openmw.png" DESTINATION "share/pixmaps/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") #Install global configuration files + INSTALL(FILES "${OpenMW_BINARY_DIR}/settings-default.cfg" DESTINATION "../etc/openmw/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "../etc/openmw/" RENAME "openmw.cfg" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") INSTALL(FILES "${OpenMW_BINARY_DIR}/plugins.cfg" DESTINATION "../etc/openmw/" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT "openmw") diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 294fcf492..166c9c16b 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -315,9 +315,16 @@ void OMW::Engine::go() boost::filesystem::create_directories(configPath); } + // Create the settings manager and load default and user settings file Settings::Manager settings; - - //settings.loadDefault(defaultsettingspath); + const std::string localdefault = mCfgMgr.getLocalPath().string() + "/settings-default.cfg"; + const std::string globaldefault = mCfgMgr.getGlobalPath().string() + "/settings-default.cfg"; + + // prefer local + if (boost::filesystem::exists(localdefault)) + settings.loadDefault(localdefault); + else if (boost::filesystem::exists(globaldefault)) + settings.loadDefault(globaldefault); const std::string settingspath = mCfgMgr.getUserPath().string() + "/settings.cfg"; if (boost::filesystem::exists(settingspath)) diff --git a/files/settings-default.cfg b/files/settings-default.cfg new file mode 100644 index 000000000..7a35b7102 --- /dev/null +++ b/files/settings-default.cfg @@ -0,0 +1,3 @@ +[Objects] +shaders = true +num lights = 8