Wow...I thought I would whip this nice little eye-candy effect onto the
palm, and it's turning into quite a bother.  I wonder if anyone else has
seen this and fixed it in a simpler way...(or if I've really done
something moronic with my code...;^).

When the user clicks on the screen, I want to gray out the screen still
displaying a bit of the game screen and display the interface bitmaps so
that it's clear that the bitmaps are what the user can interact with to
control the game.

So, I have a function called 'DimScreen' whose sole purpose is to mask a
gray bitmap over the screen, while still allowing some of the pixels to
shine through.

The functionality seemed pretty simple at first:

void DimScreen()
{
        CustomPatternType pattern =
{0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55};
        WinHandle winH;
        RectangleType r;

                // This does the same thing on OS 4.x
                // NOTE: this doesn't work correctly on OS 3.1...I'm
working on a solution there.
                WinPushDrawState();
            winH = WinSetDrawWindow(WinGetDisplayWindow());
                WinSetPattern((const CustomPatternType *)&pattern);
                WinSetDrawMode(winMask);
                WinGetWindowBounds(&r);
                WinPaintRectangle(&r,0);
            WinSetDrawWindow(winH);
                WinPopDrawState();
}

...which of course didn't work on:
CLIE - Gave me apparently a yellow masking on everything instead of
black.
Handera - Completely blanked the screen.
PalmOS3.5 - gives me alternating bands of grey and white in bitdepths of
8 and 2.
PalmOS4.0 - works fine in all depths.

Anyone else see this behavior?  Is my code horribly broken?

-Ken

P.S. As I find better solutions, I'll be posting my code on my web site,
http://www.flippinbits.com






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to