jorgefz / Lince

OpenGL game engine written in C
MIT License
0 stars 0 forks source link

Provide search path for Lince's assets at compile time #4

Closed jorgefz closed 1 week ago

jorgefz commented 1 week ago

Paths to asset folders are stored in an array in the app. By default, it contains one entry for Lince’s default asset folder, which assumes the executable is located at e.g. “bin/CONF_OS-ARCH/PROJ/PROJ.exe”. If the executable is moved somewhere else, Lince won’t be able to find its own internal assets anymore (e.g. fonts). In this case, the user is required to work out the relative path between the executable and Lince’s asset folder, and append it to the asset folder array.

This is wasteful, because the default search path is still in the array and will be searched on every asset load. The location of the executable, however, is known at compile time, so it should be provided as a macro in the premake script.

jorgefz commented 1 week ago

Search path for Lince's assets can be provided via the macro LINCE_ASSETS_PATH