Heretic: Use HHEVER lump to set HHE version for HEHACKED lumps #1173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Will resolve #1167
I chose to implement checking a HHEVER lump; relying on heuristics alone is too ambiguous (though might be beneficial as an addition), and adding the info in the HEHACKED lump itself is too annoying for people who might want to work with HHE and would constantly have to manually edit their patch.
Outstanding issues:
I get this warning that I don't know how to fix properly:
crispy-doom/src/heretic/d_main.c:1195:9: warning: implicit declaration of function ‘SetHHEVersionFromLump’ [-Wimplicit-function-declaration]
including
"deh_htic.h"
, where the function is declared, gives an error instead:crispy-doom/src/heretic/deh_htic.h:53:8: error: unknown type name ‘deh_section_t’
I'm probably missing something obvious but I'm not sure what.
Do I need to sanity-check the HHEVER lump? We only need to ever read 3 bytes from it.
Right now I've set it to ignore the HHEVER lump if
-hhever
is specified, but there's no technical reason this needs to be the case; it seems fine if you add a patch with-deh mypatch.hhe -hhever 1.0
and then read more patches from HEHACKED lumps from the wad, with HHEVER set to 1.3. Thoughs/opinions?Even with this implementation, it's still possible to load 1.0 patches (the default) outside of a wad without a
-hhever
parameter. I think this is important since that's necessary for autoload without specifying a HHE version.