MOHAWK: Refactor CDToons decoder - #7907
Open
ied206 wants to merge 2 commits into
Open
Conversation
ied206
force-pushed
the
image-cdtoons-decoder-refactor
branch
from
September 8, 2026 22:27
1eb6250 to
d92b0ff
Compare
bluegr
reviewed
Sep 10, 2026
Comment on lines
+99
to
+106
| static void fillSurfaceRect(Graphics::Surface &surface, const Common::Rect &rect, byte color) { | ||
| Common::Rect clipped = clipToSurface(rect, surface); | ||
| if (clipped.isEmpty()) | ||
| return; | ||
|
|
||
| for (int y = clipped.top; y < clipped.bottom; y++) | ||
| memset(surface.getBasePtr(clipped.left, y), color, clipped.width()); | ||
| } |
Member
There was a problem hiding this comment.
This is what Surface::fillRect() does - use that instead, please
Contributor
Author
There was a problem hiding this comment.
I replaced this function and its callers with Surface::fillRect() in the latest commit.
bluegr
reviewed
Sep 10, 2026
Comment on lines
+93
to
+97
| static Common::Rect clipToSurface(const Common::Rect &rect, const Graphics::Surface &surface) { | ||
| Common::Rect clipped = rect; | ||
| clipped.clip(Common::Rect(0, 0, surface.w, surface.h)); | ||
| return clipped; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I rewrote clipToSurface callers to use Surface::getSubArea() directly in the latest commit.
Use the Surface fill and subArea helpers directly. Keep the unit tests buildable when the optional CDTOONS component is disabled. Assisted-by: Codex:gpt-5.6
ied206
added a commit
to ied206/scummvm-zoombini
that referenced
this pull request
Sep 11, 2026
Delegate transparent-key text blits to Graphics::Surface. Use getRect() for full-surface rectangles, following PR scummvm#7907. Assisted-by: Codex:gpt-5
ied206
added a commit
to ied206/scummvm-zoombini
that referenced
this pull request
Sep 11, 2026
Remove the redundant allocation before Surface::copyFrom(). Release the captured back screen after restoring it. Found while applying review feedback from PR scummvm#7907. Assisted-by: Codex:gpt-5
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.
PR Summary
Refactor CDToons decoder based on the original decoder binary.
QB32.QTCused in research was taken from theLogical Journey of the Zoombinis v1.11KR.