[Scummvm-devel] Fastening text display in Scumm engine
Max Horn
max at quendi.de
Tue Jun 26 12:58:21 CEST 2007
On Di, Juni 26, 2007 11:40, Nicolas Bonifas wrote:
> Hello,
>
> I wrote a small patch that dramatically fastens
Nit-picky side note: "fasten" / "fastening" does not mean what you think,
in particular, it does *not* mean "speed up" / "speeding up". (see
<http://www.wordreference.com/enfr/fasten>).
> text display in Scumm,
OK, judging from the rest of your email, you are actually talking about
the NUT renderer (which is only one of several ways text gets rendered in
SCUMM).
> by simply recording the values returned by unpackChar instead of
> computing them each time we need them.
We actually used to do it this way in the past, so if you want this
"faster" execution, just look at the source of e.g. 0.9.1. We don't do it
anymore to conserve memory. The speed difference is, in our experience,
complettly negligible for real-life use of the text rendering code in the
games, even on a 200Mhz device. Whether you take 1ms or 2ms to render a
screen of text really doesn't matter there.
If you are aware of any specific spots in a SCUMM game where the text
output is too slow and thus causes annoyances, please report them, so that
we can look into them. However, the way to optimize this would be to
improve unpackChar(), not to precompute the char data. For example,
unpackChar would probably be a lot faster if turned it into a template
with "bpp" being a const template parameter, then the optimizer should be
able to improve it a lot.
Cheers,
Max
More information about the Scummvm-devel
mailing list