Opened 9 years ago

Closed 9 years ago

Last modified 9 months ago

#9171 closed patch

MYST: Fix drawing partial subimages

Reported by: bgK Owned by: SF/mthreepwood
Priority: normal Component: Engine: Mohawk
Keywords: Cc:
Game: Myst

Description

Source rects for subimages are stored in bitmap coordinates (upside down compared to screen coordinates). This patch implements the proper transformation from bitmap to screen coordinates. The change can easily be seen on the selection buttons of the imager on Myst.

Ticket imported from: #2988976. Ticket imported from: patches/1276.

Attachments (4)

myst-subimages.diff (3.2 KB) - added by bgK 9 years ago.
V2
myst_safe_original.png (145.2 KB) - added by SF/mthreepwood 9 years ago.
Screenshot of Cabin Safe in original game
myst_safe_scummvm.png (119.8 KB) - added by SF/mthreepwood 9 years ago.
Screenshot of Cabin Safe in ScummVM
VS.png (170.6 KB) - added by bgK 9 years ago.
Original VS ScummVM

Download all attachments as: .zip

Change History (16)

comment:1 Changed 9 years ago by SF/mthreepwood

Owner: set to SF/mthreepwood

comment:2 Changed 9 years ago by SF/mthreepwood

Thank you for the patch.

While this patch does indeed a step in the right direction, it currently draws subimages shifted one pixel to the right and up.

For reference, take a look at these cards where the problem is clearly visible:
myst 4100 - the safe image
myst 4006 - the clock tower controls

comment:3 Changed 9 years ago by bgK

Indeed, there is a one pixel offset in some cases. However it happens as well without the patch. (And I haven't fount how to fix it.)

Changed 9 years ago by bgK

Attachment: myst-subimages.diff added

V2

comment:4 Changed 9 years ago by bgK

I've been doing more tests, and the 1 pixel shift happens as well with the original engine, at least with Myst ME. The fix for partial subimages seems good.

Changed 9 years ago by SF/mthreepwood

Attachment: myst_safe_original.png added

Screenshot of Cabin Safe in original game

Changed 9 years ago by SF/mthreepwood

Attachment: myst_safe_scummvm.png added

Screenshot of Cabin Safe in ScummVM

comment:5 Changed 9 years ago by SF/mthreepwood

You are right in that the horizontal pixel shift is in the original engine, but not the vertical one. See these two screenshots.

Also, the image for the clock tower controls button is broken.

Changed 9 years ago by bgK

Attachment: VS.png added

Original VS ScummVM

comment:6 Changed 9 years ago by bgK

Please look at the attachment to understand the origin of the 1 pixel offset bug. The original engine does not draw the first line of the background. That is to say the vertical resolution used is 332px, not 333px.
If you want more proof, just put a breakpoint on the StretchBlt call in the blitting function, and check the arguments.

comment:7 Changed 9 years ago by SF/mthreepwood

I'm not doubting that the original engine did that, but the patch doesn't handle this. Nor does it handle some images (ie. the button on the clock tower controls) correctly still.

comment:8 Changed 9 years ago by bgK

This patch was never meant to be a panacea. There are lots of things to fix in the Myst engine (the variables system is completely wrong, thus lots of opcodes). I guess the right way is one at a time.

comment:9 Changed 9 years ago by SF/mthreepwood

I never said it was, but I don't want to commit a patch with only a partial fix for an issue.

comment:10 Changed 9 years ago by SF/mthreepwood

Committed in r54297

I've applied the patch because Bastien is working on other parts of the code and it is an improvement over the previous code.

comment:11 Changed 9 years ago by SF/mthreepwood

Status: newclosed

comment:12 Changed 9 months ago by digitall

Component: Engine: Mohawk
Game: Myst
Note: See TracTickets for help on using tickets.