Closed Falcury closed 6 years ago
SDLPoP already does something similar if a replay file is passed in the command line: https://github.com/NagyD/SDLPoP/blob/master/src/replay.c#L375
However, there is a difference: the replay code chdir()s into the exe directory, while this code looks for each file in the current directory first. So if the current folder has some DAT files, then they override the default ones.
This makes it easier to run the game from another location
This should also be good for playing mods without losing the music, or mods that don't have all DAT files.
This adds a fallback so that whenever SDLPoP cannot find some file in the current working directory, it can instead load from the folder where the executable lives. This makes it easier to run the game from another location (not having to worry about missing data files).
Also:
unistd_win.h
intocommon.h
, as it is only a few lines long.common.h
file_exists()
inseg009.c
)