Re: [AD] GGI patch for 3.9.21

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


On Wed, Jul 07, 1999 at 09:52:24PM +0100, Shawn Hargreaves wrote:
> We could use GFX_SAFE for both of these, with zero parameters representing 
> things that you don't care at all about, but this would lose the ability to 
> request a particular value while still accepting others.

I still don't see why... my suggestion was to make the low level
drivers accept w=h=0 as meaning that anything will do, and
replacing the current code in set_gfx_mode with:

   /* special bodge for the GFX_SAFE driver */
   if (card == GFX_SAFE) {
      ustrncpy(buf, allegro_error, sizeof(buf)-ucwidth(0));
      if (set_gfx_mode(GFX_AUTODETECT, w, h, 0, 0) != 0) {
         if (set_gfx_mode(GFX_AUTODETECT, 0, 0, 0, 0) != 0) {
            set_color_depth(0); /* needs special code in set_color_depth? */
            if (set_gfx_mode(GFX_AUTODETECT, 0, 0, 0, 0) != 0) {
               set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
               allegro_message("%s\n", get_config_text("Fatal error: unable to set GFX_SAFE"));
               exit(1);
            }
         }
      }
      ustrcpy(allegro_error, buf);
      return 0;
   }

i.e. first try to autodetect the mode they asked for.  If that
fails, try to autodetect any mode in their colour depth.
Failing that, try any mode in any colour depth; if that fails,
give up.  The user can still suggest a resolution in the same
way they can at the moment.  Non-safe drivers mustn't be in the
autodetect list, I suppose.  My comment about this making the
existing GFX_SAFE system redundant was meant only to refer to
GFX_SAFE_ID, GFX_SAFE_W, GFX_SAFE_H and GFX_SAFE_DEPTH, not to
mean that set_gfx_mode(GFX_SAFE,...) was redundant.

-- 
George



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