Skip to content

Commit 8efce61

Browse files
committed
config: stop nesting config files so deep
It is possible to call SDL_GetPrefPath with nullptr as first argument. This reduces the path from `$XDG_DATA_HOME/Outrage Entertainment/Descent 3` to just `$XDG_DATA_HOME/descent3`. This follows similar spirit to what e.g. Unreal Tournament did (going from `~/.loki/ut` to just `~/.utpg` once it was no longer maintained by Loki Software).
1 parent 8795264 commit 8efce61

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

Descent3/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ void InitIOSystems(bool editor) {
14181418
*/
14191419

14201420
// Writable preference path
1421-
std::filesystem::path pref_path = ddio_GetPrefPath(D3_PREF_ORG, D3_PREF_APP);
1421+
std::filesystem::path pref_path = ddio_GetPrefPath(nullptr, D3_PREF_APP);
14221422
if (pref_path.empty()) {
14231423
Error("Failed to get preference path!");
14241424
}

lib/d3_platform_path.h.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,5 @@
2121
// Platform-specific compile-time defined location of data files
2222
#define D3_DATADIR "@D3_DATADIR@"
2323

24-
// Part of preference path (organization)
25-
#define D3_PREF_ORG "Outrage Entertainment"
26-
2724
// Part of preference path (application)
28-
#define D3_PREF_APP "Descent 3"
25+
#define D3_PREF_APP "descent3"

linux/lnxdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ oeLnxAppDatabase::oeLnxAppDatabase() {
7070
// Open up the database file, for reading, read in all data and keep it in memory
7171
// then close the database
7272

73-
std::filesystem::path prefPath = ddio_GetPrefPath(D3_PREF_ORG, D3_PREF_APP);
73+
std::filesystem::path prefPath = ddio_GetPrefPath(nullptr, D3_PREF_APP);
7474
if (prefPath.empty()) {
7575
LOG_FATAL << "Couldn't find preference directory!";
7676
exit(43);

0 commit comments

Comments
 (0)