Repository navigation
Converter: the map's preset by name (no change for M, K, F) - #90
Merged
Merged
Conversation
…unchanged A per-preset table (map.cpp known_presets: name, the map versions it uses, the player's no-model message) replaces the version-derived letter. A map may name its preset in the optional top-level field "preset"; without it the preset is the one its version always meant (1/4 M, 2/3 K, 5 F), so the shipped maps load as before. An unknown name, a non-text value or a preset that does not use the map's version is converter data damaged. Unit tests for the field and the table; the converter's outputs on the synthetic test vectors are byte for byte those of main. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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.
The converter told which preset a map is for from its version number alone (versions 1 and 4: M, 2 and 3: K, 5: F).
A further preset that reuses an existing map version could not be named. This makes the preset a name the map can
carry, with no change for the existing presets.
clean/converter/src/map.cppknown_presets, declared inmap.hwithfind_presetandpreset_for_version): each preset's name, the map versions its maps use, and the player's "no preset-X model"message (exit 12).
api.cpptakes that message from the table instead of a hard-wired M/K/F choice."preset"(text). Without it, the preset is the one the map's version always meant,so the shipped maps (
data/preset-M.v1,-K.v1,-F.v1, none of which has the field) load exactly as before.With it, the name must be in the table and its preset must use the map's version. Otherwise the map is
"converter data damaged" (
"K"in a version-1 map,"X","m","",7,null).Map::preset()still returnsthe letter, and
Map::preset_info()gives the table entry.main.cppusage text: the optional-group rule is described for any map with an optional group, not as "preset M".clean/converter/README.md: the field and the table.No new preset is added here. That is a later pull request, once its map data exists.
Refs #89
Tested
Run locally on Windows, CPU only, Ninja Release
/MTwith MSVC. "Main" is d9c697e.ctest(unit, decompression-vectors, synthetic, synthetic5): 4/4 passed on main and on this branch.tests/unit_tests.cpp,test_api_files): no field means the version's preset;"preset":"M"inthe version-1 and version-4 unit maps loads, with the same stages and sources; the seven bad values above are
refused as damaged, with the reason logged; the table's names, version sets and messages.
syntheticandsynthetic5tests (seeded synthetic DLLs and maps for M, K andF, including
--raw), every output file was hashed on main and on this branch: 1615 files (63model.wgcmplustheir raw tensors), SHA-256 identical, 0 differences.
wg-core,launcher-core,coexist-core,source-size,wording): 5/5 passed.python tools/ci/check_line_endings.py: 1143 files, 0 problems.Not tested
WRONGGPU_TESTINGbuild and its integration suites: the launcher code does not change, and itonly reaches the new code through
load_mapand the exit-12 message, which stay the same for the shipped maps.