fix(smudge): Fix minor errors in W3DSmudge#2483
Open
xezon wants to merge 1 commit intoTheSuperHackers:mainfrom
Open
fix(smudge): Fix minor errors in W3DSmudge#2483xezon wants to merge 1 commit intoTheSuperHackers:mainfrom
xezon wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp | Three targeted bug fixes: static_assert replaces an incorrect comment guard (changes multiplier from 12 to 5), a copy-paste bug using m_offset.X instead of m_offset.Y for the center UV Y coordinate is corrected, and the DX8 vertex buffer is now set only after the WriteLockClass RAII lock goes out of scope. Formatting cleanups accompany the logic changes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[W3DSmudgeManager::render] --> B[Compute smudge UV coords]
B --> C{UV out of bounds?}
C -- "X or Y outside 0..texClamp" --> D[Zero m_offset.X / m_offset.Y]
C -- in bounds --> E[Compute center vertex UV]
D --> E
E --> F["verts[4].uv.Y = base + uvSpanY*(0.5 + m_offset.Y) ✔️ (was .X)"]
F --> G[Outer render batch loop]
G --> H["DynamicVBAccessClass vb_access(count*5 verts)"]
H --> I["WriteLockClass lock{vb_access} — lock acquired"]
I --> J[Fill vertex data into locked buffer]
J --> K{Batch full?}
K -- yes --> L[goto flushSmudges — scope exits, lock RAII destructor called]
K -- no --> M[Continue filling]
M --> N{All smudges done?}
N -- no --> J
N -- yes --> O[Exit lock scope — destructor called]
O --> P["flushSmudges: Set_Vertex_Buffer + Draw_Triangles ✔️ (lock released)"]
L --> P
P --> Q{smudgesRemaining > 0?}
Q -- yes --> H
Q -- no --> R[Restore render states / done]
Reviews (1): Last reviewed commit: "fix(smudge): Fix minor errors in W3DSmud..." | Re-trigger Greptile
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.
This change adds a few minor fixes to W3DSmudge.
The static assert turns the comment to a compile guarantee.
The smudge offset Y is now used correctly, but visually appears to have no obvious impact.
The
vb_accessbuffer inW3DSmudgeManager::renderis no longer forwarded to rendering before the lock is lifted.