[Scummvm-devel] 0.9.0: Oops! Missing clipping in about dialog...

Johannes Schickel lordhoto at gmail.com
Thu Jun 22 00:29:54 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marcus Comstedt wrote:
> Well, I was just running some extra tests on the Dreamcast, when I
> noticed that the about dialog (GUI::AboutDialog) was crashing.
> 
> When looking at the function AboutDialog::drawDialog(), I saw that
> it uses g_gui.theme()->setDrawArea() to set up a clipping region.
> Well, that's all and well.  However, ThemeClassic::drawText() doesn't
> clip against the _drawArea.  In fact, it doesn't even clip against
> the screen size.  Furthermore, the function _font->drawString() which
> is used to draw the text does not take a height argument, only width,
> so even if the Rect _was_ clipped, there would be no protection
> against drawing below the edge of the screen if the y coordinate
> is too large.  Which it is for the bottom line in the about dialog.
> Also, the top line sometimes gets a negative y.
> 
> I think we need to fix this before tagging...  A quick fix is to
> add the following check to drawText() (in both themes):
> 
>         if(r.top < 0 || r.bottom > _screen.h) 
>             return; 
> 
> It's a bit ad hoc, but I suppose it would be ok for the release
> branch?
> 

I just checked the code, but it should clip all stuff (check
NewFont::drawChar, ThemeClassic::restoreBackground and
ThemeClassic::addDirtyRect), also I used valgrind and I didn't get any
warning. So maybe you should track it down and tell us the real problem.
(I tried Classic theme in 320x200, which is used for Dreamcast as far as
I saw it...)

// Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEmchiNM5ktBgbZ9QRApVWAJ9GbAIC1+eznJ9huLh2I6lJSW7AKQCeLSrg
06Qbz9mUBEL7/4vntr2i22c=
=rgF2
-----END PGP SIGNATURE-----




More information about the Scummvm-devel mailing list