Map loading & wzmaplib refactoring#4193
Merged
past-due merged 29 commits intoWarzone2100:masterfrom Jun 1, 2025
Merged
Conversation
d657043 to
2c95e83
Compare
a52d201 to
356e286
Compare
80c3834 to
b8768eb
Compare
Which requires libzip
f40388a to
589eaf8
Compare
Add maxFileSize parameter, and return more detailed error information
e897f54 to
cd40faa
Compare
72051d6 to
0e29da7
Compare
…efully return to title screen
Use the WzMap::Map instance to do so, attempting to load the map itself earlier. Move loadTerrainTypeMap to map.cpp.
Maps are now loaded directly using wzmaplib, without having to mess with mounting map packages in the search path. Simplifies rebuildSearchPath, handling & processing of in-memory map archives (for replays), loading map previews, etc. Also speeds up map-handling performance, and removes a bunch of edge case failure possibilities that could lead to the game crashing while attempting to load a broken or outdated map package. These changes also mean that "map mods" are officially unsupported, and will just be treated as maps. When trying to load a "map mod", the map part will load - but none of the "mod" part. This is largely an improvement, as previously most older map mods would either crash the game or not load their mod files (as they modded older files that are no longer used), or some other weird combination of bad state / breaking graphics / etc. Mods are, of course, still supported - and can themselves include maps.
0e29da7 to
2b43a8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: This PR adds
libzipas a required dependency.Maps are now loaded directly using wzmaplib, without having to mess with mounting map packages in the search path.
Simplifies
rebuildSearchPath, handling & processing of in-memory map archives (for replays), loading map previews, etc. Also speeds up map-handling performance, and removes a bunch of edge case failure possibilities that could lead to the game crashing while attempting to load a broken or outdated map package.These changes also mean that "map mods" are officially unsupported, and will just be treated as maps. When trying to load a "map mod", the map part will load - but none of the "mod" part. This is largely an improvement, as previously most older map mods would either crash the game or not load their mod files (as they modded older files that are no longer used), or some other weird combination of bad state / breaking graphics / etc.
(Mods are, of course, still supported - and can themselves include maps.)