Repository navigation
fix: update the embedded SGD2FreeRes to 3.0.3.1 (extended tile culling) - #29
Merged
Merged
Conversation
Replaces SGD2FreeRes 3.0.2.0 (May 2021) with release 3.0.3.1 (published 2022-10-27) from the original repository, mir-diablo-ii-tools/SlashGaming-Diablo-II-Free-Resolution, asset "SGD2FreeRes.3.0.3.1.-.Vanilla.zip". This is the official release, not a fork's build. Zip SHA-256: 4469a1f8d5299e9af935d088324504be5eed948f49c26aa568797a77d1c28463 3.0.3.0 and 3.0.3.1 extend the tile culling, which should reduce the black tile-shaped patches at the screen edge at large resolutions. They also add 1.10 and 1.12A support to the mod. Also: the .mpq is unchanged from 3.0.2.0; the .lzma files are regenerated (the .mpq one is byte-identical); licence and readme files updated; Changelog.txt replaced by CHANGELOG.md; RapidJSON licence added; the 5 MB SGD2FreeRes.pdb, which belonged to the old DLL, is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A small program that packs and unpacks the .lzma files embedded by d2dx.rc, using the bundled PocketLzma. With its BestCompression preset, built 32-bit and unoptimised, it reproduces the existing SGD2FreeRes .lzma files byte for byte. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
SGD2FreeRes 3.0.3.1 bundles RapidJSON, so its licence file goes into the licenses folder with the other third-party licences. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
README credits now name SGD2FreeRes 3.0.3.1 (official release) and RapidJSON. AGENTS.md points at tools/pack_lzma.cpp for regenerating the embedded .lzma files, and records the source, tag and zip SHA-256 of the embedded SGD2FreeRes build. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The official 3.0.3.1 DLL only reads SGD2FreeResolution.json, so it ignored the config D2DX generates, wrote defaults pointing at an MPQ that does not exist, and crashed in the menus. Change that one file-name string in the official DLL to d2dx_sgd2freeres.json (23 bytes, in place). The 3.0.2.0 DLL embedded before was the official one with the same change. tools/patch_sgd2freeres.py applies and verifies it; MODIFICATIONS.md is the modification notice and reproduction steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Credit line, release zip (the modification notice goes into licenses/) and the AGENTS.md update procedure, which now says to read the DLL's strings and not only the changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Replaces the embedded SGD2FreeRes 3.0.2.0 with the official 3.0.3.1 release from the original repository, mir-diablo-ii-tools/SlashGaming-Diablo-II-Free-Resolution (tag 3.0.3.1, published by the repo owner on 2022-10-27, asset
SGD2FreeRes.3.0.3.1.-.Vanilla.zip, SHA-2564469a1f8d5299e9af935d088324504be5eed948f49c26aa568797a77d1c28463), plus one 23-byte change (below).Why: at large custom resolutions (seen at 1128x752 on 1.14d under Wine) black, tile-shaped patches appear at the top-right screen edge. Tests narrowed it down: still there with motion prediction off, mostly gone at the vanilla 800x600 view. The official changelog says 3.0.3.0 extends the tile culling limit and 3.0.3.1 extends it further "to lessen the tile culling problem in D2DX with motion prediction enabled". Both are newer than the 3.0.2.0 we embed. It also carries other fixes (a crash after Act transition cutscenes, a Windows 7 load fix). The official notes say rooms beyond the adjacent ones can still be left unrendered, so some edge artifacts may remain.
The one change (and why the first attempt crashed): the official DLL hard-codes its config file name,
SGD2FreeResolution.json. D2DX writes its ownd2dx_sgd2freeres.jsonso it never overwrites a player's own SGD2FreeRes files. An in-game test of the unmodified official DLL ignored D2DX's config, wrote defaults pointing at a non-existentSGD2FreeRes.mpq, and crashed in the menus. The 3.0.2.0 DLL we embed today turns out to be the official 3.0.2.0 DLL with exactly this string changed (checked byte for byte: 23 bytes differ, nothing else; the MPQ is identical to official). So the same change is applied to 3.0.3.1:SGD2FreeResolution.jsonbecomesd2dx_sgd2freeres.jsonin place, nothing else touched.tools/patch_sgd2freeres.pyapplies and verifies it (it checks the official hash first and that the string occurs exactly once);thirdparty/sgd2freeres/MODIFICATIONS.mdis the modification notice and reproduction steps, and ships in the release zip. Patched DLL SHA-256408b1b5e0fd53295273a0c3af1745f4cac2554d73cf2e44f57337527c1c8bfa7.Other changes
SGD2FreeRes.mpqunchanged (byte-identical to before and to the official file)..lzmaresources regenerated with a newtools/pack_lzma.cpp, validated first: it unpacks the old resources to the old files exactly and reproduces the old.lzmabyte for byte. Must be built 32-bit and unoptimised (PocketLzma has undefined behaviour otherwise);AGENTS.mdhas the commands.LICENSE.mdadds a D2DX section), RapidJSON licence added and shipped in the zip, README credits updated, and the stale 5 MBSGD2FreeRes.pdbremoved.AGENTS.mdrecords the official source, the modification, and the update procedure, including checking the file names the DLL reads (strings in the binary, not just the changelog).Verified in the game: the CI build of this branch (run 40114730108) was played on 1.14d under Wine/Proton (Lutris) at 1128x752 on a 2256x1504 screen. It starts and runs, the black tile patches seen with 3.0.2.0 at the top-right screen edge are completely gone (reported by the player), the DLL written out at startup has the expected patched hash, and no
SGD2FreeResolution.jsonis created (so the patched DLL reads D2DX's config). The unpatched official DLL crashed in the menus, which is why the one-string patch is needed. Still untested: other game versions and native Windows.Follow-up (not in this PR): this SGD2FreeRes version also supports 1.10 and 1.12A, but
BuiltinResModstill only enables the resolution mod on 1.09d, 1.13c, 1.13d and 1.14d.🤖 Generated with Claude Code