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

Marcus Comstedt marcus at mc.pp.se
Wed Jun 21 23:08:28 CEST 2006


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?


(BTW, I noticed that the about scroll mentions AGI and other disabled
 engines.  I don't know if that's a problem or not, just though I
 should mention it.)


  // Marcus






More information about the Scummvm-devel mailing list