home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!spool.mu.edu!yale.edu!yale!gumby!kzoo!k044477
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Subject: Re: Color animation in After Dark...HELP!
- Message-ID: <1993Jan21.200541.29437@hobbes.kzoo.edu>
- Organization: Kalamazoo College
- References: <Jan21.055623.50848@yuma.ACNS.ColoState.EDU>
- Date: Thu, 21 Jan 1993 20:05:41 GMT
- Lines: 48
-
- cantrell@lamar.ColoState.EDU (Carol Cantrell) writes:
- >I'm writing an After Dark module that uses color table animation. ...
- >I want to copy the GWorlds to the screen color index for color index--
- >that is, color #1 in the GWorld is color [#1] on the screen, etc.
- >The obvious way to do this is to OR the ctFlags field with $4000;
-
- Not _that_ obvious; it's hidden pretty well in IM VI, actually. :-)
-
- >however, this copies index numbers from the GWorld to index numbers
- >in the current PALETTE. After Dark doesn't draw into a WINDOW, and therefore
- >DOESN'T HAVE A PALETTE!!! Is there any way to do this? Help!
-
- Yep, there are three ways to get the Color Indices You Want up onto the
- screen:
- (1) Set bit 14 in ctFlags;
- (2) Make the ctSeeds equal;
- (3) Write directly to the screen.
-
- (1) won't work for you, as you say, because AD opens a port not a
- palette. (Actually, does it even do that? Someone said it uses
- SetStdProcs() to redirect QD calls to its own nefarious ends. I don't
- even want to think about that.)
-
- (2) is probably your best bet in this case. If the ctSeed in your
- source pixmap's color table is equal to the ctSeed in your dest pixmap's
- color table, CopyBits will take this to mean that the color tables are
- in fact equal. It will not run through them and check. Consequently,
- it will just copy the pixel values straight across, which has the effect
- you want. (And, as a side dish, it's also the fastest possible way that
- CopyBits can operate.)
-
- You can set the ctSeeds yourself, manually, if you like. Normally,
- that's not a good idea, but After Dark is such a snuggly, hand-holding
- environment to work in, that I won't even give you the usual "now don't
- do this" warning. All you gotta do is drop a 'clut' in your module with
- the appropriate resource ID, set a few flags, maybe check the screen
- depth yourself, and you're guaranteed to have the screen you want, with
- the colors you want. So--do the checks, copy the screen's pixmap's
- pmTable's ctSeed into your GWorld's pixmap's pmTable's ctSeed, and
- CopyBits to your heart's content.
-
- Alternatively, you can build a GWorld using the screen's pmTable. But
- I'm not too familiar with GWorlds, so you're on your own there.
- --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- "We enjoy a patent portfolio second to none in the computer industry,
- with some 30,000 patents worldwide and more than 9,000 in the U.S. alone,
- and growing." - An IBM advertisement
-