[Scummvm-tracker] [ScummVM :: Bugs] #12796: SCUMM: COMI: Object label line printed on the wrong spot

ScummVM :: Bugs trac at scummvm.org
Wed Aug 11 15:53:38 UTC 2021


#12796: SCUMM: COMI: Object label line printed on the wrong spot
----------------------+------------------------------
Reporter:  AndywinXp  |       Owner:  (none)
    Type:  defect     |      Status:  new
Priority:  normal     |   Component:  Engine: SCUMM
 Version:             |  Resolution:
Keywords:             |        Game:  Monkey Island 3
----------------------+------------------------------
Comment (by athrxx):

 Thanks for the report. I'll clue you in what the cause of this issue is,
 so you can decide whether you want to fix it or not. The diagnosis is not
 the real problem here, the problem is the fix :-)

 The original has only one text printing method for everything.
 Unfortunately, our ScummVM forefathers made the decision to split it up:
 one accurate version for the Smush movies (found in smush/smush_font.cpp)
 and the rest shared through the existing SCUMM <=6 code. I fixed up the
 smush font code last year to make it pixel perfect (of course I am not
 going to make any promises, but all my tests were good :-). It just so
 happens that my fixes included the code for exactly what we have here:
 Just look at that:

 https://github.com/scummvm/scummvm/blob/master/engines/scumm/smush/smush_font.cpp#L343

 This would lift up the text exactly 16 pixels...

 COMI uses a 10, 10, 630, 470 clip rect:

 https://github.com/scummvm/scummvm/blob/master/engines/scumm/smush/smush_player.cpp#L649

 With the horizontally wrong pixel it's the same thing, really. If you look
 at the rest of that function SmushFont::drawStringWrap() you can see that
 it has unique methods to measure the horizontal and vertical dimensions of
 the whole text block. Sticking to exactly that method ensures the correct
 placement.

 How to fix this?
 For the vertical fix it could be hacked into here:

 https://github.com/scummvm/scummvm/blob/master/engines/scumm/string.cpp#L152

 As you can see there are other hacks already there for CJK texts which I
 actually took from disasm. So this is apparently the place where even the
 original developers saw fit to place such hacks.

 The issue with a possible fix is that we're missing all the width and
 height measuring logic from smush font (which would have been correct to
 have for all SCUMM7/8 texts).
 If it is safe to assume that the COMI object descriptions are the only
 case we're treating here
  then we could probably live without the wrapping and height measuring
 logic and just make an per-case fix.

 With the horizontally off-by-one thing, that's difficult without the
 correct measuring.

 Btw., I think the problem you're trying to solve in your PR is kind of the
 same thing, too.

 Please let us know whether you want to try to make a fix or whether we
 should do it ourselves...
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/12796#comment:1>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list