XProger / OpenLara

Classic Tomb Raider open-source engine
http://xproger.info/projects/OpenLara/
BSD 2-Clause "Simplified" License
4.69k stars 359 forks source link

Add envvar option for data location #400

Closed IMbackK closed 2 years ago

IMbackK commented 2 years ago

Hi,

Currently the engine loads data files relative to the binary like the original windows pc versions. When packaging for unix systems this is undesirable as here we want to shove the binary into /usr/bin and have the platform independent data reside in /usr/share/openlara or maybe ~/.openlara/.

I would be great for packing for the various unix distributions if openlara core could support a path that if it inset NULL is prepended whenever a resource is loaded with the current paths relative to the binary being used if it isent set. The platform specific code could then set this path as appropriate for that platform with the nix and sdl target having an optional --data=$PATH argument or maybe a optional envvar OPENLARA_DATA_PATH or whatever.