Menu

#4 Add configurable data dir

open
nobody
None
5
2012-06-08
2012-06-08
No

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.

Discussion

  • Gregouar

    Gregouar - 2012-06-08

    The resources can be redirected via holyspirit.ini.

     
  • Sven-Hendrik Haase

    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.

     
  • Igor

    Igor - 2012-06-14

    I have added feature into trunk. There are still some problems with few
    Data files pathes, but it works.

     
  • Johannes Dewender

    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

     
  • Johannes Dewender

    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.

     
  • Johannes Dewender

    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)

     

Log in to post a comment.

MongoDB Logo MongoDB