[CF-Devel] GTK Client performance

Mark Wedel mwedel at sonic.net
Mon Aug 19 01:03:43 CDT 2002


Kevin R. Bulgrien wrote:
>
     
      I am running a 1280 x 1024 display at 8 bit color.  XFree86 4.0.3.
     
     >
     
      I have a PCI Hercules Dynamite 128 Video card - A very fast card
     
     >
     
      in its day and when the Pentium 120 was a reasonable processor.
     
     >
     
     
     >
     
      I am using the ET6000 driver.
     
     >
     
     
     >
     
      The culprit is SDL.  When I turn SDL support off, I no longer
     
     >
     
      experience performance problems when the map is full of monsters.
     
     >
     
      Trouble is, with 8 bit color, without SDL, colors are very distorted.
     
     
  Presumably, SDL does better color matching that the gtk pixmap code.

  I'm not sure how SDL deals with the images.  My guess is that it keeps the 
data in 24 bit, and then each time it is rendered, it does a 24 to 8 bit 
conversion.  This is obviously very slow, but it means it can always try to find 
the best colors for the images.

  The gtk (x11) code on the other hand creates the images once.  It needs to 
allocate the colors at that time of creation.  Since the images are 24 bit, it 
tries to be a little clever in allocating the colors - it tries to allocate a 
fairly representative set of colors, so that if the the first images created 
don't 'pollute' the colormap, leaving no colors for the rest of the images (if 
the first set was for example outdoor stuff, the color map would get filled with 
greens and browns, but perhaps not much in the way of reds, yellows, etc).

  Since the color looks good with SDL, my guess is that it may create and free 
colormap entries as it is rendered.  Thus, if you are outdoors, the colormap 
would largely contain those greens and browns, but as you go into the city, 
maybe more greys and other representative colors.  This operation is obviously slow.

  So this is a tradeoff - performance or accuracy.  Performance is probably more 
important.

>
     
     
     >
     
      Maybe I need to switch cards to one that will support 1280 at a
     
     >
     
      higher number of colors to fix the distortion (though I will hate
     
     >
     
      to give up booting the console in 132x60 text mode).
     
     
  A reasonable idea - video cards that support 1280x1024 at better color depths 
are quite cheap.  I don't think there is too much interest in trying to make the 
8 bit display look/work really good.



    
    


More information about the crossfire mailing list