Opened 15 years ago

Closed 14 years ago

Last modified 6 years ago

#9171 closed patch

MYST: Fix drawing partial subimages

Reported by: bgK Owned by: SF/mthreepwood
Priority: normal Component: Engine: Mohawk
Version: 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 15 years ago.
V2
myst_safe_original.png (145.2 KB ) - added by SF/mthreepwood 15 years ago.
Screenshot of Cabin Safe in original game
myst_safe_scummvm.png (119.8 KB ) - added by SF/mthreepwood 15 years ago.
Screenshot of Cabin Safe in ScummVM
VS.png (170.6 KB ) - added by bgK 15 years ago.
Original VS ScummVM

Download all attachments as: .zip

Change History (16)

comment:1 by SF/mthreepwood, 15 years ago

Owner: set to SF/mthreepwood

comment:2 by SF/mthreepwood, 15 years ago

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 by bgK, 15 years ago

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.)

by bgK, 15 years ago

Attachment: myst-subimages.diff added

V2

comment:4 by bgK, 15 years ago

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.

by SF/mthreepwood, 15 years ago

Attachment: myst_safe_original.png added

Screenshot of Cabin Safe in original game

by SF/mthreepwood, 15 years ago

Attachment: myst_safe_scummvm.png added

Screenshot of Cabin Safe in ScummVM

comment:5 by SF/mthreepwood, 15 years ago

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.

by bgK, 15 years ago

Attachment: VS.png added

Original VS ScummVM

comment:6 by bgK, 15 years ago

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 by SF/mthreepwood, 15 years ago

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 by bgK, 15 years ago

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 by SF/mthreepwood, 15 years ago

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

comment:10 by SF/mthreepwood, 14 years ago

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 by SF/mthreepwood, 14 years ago

Status: newclosed

comment:12 by digitall, 6 years ago

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