Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite D_DoomExeDir() to use SDL_GetBasePath() #1145

Merged
merged 2 commits into from
Jul 12, 2023
Merged

Conversation

fabiangreffrath
Copy link
Owner

No description provided.

@fabiangreffrath
Copy link
Owner Author

Hm, I'll either have to include d_main.c in SETUP_SOURCES, or move the function to a different source file. Any suggestions?

@fabiangreffrath
Copy link
Owner Author

The rationale for this is that SDL has quite some sophisticated means for determining the directory from which the process executable was started for different OSes, and they do not even fall back to parsing argv[0] (but we do):

https://github.com/libsdl-org/SDL/blob/e8b6edd5a081d0b45c2ac39ab690e584a6b95a84/src/filesystem/unix/SDL_sysfilesystem.c#L248

@rfomin
Copy link
Collaborator

rfomin commented Jul 12, 2023

Hm, I'll either have to include d_main.c in SETUP_SOURCES, or move the function to a different source file. Any suggestions?

We can move D_DoomExeDir() to i_system.c or d_iwad.c. By the way, there is no SDL_GetBasePath() in Chocolate Doom, so maybe we don't need these complexities 😉

@fabiangreffrath
Copy link
Owner Author

We can move D_DoomExeDir() to i_system.c or d_iwad.c.

d_iwad.c feels like the more natural choice.

By the way, there is no SDL_GetBasePath() in Chocolate Doom, so maybe we don't need these complexities 😉

Yes, but Chocolate Doom's development more or less ceased right after the 3.0.0 release, which marked the initial switch to SDL 2. 😉

@fabiangreffrath fabiangreffrath merged commit dafff23 into master Jul 12, 2023
6 checks passed
@fabiangreffrath fabiangreffrath deleted the getbasepath branch July 12, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants