-
Notifications
You must be signed in to change notification settings - Fork 41
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
load extras.wad before IWAD #2078
Conversation
src/d_main.c
Outdated
@@ -1829,8 +1829,20 @@ void D_DoomMain(void) | |||
|
|||
LoadBaseFile(); | |||
|
|||
boolean extras_wad = false; | |||
const char *extras_path = D_FindWADByName("extras.wad"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to free()
this after use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 7c7d285
w_handle_t handle = {0}; | ||
if (w_file_module.Open(path, &handle) == W_FILE) | ||
{ | ||
array_clear(wadfiles); // don't register it before IWAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This screams "bug!" all over the place. I don't even understand what happens here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual lump table is in lumpinfo
. wadfiles
is just a list of WAD names, for wadfiles[0]
checks or save/autoload directories, not that important.
In w_file.Open()
the name of the WAD is recorded in the wadfiles
array, so we delete it and add it back after IWAD, so that other checks work. Ugly hack, but if we decide to implement an in-game launcher, we will have to redo this system anyway to load WADs on the fly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment, I won't remember until next week what happens here. 😉
I change my mind, indeed I probably forgot what is going on here after a week. |
Alternative to #2075
I don't like this hack, but extras.wad is nice.