From 27ccad28eed12e991e89fc6bf3c93185c1bc69d0 Mon Sep 17 00:00:00 2001
From: Bryan Gardiner <bog@khumba.net>
Date: Mon, 4 Mar 2024 06:03:00 -0800
Subject: [PATCH] Patch to use system-wide directories.

---
 src/Boot.cpp | 36 ++----------------------------------
 1 file changed, 2 insertions(+), 34 deletions(-)

diff --git a/src/Boot.cpp b/src/Boot.cpp
index 2e3cbc7..ecf970b 100644
--- a/src/Boot.cpp
+++ b/src/Boot.cpp
@@ -26,39 +26,7 @@ extern "C"
 
 static fs::path FindGameData(const char* executablePath)
 {
-	fs::path dataPath;
-
-	int attemptNum = 0;
-
-#if !(__APPLE__)
-	attemptNum++;		// skip macOS special case #0
-#endif
-
-	if (!executablePath)
-		attemptNum = 2;
-
-tryAgain:
-	switch (attemptNum)
-	{
-		case 0:			// special case for macOS app bundles
-			dataPath = executablePath;
-			dataPath = dataPath.parent_path().parent_path() / "Resources";
-			break;
-
-		case 1:
-			dataPath = executablePath;
-			dataPath = dataPath.parent_path() / "Data";
-			break;
-
-		case 2:
-			dataPath = "Data";
-			break;
-
-		default:
-			throw std::runtime_error("Couldn't find the Data folder.");
-	}
-
-	attemptNum++;
+	fs::path dataPath("/usr/share/Bugdom");
 
 	dataPath = dataPath.lexically_normal();
 
@@ -69,7 +37,7 @@ tryAgain:
 	OSErr iErr = FSMakeFSSpec(gDataSpec.vRefNum, gDataSpec.parID, ":System:gamecontrollerdb.txt", &someDataFileSpec);
 	if (iErr)
 	{
-		goto tryAgain;
+		throw std::runtime_error("Error loading resources from the Data folder.");
 	}
 
 	return dataPath;
-- 
2.47.2

