Repository navigation
Conversation
…r stays mirrored (#1348) At the game's size a crosshair tile mirrors about the middle of pixel (W/2, H/2). A zoom about that pixel's corner moved the crosshair's middle 0.5 * (S - 1) px down and right, so at 1.25 its top/left edges were sampled differently from its bottom/right ones: a 1-texel border came out 1.5 px on the top and left and 2.3 px on the bottom and right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er (#1348) Zooming about the centre pixel's middle mirrored the crosshair but left each arm's two ends 1.5 and 2.4 px at 1.25. Landing the middle on the corner puts every edge of the creator's crosshairs at the same phase: 1.68 to 1.85 px on POST and PRE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Combined in-game test of #1350, #1351 and #1352 Built from dev f628957 with all three branches merged locally. They merge with no conflicts. DLL:
Evidence is in |
This was referenced Nov 9, 2026
This branch has not been deployed
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.
Release note: Fixed: the crosshair border is now the same thickness on every side.
Closes #1348
Cause
The border in #1348's captures isn't drawn by
ds_hud_crosshair_outline_size. It's the 1-texel black border incustomxhair-diceWSOD.spr's own art. That sheet's tiles 7–12 (the ones the Players table uses) are exact mirror images, centred in their 64×64 tiles. So none of the difference comes from the art.At the game's size, a tile's pixels mirror about the middle of pixel (1280, 720) (2560×1440).
ds_hud_crosshair_scalezoomed about the corner of that pixel. That moved the crosshair's middle0.5 × (S − 1)px down and right, onto neither a pixel's middle nor its edge. Then each edge's texel was sampled at a different phase, and the outer edges are hard-cut by the alpha test (the movie cfg'sgl_spriteblend 0). At 1.25 that came out as 1.5 px on the top and left and 2.3 px on the bottom and right. Scale 2 happened to land on a pixel edge, which is why it looked right.Fix
crosshair_scale::zoom_pointpicks the zoom point so that the crosshair's middle lands exactly on the centre corner (W/2, H/2) at any scale. One function changed; the drawn outline (#1338) uses the same zoom and needs nothing else.Zooming about the pixel's middle also gives a mirror image, and I tried it first. But it left each arm's two ends at 1.5 and 2.4 px. Landing on the corner gives every edge 1.7–1.85 px. The creator's crosshairs are drawn about a texel corner, so on a pixel corner all the edges fall at the same phase.
Tested
In game, both installs, Brain,
wsod25_grp4_h1_m00cat_dod_railroad2_test_1(m00cat, tile 8 ofcustomxhair-diceWSOD.spr), 2560×1440, captured through the hook's batch. The figures are border px per side, measured along the centre row, the centre column and across each arm; each is the mean, with the smallest and largest edge after it.gl_spriteblendWith
gl_spriteblend 1the outer edge is blended instead of cut, so the border reads thinner (about 1.2 px, the texel's true 1.27) and the old shift was smaller (about 0.2 px instead of 0.8). The pink's inner edge blends into the black the same way at either value.The red crosshair (
cl_xhair_style 0, POST 1.25) moves by at most a pixel. Its arms used to sit 3 px further right than left; now the difference is 1 px. That piece's layout is DoD's own dynamic gap.cargo test -p goldsrc-hooks crosshair_scale, rustfmt and clippy (host and i686, 1.98.1) are clean.Frames, zoomed crops and the before/after image:
D:\dodstudio-tests\crosshair-border-1348\.🤖 Generated with Claude Code