Re: [AD] Magic main in Windows |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Stepan Roh:
> What about adding these two functions:
> get_data_path()
> - returns path where datafiles are located (path with executable on Win,
> /usr/share/XY on *nix)
According to FHS, that should be /usr/share/games/XY, and wouldn't it also need
to support /usr/local hierarchy? And what if a user installed the game to his
home dir?
> get_state_path()
> - returns path where game state files (= saves, modifiable config files,
> etc.) should be stored (again path with executable on Win, ~/.XY on *nix)
> Of course that brings the problem what XY is/should be :-)
Yeah, I think functions like these should be left for users to implement.
I've got one that works like this:
primary keywords:
game
tool
(There are differences to where files should be stored in both Windows and
Linux depending on whether the application is a game or not.)
secondary keywords:
bin
doc
data (static data)
var (variable data)
user (home dir)
usage:
find_file("game/data/foo");
In Linux, this resolves to either /usr/share/games/XY/foo,
/usr/local/share/games/XY/foo or "exe_parent"/data/foo, depending on path to
executable (I only plan to support Linux, so I use /proc/self).
--
Daniel Schlyder
http://bitblaze.com/