[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[43161] scummvm/branches/gsoc2009-draci/engines/draci

Robert Špalek rspalek at gmail.com
Sun Aug 9 21:40:07 CEST 2009

hi Denis,

On Sat, Aug 8, 2009 at 9:12 PM, <dkasak13 at users.sourceforge.net> wrote:

> Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
> ===================================================================
> --- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp    2009-08-09
> 04:09:24 UTC (rev 43160)
> +++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp    2009-08-09
> 04:12:36 UTC (rev 43161)
> +int Script::funcActIco(int iconID) {
> +
> +       // The parameter seems to be an omission in the original player
> since it's not
> +       // used in the implementation of the function. It's possible that
> the functions were
> +       // implemented in such a way that they had to have a single
> parameter so this is only
> +       // passed as a dummy.

yes, this is the case.  if you want, you can reformulate the comment
removing the doubt.

> +       // HACK: Some strings in the English data files are too long to fit
> the screen
> +       // This is a temporary resolution.
> +       if (speechFrame->getWidth() >= kScreenWidth) {
> +               speechFrame->setFont(_vm->_smallFont);
> +       } else {
> +               speechFrame->setFont(_vm->_bigFont);
> +       }
> +

scaling the font is a very good solution.  the real solution would be, of
course, to test the source game texts one by one, and reformat the long
ones, but that would require recompiling the game, and also the player would
not be able to handle well the already existing English version on the www.

I think you may be a bit more careful, because you test the width exactly
once, before changing the size.  the outcome is thus dependent on what the
font size was before the code was executed.  for example, if the font was
already set to small last time, and the currently drawn text is also too
long, your test (using the smaller font size) may succeed that the width is
small enough, you thus switch to the larger font, and then crop the text.

I know this is labeled as HACK, but I generally like the solution and so
it's acceptable for me to leave it there, as long as you fix my comment

Robert Špalek <rspalek at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20090809/d23832ce/attachment.html>

More information about the Scummvm-devel mailing list