On Fri, 22 Dec 2000, Dennis Bjorklund wrote:
> On Fri, 22 Dec 2000, Ove Kaaven wrote:
>
> > What bpp do you run the X server on?
>
> 16
>
> > Well, though the colors are wrong for now, does it run faster?
>
> No. It's exactly as slow as before. It takes like 5 seconds for a unit to
> move a square where it should take like 0.1 seconds or something.
Allright, then the slowness is probably really not the DIBs.
I found the civ2 disc though, and just installed it. It seems that the
color problems are because WinG operates slightly differently from plain
GDI - a WinGBitmap selected into a WinGDC seems like it can be
WinGBitBlt-ed onto a display DC without selecting a palette into the
WinGDC. As far as I know, this is not the case with standard DIBs and DCs,
where a palette must be set in the source DC.
(It wasn't visible before this optimization, because before it, a
conversion to the current X bpp occurred (when it copied it to the
DIBsection's XPixmap) *before* the actual blit. But now, the actual blit
is done directly from the source DIB data, using the DC's palette.)
I'm not sure how best to solve this. Either wing.c must somehow handle a
palette too for each of its bitmaps, or there must be a way to mark a DC
as paletteless ("use the currently selected DIB's colormap instead").
The latter probably wouldn't be very clean (though I'm pretty sure we
could use it elsewhere if it was implemented).