Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationPath is tied to exec location #27

Open
bademux opened this issue Mar 26, 2021 · 0 comments
Open

ApplicationPath is tied to exec location #27

bademux opened this issue Mar 26, 2021 · 0 comments

Comments

@bademux
Copy link

bademux commented Mar 26, 2021

Hello,

As per #5 (comment) resources path should be independent from binary location
Looks like GetExecutablePath shoild be replaced with GetUserDirectory https://github.com/ptitSeb/Serious-Engine/blob/master/Sources/Engine/Engine.cpp#L274 in order to use SDL's Prefs

It is pain to extract game resources into separate folder as the game do some manipulations in the same dir.
For most painful things I apply hacks (sorry for ugly bash code):

Add fallback to default lib location if nothing found:

'@@ -107,0 +108 @@\n'\
'+        if (module == NULL) DoOpen(fnm.FileName()+fnm.FileExt());\n'\
| patch target/Sources/Engine/Base/Unix/UnixDynamicLoader.cpp &&

Use GetUserDirectory instead of GetExecutablePath

printf ''\
'@@ -274 +274 @@\n'\
'-  _pFileSystem->GetExecutablePath(strExePath, sizeof (strExePath)-1);\n'\
'+ _pFileSystem->GetUserDirectory(strExePath, sizeof (strExePath)-1);\n'\
| patch target/Sources/Engine/Engine.cpp

And also those two (as a consequence of previous):
The game creates log file in dir defined by GetUserDirectory - log file can't be disabled
For some reason the game attempts to open libEntitiesMP.so (invocation lfomethere from resource loading code) - empty file should be created
bash touch "$UserDirectory/Bin/libEntitiesMP.so"

ref: https://github.com/bademux/serioussam-server/blob/master/Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant