Currently, the executable needs to have its data handy in the same dir it is in. This sucks for proper distribution. Please add data dir support during compile time and run time.
Yes, but the executable doesn't know where that file even is! Imagine a standard distribution installation where the executable is in /usr/bin/holyspirit and the data is in /usr/share/holyspirit. This is currently not possible but it should be possible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BINDIR is "games". DATADIR is "share/games/holyspirit"
However, the binary still tries to finde these files in relative to the binary (not in the datadir):
Failed to load image "Data/Miscs/Fonts/menu_typo.png". Reason : Unable to open file
Failed to load image "Data/Miscs/Fonts/menu_typo_h.png". Reason : Unable to open file
Failed to load image "Data/Miscs/Fonts/menu_typo_p.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Miscs/AmbientShadow.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Menus/UI/Border.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Menus/Mainscreen_menu.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Menus/Logo_hs.png". Reason : Unable to open file
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found another problem with the "configurable data dir" in revision 2381:
The result is, that even in the tutorial my crusader can't use the starting sword when using a install prefix.
The problem could be (a guess):
class specific items (saved in Data/Miscs/Items.rs.hs) seem to have strings like "Data/Miscs/Heroes/Crusader/Crusader.class.hs" and are compared to the actual location of the class file (as saved in a vector and taken from holyspirit.ini)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The resources can be redirected via holyspirit.ini.
Yes, but the executable doesn't know where that file even is! Imagine a standard distribution installation where the executable is in /usr/bin/holyspirit and the data is in /usr/share/holyspirit. This is currently not possible but it should be possible.
I have added feature into trunk. There are still some problems with few
Data files pathes, but it works.
Tested with revision 2381.
BINDIR is "games". DATADIR is "share/games/holyspirit"
However, the binary still tries to finde these files in relative to the binary (not in the datadir):
Failed to load image "Data/Miscs/Fonts/menu_typo.png". Reason : Unable to open file
Failed to load image "Data/Miscs/Fonts/menu_typo_h.png". Reason : Unable to open file
Failed to load image "Data/Miscs/Fonts/menu_typo_p.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Miscs/AmbientShadow.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Menus/UI/Border.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Menus/Mainscreen_menu.png". Reason : Unable to open file
Failed to load image "Data/Graphics/Menus/Logo_hs.png". Reason : Unable to open file
After this is working, the next step would be to not write savegames into the data directory.
Savegames (+ logs) go in the home directory of the user (Data/User/Save, Log.txt)
The configuration files should go to /etc (configuration.conf, key_mapping.conf)
Not really sure what Data/User/Tmp is supposed to do, but this might belong in /tmp.
Apart from that, it works quite well on Arch Linux.
I found another problem with the "configurable data dir" in revision 2381:
The result is, that even in the tutorial my crusader can't use the starting sword when using a install prefix.
The problem could be (a guess):
class specific items (saved in Data/Miscs/Items.rs.hs) seem to have strings like "Data/Miscs/Heroes/Crusader/Crusader.class.hs" and are compared to the actual location of the class file (as saved in a vector and taken from holyspirit.ini)