nanogui: Re: Newbie problems - clipping tutorial


Previous by date: 23 Jan 2000 01:59:46 -0000 Re: Newbie problems - clipping tutorial, Manuel Teira Paz
Next by date: 23 Jan 2000 01:59:46 -0000 GdFindNearestColor, Manuel Teira Paz
Previous in thread: 23 Jan 2000 01:59:46 -0000 Re: Newbie problems - clipping tutorial, Manuel Teira Paz
Next in thread:

Subject: Re: Re: Newbie problems - clipping tutorial
From: "Greg Haerr" ####@####.####
Date: 23 Jan 2000 01:59:46 -0000
Message-Id: <021301bf6544$0fc03720$15320cd0@gregh>

: On the other hand, I've just fixed the matter with the window shapes being
: painted all around the screen. The problem was the implementation of the
: drawing routines with gr_mode==MODE_XOR. I've been looking at the code in
: fblinX.c; the way it is implemented is:
: *addr = (*addr & notmask[x&1]) ^ (c << ((1-(x&1))*4))
: 
: this way, you are erasing the bits of the point you are XORing, before
: XORing it. So, if you XOR it again, you are not restoring the value of the
: original point. I've implemented it this way:
:  *addr=(*addr&notmask[x&1])|((*addr ^ (c<<((1-(x&1))<<2))) & ~notmask[x&1]); 
: 

Wow.  So none of the MODE_XOR portions of the fblinX.c drivers have
been working?  Send me your fixed fblinX.c file, and I'll update the
rest.  I assume you've fixed both drawpixel and the draw{vh}line
stuff as well..  Also, you might use "mask[]" instead of "~notmask[]" so that
doesn't have to be computed each time...


: Well; the next thing I want to do is fixing the color representation (it's
: a 4bpp/2bpp/1bpp grayscale screen 160x160). I have seen that the colors
: are very different than the expected (a dark gray when it should be a
: light gray). I think that the right way to fix this is writing a new
: devpalXXX.c, isn't it? I've tested the devpalgray4.c instead of devpal4.c
: but the result is very light and I can hardly see the windows.

Yes, a devpalXXX.c that better matches the color scheme in wingdi.c
just before the sysColors array is defined.  You might want to define
another color scheme for 16 color gray...  Otherwise the system colors
are matched with the closest palette colors, and the matches may not
match well.

Regards,

Greg




Previous by date: 23 Jan 2000 01:59:46 -0000 Re: Newbie problems - clipping tutorial, Manuel Teira Paz
Next by date: 23 Jan 2000 01:59:46 -0000 GdFindNearestColor, Manuel Teira Paz
Previous in thread: 23 Jan 2000 01:59:46 -0000 Re: Newbie problems - clipping tutorial, Manuel Teira Paz
Next in thread:


Powered by ezmlm-browse 0.20.