emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list-colors-display shows only one color


From: Juanma Barranquero
Subject: Re: list-colors-display shows only one color
Date: Tue, 12 Feb 2002 13:18:51 +0100

> I'll try to debug what's happening

On x-display-color-cells:

>   if (cap < 0)
>      cap = 1 << (dpyinfo->n_planes * dpyinfo->n_cbits);
  

At this moment dpyinfo->n_planes == 1 and dpyinfo->n_cbits == 32.

(Aside: Interestingly,

  cap = 1 << 32;

is statically determined by MSVC to be 0, but

  x = 32;
  cap = 1 << x;

is 1.)

Anway, 1 << 32 is an error because it's obviously going to overflow cap.

Something like

  if (cap < 0)
    {
      int depth = dpyinfo->n_planes * dpyinfo->n_cbits;
      if (depth > SOME_VALUE) {
        cap = 1 << SOME_VALUE;
      else
        cap = 1 << depth;
    }
  
is posible, but:

1.- Is not pretty.

2.- There's no obvious SOME_VALUE; probably it would vary between 16-bit
and 32-bit Windows, the graphics card and driver, etc.

3.- Something's wrong here, I think. Even before Eli's change on
list-colors-display, that function listed more colors that my driver was
able to display simultaneously (because some of them appeared as equal).
OTOH, the driver is saying that it is not palette-based... :(

As expected, setting my Windows in 24-bit color mode works fine.

                                                           /L/e/k/t/u




reply via email to

[Prev in Thread] Current Thread [Next in Thread]