Re: [AD] allegro 3.9.33 patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


anarko <anarko@xxxxxxxxxx> wrote:
> Hello conductors,
> 
>   attached to this mail are two diff files for gui.c and guiproc.c
>   that makes sure that the value set by text_mode() is restored
>   after calling gui functions who uses it.

Since Michael has already applied this it's probably too late, but
wouldn't it be better to only save and restore the state of
`_textmode' only when absolutely necessary?

e.g. (pseudo-diff)

int d_text_proc(int msg, DIALOG *d, int c)
{
-   int rtm;
-
-   rtm=_textmode;
-
   if (msg==MSG_DRAW) {
      int fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
      FONT *oldfont = font;
+      int rtm;

      if (d->dp2)
	 font = d->dp2;

+      rtm = _textmode;	 
      text_mode(d->bg);
      gui_textout(screen, d->dp, d->x, d->y, fg, FALSE);
+      _textmode = rtm;
      
      font = oldfont;
   }

-   _textmode=rtm;
-
   return D_O_K;
}

I guess it's not important.

-- 
DISCONFECT (dis kon FECT), v.  To sterilize the piece of candy you dropped
on the floor by blowing on it, somehow assuming this will "remove" all the
germs.  -- Rich Hall, "Sniglets"



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/