home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!caen!sol.ctr.columbia.edu!sol.ctr.columbia.edu!mhall
- From: mhall@occs.cs.oberlin.edu (Matthew Hall)
- Subject: The Pallette manager
- Organization: Oberlin College Computer Science
- Message-ID: <MHALL.92Sep8155808@occs.cs.oberlin.edu>
- Distribution: comp.sys.mac.programmer
- Sender: news@ctr.columbia.edu (The Daily Lose)
- Date: Tue, 8 Sep 1992 20:58:08 GMT
- X-Posted-From: occs.cs.oberlin.edu
- X-Posted-Through: sol.ctr.columbia.edu
- Lines: 54
-
-
- I have a question that's not directly related to the games thread, but
- its close.
-
- I am drawing a 256 color plot in an offscreen pixmap. I set the
- offscreen pmtable to whatever clut I wish to choose. Then, from that
- I creat a palette optimized for the current color level (or none for
- direct devices). So, if I'm in 16 colors, I would take one of every
- 16 colors in the 256 color clut that I loaded in (with black and white
- appropriately placed) and place them in the palette. Then I set the
- app's default palette to this new palette.
- This way, I can
- draw directly into the offscreen map since the positions of the colors
- in the clut don't change, and I don't have to use
- pmtolerant+pmexplicit, or setentries, and I can draw in an ideal color
- environment and let PM take care of tolerance and updates. Now - two problems
-
- It runs very oddly in the system 7 finder. Sometimes the menus are
- dimmed by gray color, sometimes by gray pattern. When I switch to the
- finder, sometimes dimmed menus are displayed as an attrocious shade of
- magenta. I guess in the previous thread it says that the finder is
- "courteous to the point of obsequity", but magenta menus?
-
- Also, I want to create a black background offscreen, I switch to the
- offscreen port. I call a fillrect (backpat=black,backcolor=0,0,0);
- and then copybits to the screen.(with the window as the current port)
- At this point, the cluts first and last entries are white and black
- respectively. If I am in an indexed environment, everything is
- hunky-dory. If I am in a direct environment, the background stays
- white, and if I switch between the two, I usually get a cyan (one of
- the earlier entries in my clut).
- Now when I draw direct (plug index values in the data) into the
- pixmap, and copybits to the screen
- everything is fine. $FF turns to black, etc. So the problem seems to
- be that fillrect is placing the (teh) wrong index into the pixmap. Is
- this because my offscreen port is using the current gdevice, and
- thinks black is somewhere else in my clut than it actually is? If so,
- do I have to create a new gdevice for the pixmap?
- Actually, is my method compatible? Is it stupid? and why the strange
- problems.
-
- Any help appreciated,
- -matt hall
- --
-
-
- -------------------------------------------------------------------------------
- Matt Hall. mhall@occs.cs.edu OR SMH9666@OBERLIN.BITNET
- (216)-775-5805 (That's a Cleveland Area code. Lucky Me)
-
- "If a man comes up to you and says:
- 'A dog just carried away your ear.'
- Do you run after the dog, or search first for your ear?" - Moon over Morocco
-
-