Skip to content

Commit

Permalink
Update AppImage patches and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Feb 17, 2024
1 parent 40f95c5 commit 6af7fc3
Show file tree
Hide file tree
Showing 8 changed files with 436 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ you will be asked to place your game data along the following paths:
```
You can place game data in these paths before starting the game. Then the game will start immediately.
You can also place your game data anywhere in your home directory. The first time you start the game, it will find it itself.
AppImage also contains libraries for the modification of XPLUS. Download:
```
wget https://archive.org/download/sam-tfe-xplus/SamTFE-XPLUS.tar.xz
wget https://archive.org/download/sam-tse-xplus/SamTSE-XPLUS.tar.xz
```
And unpack it to the root directory of game resources. After unpacking the archives for the XPLUS mod, simply select this mod in the game menu.

Build only the OpenGL version
-----------------------------
Expand Down
117 changes: 117 additions & 0 deletions appimage/patches/0002-AppImage-Engine.cpp.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
--- a/SamTFE/Sources/Engine/Engine.cpp 2024-02-13 13:19:08.215747324 +0300
+++ b/SamTFE/Sources/Engine/Engine.cpp 2024-02-13 13:06:48.202436314 +0300
@@ -115,6 +115,7 @@
// Path vars
static INDEX sys_iGameBits = 0;
ENGINE_API INDEX sys_iSysPath = 0;
+ENGINE_API INDEX sys_iGameDataNotFound = 0;

// Entities Adjesters
ENGINE_API FLOAT _fPlayerFOVAdjuster = 1.0f;
@@ -676,6 +676,8 @@
_fnmApplicationPath = CTString(strDirPath);
_fnmApplicationExe = CTString(strExePath);
#ifdef PLATFORM_UNIX
+ _fnmAdditionalDirPath = CTString(strDirPath) + "share/" + strGameID + "/";
+ //_fnmAdditionalDirPath = "/usr/share/" + strGameID + "/";
// rcg01012002 calculate user dir.
char buf[MAX_PATH];
_pFileSystem->GetUserDirectory(buf, sizeof (buf));
@@ -742,53 +742,11 @@
CPrintF(TRANSV("Running %d-bit version\n"), sys_iGameBits);

Expand Down Expand Up @@ -58,8 +75,65 @@

if( sys_iSysPath == 1 ) { // search game data
CTFileName _fnm_usr_TestFile, _fnm_local_TestFile, _fnm_home_TestFile;
@@ -805,7 +805,7 @@
#elif defined(__NetBSD__)
InfoMessage(TRANS("No game files were found in /usr/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir);
#else
- InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir);
+ //InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir);
#endif
struct passwd *pw = getpwuid(getuid());
const char *_homedir = pw->pw_dir;
@@ -823,13 +824,14 @@
close(_fd);
} else {
CPrintF(TRANSV("ERROR: Game data not ound!\n"));
- _fnmUserDataPath = "";
+ _fnmApplicationPath = _fnmAdditionalDirPath;
+ sys_iGameDataNotFound = 1;
#if defined(__OpenBSD__) || defined(__FreeBSD__)
FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
#elif defined(__NetBSD__)
FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
#else
- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
+ //FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
#endif
}
}
@@ -883,6 +885,7 @@
CPrintF(TRANSV("Executable: %s\n"), (const char *) strExePath);
CPrintF(TRANSV("Assumed engine data directory: %s\n"), (const char *) _fnmApplicationPath);
CPrintF(TRANSV("Assumed mods library directory: %s\n"), (const char *) _fnmModLibPath);
+ CPrintF(TRANSV("Assumed additional data directory: %s\n"), (const char *) _fnmAdditionalDirPath);
#endif

CPrintF("\n");
--- a/SamTSE/Sources/Engine/Engine.cpp 2024-02-13 13:19:08.215747324 +0300
+++ b/SamTSE/Sources/Engine/Engine.cpp 2024-02-13 13:06:48.202436314 +0300
@@ -110,11 +110,12 @@

// MOD info
static CTString sys_strModName = "";
-static CTString sys_strModExt = "";
+static CTString sys_strModExt = "MP";

// Path vars
static INDEX sys_iGameBits = 0;
ENGINE_API INDEX sys_iSysPath = 0;
+ENGINE_API INDEX sys_iGameDataNotFound = 0;

// Entities Adjesters
ENGINE_API FLOAT _fPlayerFOVAdjuster = 1.0f;
@@ -676,6 +676,8 @@
_fnmApplicationPath = CTString(strDirPath);
_fnmApplicationExe = CTString(strExePath);
#ifdef PLATFORM_UNIX
+ _fnmAdditionalDirPath = CTString(strDirPath) + "share/" + strGameID + "/";
+ //_fnmAdditionalDirPath = "/usr/share/" + strGameID + "/";
// rcg01012002 calculate user dir.
char buf[MAX_PATH];
_pFileSystem->GetUserDirectory(buf, sizeof (buf));
@@ -742,53 +742,11 @@
CPrintF(TRANSV("Running %d-bit version\n"), sys_iGameBits);

Expand Down Expand Up @@ -118,3 +192,46 @@

if( sys_iSysPath == 1 ) { // search game data
CTFileName _fnm_usr_TestFile, _fnm_local_TestFile, _fnm_home_TestFile;
@@ -805,7 +805,7 @@
#elif defined(__NetBSD__)
InfoMessage(TRANS("No game files were found in /usr/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir);
#else
- InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir);
+ //InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir);
#endif
struct passwd *pw = getpwuid(getuid());
const char *_homedir = pw->pw_dir;
@@ -823,13 +824,14 @@
close(_fd);
} else {
CPrintF(TRANSV("ERROR: Game data not ound!\n"));
- _fnmUserDataPath = "";
+ _fnmApplicationPath = _fnmAdditionalDirPath;
+ sys_iGameDataNotFound = 1;
#if defined(__OpenBSD__) || defined(__FreeBSD__)
FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
#elif defined(__NetBSD__)
FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
#else
- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
+ //FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID);
#endif
}
}
@@ -883,6 +885,7 @@
CPrintF(TRANSV("Executable: %s\n"), (const char *) strExePath);
CPrintF(TRANSV("Assumed engine data directory: %s\n"), (const char *) _fnmApplicationPath);
CPrintF(TRANSV("Assumed mods library directory: %s\n"), (const char *) _fnmModLibPath);
+ CPrintF(TRANSV("Assumed additional data directory: %s\n"), (const char *) _fnmAdditionalDirPath);
#endif

CPrintF("\n");
@@ -932,7 +932,7 @@
InitStreams();
// keep mod name in sys cvar
sys_strModName = _strModName;
- sys_strModExt = _strModExt;
+ sys_strModExt = "MP";

// checking of crc
#if 0
20 changes: 20 additions & 0 deletions appimage/patches/0003-AppImage-Engine.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/SamTFE/Sources/Engine/Engine.h 2024-02-15 19:31:13.859577578 +0300
+++ b/SamTFE/Sources/Engine/Engine.h 2024-02-15 18:03:57.590666776 +0300
@@ -207,6 +207,7 @@
extern ENGINE_API CTString _strLogFile;
extern ENGINE_API CTFileName _fnmModLibPath;
extern ENGINE_API INDEX sys_iSysPath;
+extern ENGINE_API INDEX sys_iGameDataNotFound;
#ifdef PLATFORM_WIN32
//
extern ENGINE_API FLOAT _fPlayerFOVAdjuster;
--- a/SamTSE/Sources/Engine/Engine.h 2024-02-15 19:31:13.859577578 +0300
+++ b/SamTSE/Sources/Engine/Engine.h 2024-02-15 18:03:57.590666776 +0300
@@ -207,6 +207,7 @@
extern ENGINE_API CTString _strLogFile;
extern ENGINE_API CTFileName _fnmModLibPath;
extern ENGINE_API INDEX sys_iSysPath;
+extern ENGINE_API INDEX sys_iGameDataNotFound;
#ifdef PLATFORM_WIN32
//
extern ENGINE_API FLOAT _fPlayerFOVAdjuster;
105 changes: 105 additions & 0 deletions appimage/patches/0004-AppImage-Stream.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
--- a/SamTFE/Sources/Engine/Base/Stream.h 2024-02-15 12:44:53.057345383 +0300
+++ b/SamTFE/Sources/Engine/Base/Stream.h 2024-02-15 13:17:01.634702073 +0300
@@ -391,6 +391,10 @@

// global string with application path
ENGINE_API extern CTFileName _fnmApplicationPath;
+#ifdef PLATFORM_UNIX
+// global string with additional search path
+ENGINE_API extern CTFileName _fnmAdditionalDirPath;
+#endif
// global string with user-specific writable directory.
ENGINE_API extern CTFileName _fnmUserDir;
// global string with current MOD path
--- a/SamTFE/Sources/Engine/Base/Stream.cpp 2024-02-15 12:44:53.057345383 +0300
+++ b/SamTFE/Sources/Engine/Base/Stream.cpp 2024-02-15 13:17:01.634702073 +0300
@@ -78,7 +78,9 @@
// global string with application path (utf-8)
CTFileName _fnmApplicationPath;
CTFileName _fnmApplicationPathTMP; // home dir or application path
-
+#ifdef PLATFORM_UNIX
+CTFileName _fnmAdditionalDirPath; // additional search path
+#endif
// global string with filename of the started application
CTFileName _fnmApplicationExe;
// global string with user-specific writable directory.
@@ -220,6 +222,16 @@
}
delete files;

+#ifdef PLATFORM_UNIX
+ // additional search path
+ files = _pFileSystem->FindFiles(_fnmAdditionalDirPath, "*.gro");
+ max = files->Count();
+ for (i = 0; i < max; i++) {
+ UNZIPAddArchive( _fnmAdditionalDirPath + ((*files)[i]) );
+ }
+ delete files;
+#endif
+
// if there is a mod active
if (_fnmMod!="") {
// for each group file in mod directory
--- a/SamTSE/Sources/Engine/Base/Stream.h 2024-02-15 12:44:53.057345383 +0300
+++ b/SamTSE/Sources/Engine/Base/Stream.h 2024-02-15 13:17:01.634702073 +0300
@@ -391,6 +391,10 @@

// global string with application path
ENGINE_API extern CTFileName _fnmApplicationPath;
+#ifdef PLATFORM_UNIX
+// global string with additional search path
+ENGINE_API extern CTFileName _fnmAdditionalDirPath;
+#endif
// global string with user-specific writable directory.
ENGINE_API extern CTFileName _fnmUserDir;
// global string with current MOD path
--- a/SamTSE/Sources/Engine/Base/Stream.cpp 2024-02-15 12:44:53.057345383 +0300
+++ b/SamTSE/Sources/Engine/Base/Stream.cpp 2024-02-15 13:17:01.634702073 +0300
@@ -78,7 +78,9 @@
// global string with application path (utf-8)
CTFileName _fnmApplicationPath;
CTFileName _fnmApplicationPathTMP; // home dir or application path
-
+#ifdef PLATFORM_UNIX
+CTFileName _fnmAdditionalDirPath; // additional search path
+#endif
// global string with filename of the started application
CTFileName _fnmApplicationExe;
// global string with user-specific writable directory.
@@ -194,15 +194,16 @@
}
}
// find eventual extension for the mod's dlls
- _strModExt = "";
+ _strModExt = "MP";
// DG: apparently both ModEXT.txt and ModExt.txt exist in the wild.
+/*
CTFileName tmp;
if(ExpandFilePath(EFP_READ, CTString("ModEXT.txt"), tmp) != EFP_NONE) {
LoadStringVar(CTString("ModEXT.txt"), _strModExt);
} else {
LoadStringVar(CTString("ModExt.txt"), _strModExt);
}
-
+*/

CPrintF(TRANSV("Loading group files...\n"));

@@ -220,6 +222,16 @@
}
delete files;

+#ifdef PLATFORM_UNIX
+ // additional search path
+ files = _pFileSystem->FindFiles(_fnmAdditionalDirPath, "*.gro");
+ max = files->Count();
+ for (i = 0; i < max; i++) {
+ UNZIPAddArchive( _fnmAdditionalDirPath + ((*files)[i]) );
+ }
+ delete files;
+#endif
+
// if there is a mod active
if (_fnmMod!="") {
// for each group file in mod directory
Loading

0 comments on commit 6af7fc3

Please sign in to comment.