nanogui: Re: Newbie problems - clipping tutorial


Previous by date: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr
Next by date: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr
Previous in thread: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr
Next in thread: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr

Subject: Re: Re: Newbie problems - clipping tutorial
From: Manuel Teira Paz ####@####.####
Date: 23 Jan 2000 00:12:59 -0000
Message-Id: <Pine.GSO.4.21.0001230033420.1794-100000@hades>

On Sat, 22 Jan 2000, Greg Haerr wrote:

> I'm a bit confused here, since there isn't a GdClipRect.  I assume you
> meant GdFillRect.  
I'm sorry, I was thinking about GdClipArea.

I expended more time looking at the code, and I've got my terrible
mistake. The clipping works OK, but I defined my SCREENDEVICE as
PSF_MEMORY. This was the only reason. 

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]); 

now, you are ORing the other points part of the byte with the XORed
point. If you repeat the operation over the byte, you will get the
original byte.

> 
> I'm wondering if there's not some strange bug in your pen code, since
> everything happens when the pen is released.  Otherwise, perhaps
> we have an endian problem, although I thought others reported that
> it works on a Solaris system.

Yes it works. I've tested it.

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.

One more time, thanks a lot. It looks great now (but the colors).

Best regards.
Manolo.



Previous by date: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr
Next by date: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr
Previous in thread: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr
Next in thread: 23 Jan 2000 00:12:59 -0000 Re: Newbie problems - clipping tutorial, Greg Haerr


Powered by ezmlm-browse 0.20.