Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MOHAWK: Refactor CDToons decoder - #7907

Open
ied206 wants to merge 2 commits into
scummvm:masterfrom
ied206:image-cdtoons-decoder-refactor
Open

MOHAWK: Refactor CDToons decoder#7907
ied206 wants to merge 2 commits into
scummvm:masterfrom
ied206:image-cdtoons-decoder-refactor

Conversation

@ied206

@ied206 ied206 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Refactor CDToons decoder based on the original decoder binary.

  • The reference binary QB32.QTC used in research was taken from the Logical Journey of the Zoombinis v1.11KR.
  • The revised code was battle-tested against 528 CDToons MOV samples from every possible Mohawk game.

@ied206 ied206 changed the title MOHAWK: Zoombini - Refactor CDToons decoder MOHAWK: Refactor CDToons decoder Sep 8, 2026
@ied206
ied206 force-pushed the image-cdtoons-decoder-refactor branch from 1eb6250 to d92b0ff Compare September 8, 2026 22:27
Comment thread image/codecs/cdtoons.cpp Outdated
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());
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what Surface::fillRect() does - use that instead, please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced this function and its callers with Surface::fillRect() in the latest commit.

Comment thread image/codecs/cdtoons.cpp Outdated
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;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Surface::getSubArea() instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@ied206
ied206 requested a review from bluegr September 12, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants