home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / B-C / CopyBits Demo 1.5.sit / CopyBits Demo 1.5 / CopyBits Demo.c < prev    next >
MacBinary  |  1995-05-18  |  34.0 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: CopyBits Demo.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu May 18 21:23:36 1995, modified Thu May 18 21:23:36 1995, creator 'MMCC', type ASCII, 34101 bytes "CopyBits Demo.c" , at 0x85b5 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 43 6f 70 79 42 69 | 74 73 20 44 65 6d 6f 2e |..CopyBi|ts Demo.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 01 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 85 35 00 | 00 01 9a ab e1 a3 98 ab |......5.|........|
|00000060| e1 a3 98 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ec 77 00 00 |........|.....w..|
|00000080| 2f 2f 0d 2f 2f 20 43 6f | 70 79 42 69 74 73 20 44 |//.// Co|pyBits D|
|00000090| 65 6d 6f 2e 63 0d 2f 2f | 0d 2f 2f 20 57 72 69 74 |emo.c.//|.// Writ|
|000000a0| 74 65 6e 20 69 6e 20 4d | 61 79 20 31 39 39 35 20 |ten in M|ay 1995 |
|000000b0| 75 73 69 6e 67 20 4d 65 | 74 72 6f 77 65 72 6b 73 |using Me|trowerks|
|000000c0| 20 43 6f 64 65 57 61 72 | 72 69 6f 72 20 76 35 2e | CodeWar|rior v5.|
|000000d0| 0d 2f 2f 0d 2f 2f 20 54 | 68 65 20 43 6f 70 79 42 |.//.// T|he CopyB|
|000000e0| 69 74 73 20 44 65 6d 6f | 20 70 72 6f 6a 65 63 74 |its Demo| project|
|000000f0| 20 76 31 2e 35 20 62 79 | 20 4b 65 6e 6e 65 74 68 | v1.5 by| Kenneth|
|00000100| 20 57 6f 72 6c 65 79 2e | 0d 2f 2f 20 54 68 69 73 | Worley.|.// This|
|00000110| 20 63 6f 64 65 20 69 73 | 20 43 6f 70 79 72 69 67 | code is| Copyrig|
|00000120| 68 74 20 31 39 39 35 2e | 20 41 6c 6c 20 52 69 67 |ht 1995.| All Rig|
|00000130| 68 74 73 20 52 65 73 65 | 72 76 65 64 2e 0d 2f 2f |hts Rese|rved..//|
|00000140| 20 59 6f 75 20 6d 61 79 | 20 75 73 65 20 74 68 69 | You may| use thi|
|00000150| 73 20 63 6f 64 65 20 69 | 6e 20 61 6e 79 20 70 72 |s code i|n any pr|
|00000160| 6f 6a 65 63 74 20 6f 66 | 20 79 6f 75 72 20 6f 77 |oject of| your ow|
|00000170| 6e 2e 20 59 6f 75 20 6d | 61 79 20 61 6c 73 6f 0d |n. You m|ay also.|
|00000180| 2f 2f 20 72 65 64 69 73 | 74 72 69 62 75 74 65 20 |// redis|tribute |
|00000190| 74 68 69 73 20 70 72 6f | 6a 65 63 74 20 74 6f 20 |this pro|ject to |
|000001a0| 61 6e 79 6f 6e 65 20 65 | 6c 73 65 20 61 73 20 6c |anyone e|lse as l|
|000001b0| 6f 6e 67 20 61 73 20 31 | 29 20 61 6c 6c 20 74 68 |ong as 1|) all th|
|000001c0| 65 0d 2f 2f 20 70 72 6f | 6a 65 63 74 20 66 69 6c |e.// pro|ject fil|
|000001d0| 65 73 20 28 69 6e 63 6c | 75 64 69 6e 67 20 64 6f |es (incl|uding do|
|000001e0| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 20 66 69 6c 65 |cumentat|ion file|
|000001f0| 73 29 20 61 72 65 20 6b | 65 70 74 20 74 6f 67 65 |s) are k|ept toge|
|00000200| 74 68 65 72 2c 0d 2f 2f | 20 61 6e 64 20 32 29 20 |ther,.//| and 2) |
|00000210| 6e 6f 74 68 69 6e 67 20 | 69 73 20 63 68 61 72 67 |nothing |is charg|
|00000220| 65 64 20 66 6f 72 20 74 | 68 65 20 70 72 6f 6a 65 |ed for t|he proje|
|00000230| 63 74 2e 0d 2f 2f 0d 2f | 2f 20 50 6c 65 61 73 65 |ct..//./|/ Please|
|00000240| 20 61 73 6b 20 6d 79 20 | 70 65 72 6d 69 73 73 69 | ask my |permissi|
|00000250| 6f 6e 20 62 65 66 6f 72 | 65 20 69 6e 63 6c 75 64 |on befor|e includ|
|00000260| 69 6e 67 20 74 68 69 73 | 20 63 6f 64 65 20 6f 6e |ing this| code on|
|00000270| 20 61 6e 79 0d 2f 2f 20 | 64 69 73 6b 20 6f 72 20 | any.// |disk or |
|00000280| 43 44 20 66 6f 72 20 73 | 61 6c 65 2e 0d 2f 2f 0d |CD for s|ale..//.|
|00000290| 2f 2f 20 54 68 69 73 20 | 69 73 20 61 20 74 75 74 |// This |is a tut|
|000002a0| 6f 72 69 61 6c 20 70 72 | 6f 6a 65 63 74 20 74 68 |orial pr|oject th|
|000002b0| 61 74 20 64 65 6d 6f 6e | 73 74 72 61 74 65 73 20 |at demon|strates |
|000002c0| 74 68 65 20 75 73 65 20 | 6f 66 0d 2f 2f 20 43 6f |the use |of.// Co|
|000002d0| 70 79 42 69 74 73 20 61 | 6e 64 20 6f 66 66 73 63 |pyBits a|nd offsc|
|000002e0| 72 65 65 6e 20 47 72 61 | 70 68 69 63 73 20 57 6f |reen Gra|phics Wo|
|000002f0| 72 6c 64 73 20 28 47 57 | 6f 72 6c 64 73 29 2e 20 |rlds (GW|orlds). |
|00000300| 49 74 20 73 68 6f 77 73 | 0d 2f 2f 20 73 65 76 65 |It shows|.// seve|
|00000310| 72 61 6c 20 69 6e 73 74 | 61 6e 63 65 73 20 6f 66 |ral inst|ances of|
|00000320| 20 63 6f 70 79 69 6e 67 | 20 69 6d 61 67 65 73 20 | copying| images |
|00000330| 74 6f 20 61 6e 64 20 66 | 72 6f 6d 20 6f 66 66 73 |to and f|rom offs|
|00000340| 63 72 65 65 6e 0d 2f 2f | 20 67 72 61 70 68 69 63 |creen.//| graphic|
|00000350| 73 20 77 6f 72 6c 64 73 | 20 75 73 69 6e 67 20 43 |s worlds| using C|
|00000360| 6f 70 79 42 69 74 73 2c | 20 70 72 6f 76 69 64 65 |opyBits,| provide|
|00000370| 73 20 73 65 76 65 72 61 | 6c 20 6d 61 63 72 6f 73 |s severa|l macros|
|00000380| 20 74 68 61 74 0d 2f 2f | 20 6d 61 6b 65 20 74 68 | that.//| make th|
|00000390| 65 20 70 72 6f 63 65 73 | 73 20 61 20 6c 69 74 74 |e proces|s a litt|
|000003a0| 6c 65 20 65 61 73 69 65 | 72 2c 20 73 68 6f 77 73 |le easie|r, shows|
|000003b0| 20 61 6e 20 65 78 61 6d | 70 6c 65 20 6f 66 0d 2f | an exam|ple of./|
|000003c0| 2f 20 64 72 61 77 69 6e | 67 20 69 6e 74 6f 20 61 |/ drawin|g into a|
|000003d0| 6e 20 6f 66 66 73 63 72 | 65 65 6e 20 67 72 61 70 |n offscr|een grap|
|000003e0| 68 69 63 73 20 77 6f 72 | 6c 64 20 61 6e 64 20 68 |hics wor|ld and h|
|000003f0| 6f 77 20 74 68 61 74 20 | 63 61 6e 0d 2f 2f 20 69 |ow that |can.// i|
|00000400| 6d 70 72 6f 76 65 20 6f | 6e 73 63 72 65 65 6e 20 |mprove o|nscreen |
|00000410| 61 6e 69 6d 61 74 69 6f | 6e 2c 20 61 6e 64 20 69 |animatio|n, and i|
|00000420| 74 20 64 65 6d 6f 6e 73 | 74 72 61 74 65 73 20 61 |t demons|trates a|
|00000430| 20 22 66 61 64 65 22 0d | 2f 2f 20 75 73 69 6e 67 | "fade".|// using|
|00000440| 20 43 6f 70 79 42 69 74 | 73 20 74 6f 20 66 61 64 | CopyBit|s to fad|
|00000450| 65 20 61 20 70 6f 72 74 | 69 6f 6e 20 6f 66 20 74 |e a port|ion of t|
|00000460| 68 65 20 73 63 72 65 65 | 6e 20 74 6f 20 62 6c 61 |he scree|n to bla|
|00000470| 63 6b 2e 0d 2f 2f 0d 2f | 2f 20 56 65 72 73 69 6f |ck..//./|/ Versio|
|00000480| 6e 20 31 2e 35 20 61 64 | 64 73 20 61 20 66 61 64 |n 1.5 ad|ds a fad|
|00000490| 65 20 66 72 6f 6d 20 69 | 6d 61 67 65 20 74 6f 20 |e from i|mage to |
|000004a0| 69 6d 61 67 65 20 75 73 | 69 6e 67 20 43 6f 70 79 |image us|ing Copy|
|000004b0| 42 69 74 73 2e 0d 2f 2f | 20 43 6f 6f 6c 21 0d 2f |Bits..//| Cool!./|
|000004c0| 2f 0d 2f 2f 20 49 6e 20 | 61 20 6e 75 74 73 68 65 |/.// In |a nutshe|
|000004d0| 6c 6c 2c 20 74 68 65 20 | 61 70 70 20 70 75 74 73 |ll, the |app puts|
|000004e0| 20 75 70 20 61 20 64 69 | 61 6c 6f 67 20 74 68 61 | up a di|alog tha|
|000004f0| 74 20 73 68 6f 77 73 20 | 74 77 6f 0d 2f 2f 20 22 |t shows |two.// "|
|00000500| 73 6f 75 72 63 65 22 20 | 70 69 63 74 75 72 65 73 |source" |pictures|
|00000510| 20 28 31 20 26 20 32 29 | 20 61 6e 64 20 61 20 64 | (1 & 2)| and a d|
|00000520| 65 73 74 69 6e 61 74 69 | 6f 6e 20 61 72 65 61 2e |estinati|on area.|
|00000530| 20 43 6c 69 63 6b 69 6e | 67 0d 2f 2f 20 6f 6e 20 | Clickin|g.// on |
|00000540| 74 68 65 20 22 43 6f 70 | 79 22 20 62 75 74 74 6f |the "Cop|y" butto|
|00000550| 6e 73 20 61 62 6f 76 65 | 20 65 61 63 68 20 6f 66 |ns above| each of|
|00000560| 20 74 68 65 20 73 6f 75 | 72 63 65 20 70 69 63 74 | the sou|rce pict|
|00000570| 75 72 65 73 0d 2f 2f 20 | 63 61 75 73 65 73 20 74 |ures.// |causes t|
|00000580| 68 65 20 70 69 63 74 75 | 72 65 20 74 6f 20 62 65 |he pictu|re to be|
|00000590| 20 63 6f 70 69 65 64 20 | 74 6f 20 74 68 65 20 64 | copied |to the d|
|000005a0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 61 72 65 61 2e |estinati|on area.|
|000005b0| 0d 2f 2f 20 50 69 63 74 | 75 72 65 20 31 20 69 73 |.// Pict|ure 1 is|
|000005c0| 20 6c 61 62 65 6c 6c 65 | 64 20 61 73 20 22 66 6c | labelle|d as "fl|
|000005d0| 69 63 6b 65 72 79 20 61 | 6e 69 6d 61 74 69 6f 6e |ickery a|nimation|
|000005e0| 22 20 61 6e 64 20 70 69 | 63 74 75 72 65 20 32 0d |" and pi|cture 2.|
|000005f0| 2f 2f 20 69 73 20 6c 61 | 62 65 6c 6c 65 64 20 61 |// is la|belled a|
|00000600| 73 20 22 73 6d 6f 6f 74 | 68 20 61 6e 69 6d 61 74 |s "smoot|h animat|
|00000610| 69 6f 6e 2e 22 20 57 68 | 65 6e 20 79 6f 75 20 70 |ion." Wh|en you p|
|00000620| 75 74 20 74 68 65 20 63 | 75 72 73 6f 72 0d 2f 2f |ut the c|ursor.//|
|00000630| 20 6f 76 65 72 20 65 61 | 63 68 20 70 69 63 74 75 | over ea|ch pictu|
|00000640| 72 65 2c 20 79 6f 75 20 | 73 68 6f 75 6c 64 20 73 |re, you |should s|
|00000650| 65 65 20 61 20 64 69 66 | 66 65 72 65 6e 63 65 20 |ee a dif|ference |
|00000660| 69 6e 20 68 6f 77 20 61 | 0d 2f 2f 20 63 6f 6c 6f |in how a|.// colo|
|00000670| 72 65 64 20 63 69 72 63 | 6c 65 20 69 73 20 61 6e |red circ|le is an|
|00000680| 69 6d 61 74 65 64 20 6f | 76 65 72 20 74 68 65 20 |imated o|ver the |
|00000690| 70 69 63 74 75 72 65 2e | 20 59 6f 75 20 73 68 6f |picture.| You sho|
|000006a0| 75 6c 64 0d 2f 2f 20 6f | 63 63 61 73 69 6f 6e 61 |uld.// o|ccasiona|
|000006b0| 6c 6c 79 20 73 65 65 20 | 74 68 65 20 62 61 63 6b |lly see |the back|
|000006c0| 67 72 6f 75 6e 64 20 22 | 66 6c 69 63 6b 65 72 22 |ground "|flicker"|
|000006d0| 20 74 68 72 6f 75 67 68 | 20 6f 6e 0d 2f 2f 20 70 | through| on.// p|
|000006e0| 69 63 74 75 72 65 20 31 | 2c 20 62 75 74 20 6e 6f |icture 1|, but no|
|000006f0| 74 20 6f 6e 20 70 69 63 | 74 75 72 65 20 32 20 62 |t on pic|ture 2 b|
|00000700| 65 63 61 75 73 65 20 69 | 74 20 75 73 65 73 20 61 |ecause i|t uses a|
|00000710| 6e 0d 2f 2f 20 69 6e 74 | 65 72 6d 65 64 69 61 72 |n.// int|ermediar|
|00000720| 79 20 47 57 6f 72 6c 64 | 20 74 6f 20 64 72 61 77 |y GWorld| to draw|
|00000730| 20 69 6e 2e 0d 2f 2f 0d | 2f 2f 20 54 68 65 20 46 | in..//.|// The F|
|00000740| 61 64 65 20 74 6f 20 62 | 6c 61 63 6b 20 62 75 74 |ade to b|lack but|
|00000750| 74 6f 6e 20 6f 76 65 72 | 20 74 68 65 20 64 65 73 |ton over| the des|
|00000760| 74 69 6e 61 74 69 6f 6e | 20 61 72 65 61 20 77 69 |tination| area wi|
|00000770| 6c 6c 0d 2f 2f 20 63 61 | 75 73 65 20 74 68 61 74 |ll.// ca|use that|
|00000780| 20 61 72 65 61 20 74 6f | 20 66 61 64 65 20 74 6f | area to| fade to|
|00000790| 20 62 6c 61 63 6b 20 66 | 72 6f 6d 20 77 68 61 74 | black f|rom what|
|000007a0| 65 76 65 72 20 68 61 70 | 70 65 6e 73 20 74 6f 0d |ever hap|pens to.|
|000007b0| 2f 2f 20 62 65 20 69 6e | 20 74 68 65 72 65 2e 20 |// be in| there. |
|000007c0| 49 74 20 64 6f 65 73 20 | 74 68 69 73 20 62 79 20 |It does |this by |
|000007d0| 72 65 70 65 61 74 65 64 | 6c 79 20 63 6f 70 79 69 |repeated|ly copyi|
|000007e0| 6e 67 20 61 20 67 72 61 | 79 0d 2f 2f 20 72 65 63 |ng a gra|y.// rec|
|000007f0| 74 61 6e 67 6c 65 20 66 | 72 6f 6d 20 61 20 47 57 |tangle f|rom a GW|
|00000800| 6f 72 6c 64 20 69 6e 74 | 6f 20 74 68 65 20 64 65 |orld int|o the de|
|00000810| 73 74 69 6e 61 74 69 6f | 6e 20 61 72 65 61 20 75 |stinatio|n area u|
|00000820| 73 69 6e 67 0d 2f 2f 20 | 74 68 65 20 73 75 62 50 |sing.// |the subP|
|00000830| 69 6e 20 74 72 61 6e 73 | 66 65 72 20 6d 6f 64 65 |in trans|fer mode|
|00000840| 20 6f 66 20 43 6f 70 79 | 42 69 74 73 2e 20 54 68 | of Copy|Bits. Th|
|00000850| 65 20 65 72 61 73 65 20 | 62 75 74 74 6f 6e 0d 2f |e erase |button./|
|00000860| 2f 20 65 72 61 73 65 73 | 20 74 68 65 20 64 65 73 |/ erases| the des|
|00000870| 74 69 6e 61 74 69 6f 6e | 20 61 72 65 61 2e 0d 2f |tination| area../|
|00000880| 2f 0d 2f 2f 20 54 68 65 | 20 46 61 64 65 20 70 69 |/.// The| Fade pi|
|00000890| 63 74 75 72 65 20 62 75 | 74 74 6f 6e 73 20 63 61 |cture bu|ttons ca|
|000008a0| 75 73 65 20 74 68 65 20 | 70 69 63 74 75 72 65 20 |use the |picture |
|000008b0| 75 6e 64 65 72 20 74 68 | 65 0d 2f 2f 20 62 75 74 |under th|e.// but|
|000008c0| 74 6f 6e 20 74 6f 20 62 | 65 20 66 61 64 65 64 20 |ton to b|e faded |
|000008d0| 69 6e 74 6f 20 77 68 61 | 74 65 76 65 72 20 69 73 |into wha|tever is|
|000008e0| 20 63 75 72 72 65 6e 74 | 6c 79 20 69 6e 20 74 68 | current|ly in th|
|000008f0| 65 0d 2f 2f 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |e.// des|tination|
|00000900| 20 61 72 65 61 2e 20 54 | 68 69 73 20 69 73 20 61 | area. T|his is a|
|00000910| 63 63 6f 6d 70 6c 69 73 | 68 65 64 20 75 73 69 6e |ccomplis|hed usin|
|00000920| 67 20 43 6f 70 79 42 69 | 74 73 27 0d 2f 2f 20 62 |g CopyBi|ts'.// b|
|00000930| 6c 65 6e 64 20 74 72 61 | 6e 73 66 65 72 20 6d 6f |lend tra|nsfer mo|
|00000940| 64 65 2e 0d 2f 2f 0d 2f | 2f 20 51 75 65 73 74 69 |de..//./|/ Questi|
|00000950| 6f 6e 73 3f 20 43 6f 6d | 6d 65 6e 74 73 3f 20 50 |ons? Com|ments? P|
|00000960| 72 61 69 73 65 3f 20 43 | 72 69 74 69 63 69 73 6d |raise? C|riticism|
|00000970| 3f 20 4a 6f 62 73 3f 20 | 53 65 6e 64 20 74 68 65 |? Jobs? |Send the|
|00000980| 6d 0d 2f 2f 20 61 6c 6c | 20 74 6f 20 6d 65 20 61 |m.// all| to me a|
|00000990| 74 20 4b 4e 45 77 6f 72 | 6c 65 79 40 61 6f 6c 2e |t KNEwor|ley@aol.|
|000009a0| 63 6f 6d 2e 20 49 27 6d | 20 61 20 27 66 72 65 65 |com. I'm| a 'free|
|000009b0| 6c 61 6e 63 65 27 0d 2f | 2f 20 70 72 6f 67 72 61 |lance'./|/ progra|
|000009c0| 6d 6d 65 72 2e 20 49 20 | 77 6f 72 6b 20 6f 6e 20 |mmer. I |work on |
|000009d0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 73 20 61 73 20 |applicat|ions as |
|000009e0| 77 65 6c 6c 20 61 73 20 | 6c 6f 77 2d 6c 65 76 65 |well as |low-leve|
|000009f0| 6c 0d 2f 2f 20 73 6f 66 | 74 77 61 72 65 20 28 63 |l.// sof|tware (c|
|00000a00| 6f 6e 74 72 6f 6c 20 70 | 61 6e 65 6c 73 2c 20 49 |ontrol p|anels, I|
|00000a10| 4e 49 54 73 2c 20 65 74 | 63 2e 29 0d 2f 2f 0d 0d |NITs, et|c.).//..|
|00000a20| 23 69 6e 63 6c 75 64 65 | 20 3c 51 44 4f 66 66 73 |#include| <QDOffs|
|00000a30| 63 72 65 65 6e 2e 68 3e | 0d 0d 2f 2f 20 3d 3d 3d |creen.h>|..// ===|
|00000a40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000a50| 3d 3d 20 44 45 46 49 4e | 45 53 20 3d 3d 3d 3d 3d |== DEFIN|ES =====|
|00000a60| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000a70| 0d 0d 23 64 65 66 69 6e | 65 20 6b 4d 61 69 6e 44 |..#defin|e kMainD|
|00000a80| 6c 67 49 44 09 09 09 09 | 31 32 38 0d 0d 23 64 65 |lgID....|128..#de|
|00000a90| 66 69 6e 65 20 6b 50 69 | 63 74 31 49 44 09 09 09 |fine kPi|ct1ID...|
|00000aa0| 09 31 32 38 0d 23 64 65 | 66 69 6e 65 20 6b 50 69 |.128.#de|fine kPi|
|00000ab0| 63 74 32 49 44 09 09 09 | 09 31 32 39 0d 0d 23 64 |ct2ID...|.129..#d|
|00000ac0| 65 66 69 6e 65 20 6b 4d | 61 69 6e 44 6c 67 51 75 |efine kM|ainDlgQu|
|00000ad0| 69 74 09 09 09 31 0d 23 | 64 65 66 69 6e 65 20 6b |it...1.#|define k|
|00000ae0| 4d 61 69 6e 44 6c 67 43 | 6f 70 79 4f 6e 65 09 09 |MainDlgC|opyOne..|
|00000af0| 09 32 0d 23 64 65 66 69 | 6e 65 20 6b 4d 61 69 6e |.2.#defi|ne kMain|
|00000b00| 44 6c 67 46 61 64 65 4f | 6e 65 09 09 09 33 0d 23 |DlgFadeO|ne...3.#|
|00000b10| 64 65 66 69 6e 65 20 6b | 4d 61 69 6e 44 6c 67 43 |define k|MainDlgC|
|00000b20| 6f 70 79 54 77 6f 09 09 | 09 34 0d 23 64 65 66 69 |opyTwo..|.4.#defi|
|00000b30| 6e 65 20 6b 4d 61 69 6e | 44 6c 67 46 61 64 65 54 |ne kMain|DlgFadeT|
|00000b40| 77 6f 09 09 09 35 0d 23 | 64 65 66 69 6e 65 20 6b |wo...5.#|define k|
|00000b50| 4d 61 69 6e 44 6c 67 45 | 72 61 73 65 09 09 09 36 |MainDlgE|rase...6|
|00000b60| 0d 23 64 65 66 69 6e 65 | 20 6b 4d 61 69 6e 44 6c |.#define| kMainDl|
|00000b70| 67 46 61 64 65 54 6f 42 | 6c 61 63 6b 09 09 37 0d |gFadeToB|lack..7.|
|00000b80| 23 64 65 66 69 6e 65 20 | 6b 4d 61 69 6e 44 6c 67 |#define |kMainDlg|
|00000b90| 50 49 43 54 4f 6e 65 09 | 09 09 38 0d 23 64 65 66 |PICTOne.|..8.#def|
|00000ba0| 69 6e 65 20 6b 4d 61 69 | 6e 44 6c 67 50 49 43 54 |ine kMai|nDlgPICT|
|00000bb0| 54 77 6f 09 09 09 39 0d | 23 64 65 66 69 6e 65 20 |Two...9.|#define |
|00000bc0| 6b 4d 61 69 6e 44 6c 67 | 44 65 73 74 50 49 43 54 |kMainDlg|DestPICT|
|00000bd0| 09 09 31 30 0d 23 64 65 | 66 69 6e 65 20 6b 4d 61 |..10.#de|fine kMa|
|00000be0| 69 6e 44 6c 67 46 61 64 | 65 53 70 65 65 64 09 09 |inDlgFad|eSpeed..|
|00000bf0| 31 35 0d 0d 23 64 65 66 | 69 6e 65 20 6b 53 79 73 |15..#def|ine kSys|
|00000c00| 37 44 6c 67 49 44 09 09 | 09 09 31 32 39 0d 23 64 |7DlgID..|..129.#d|
|00000c10| 65 66 69 6e 65 20 6b 4d | 65 6d 6f 72 79 4f 75 74 |efine kM|emoryOut|
|00000c20| 44 6c 67 49 44 09 09 09 | 31 33 30 0d 23 64 65 66 |DlgID...|130.#def|
|00000c30| 69 6e 65 20 6b 47 57 6f | 72 6c 64 45 72 72 44 6c |ine kGWo|rldErrDl|
|00000c40| 67 49 44 09 09 09 31 33 | 31 0d 23 64 65 66 69 6e |gID...13|1.#defin|
|00000c50| 65 20 6b 4e 6f 74 59 65 | 74 49 6d 70 6c 44 6c 67 |e kNotYe|tImplDlg|
|00000c60| 49 44 09 09 31 33 32 0d | 0d 23 64 65 66 69 6e 65 |ID..132.|.#define|
|00000c70| 20 6b 41 6c 65 72 74 4f | 4b 42 75 74 74 6f 6e 09 | kAlertO|KButton.|
|00000c80| 09 09 31 0d 0d 2f 2f 20 | 3d 3d 3d 3d 3d 3d 3d 3d |..1..// |========|
|00000c90| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 20 4d 41 |========|===== MA|
|00000ca0| 43 52 4f 53 20 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |CROS ===|========|
|00000cb0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 0d 2f 2f 20 77 |========|==..// w|
|00000cc0| 20 63 61 6e 20 62 65 20 | 61 20 57 69 6e 64 6f 77 | can be |a Window|
|00000cd0| 50 74 72 2c 20 61 20 44 | 69 61 6c 6f 67 50 74 72 |Ptr, a D|ialogPtr|
|00000ce0| 2c 20 6f 72 20 61 20 47 | 57 6f 72 6c 64 50 74 72 |, or a G|WorldPtr|
|00000cf0| 2e 20 49 6e 20 61 6e 79 | 20 6f 66 20 74 68 65 73 |. In any| of thes|
|00000d00| 65 0d 2f 2f 20 63 61 73 | 65 73 2c 20 69 74 20 72 |e.// cas|es, it r|
|00000d10| 65 74 75 72 6e 73 20 74 | 68 65 20 63 6f 72 72 65 |eturns t|he corre|
|00000d20| 63 74 20 22 62 69 74 6d | 61 70 22 20 74 6f 20 73 |ct "bitm|ap" to s|
|00000d30| 65 6e 64 20 74 6f 20 43 | 6f 70 79 42 69 74 73 20 |end to C|opyBits |
|00000d40| 69 6e 20 74 68 65 0d 2f | 2f 20 73 6f 75 72 63 65 |in the./|/ source|
|00000d50| 20 6f 72 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 | or dest|ination |
|00000d60| 62 69 74 6d 61 70 20 70 | 61 72 61 6d 65 74 65 72 |bitmap p|arameter|
|00000d70| 2e 0d 23 64 65 66 69 6e | 65 20 57 49 4e 42 49 54 |..#defin|e WINBIT|
|00000d80| 4d 41 50 28 77 29 09 09 | 28 28 28 28 57 69 6e 64 |MAP(w)..|((((Wind|
|00000d90| 6f 77 50 65 65 6b 29 28 | 77 29 29 2d 3e 70 6f 72 |owPeek)(|w))->por|
|00000da0| 74 29 2e 70 6f 72 74 42 | 69 74 73 29 0d 0d 2f 2f |t).portB|its)..//|
|00000db0| 20 77 20 63 61 6e 20 61 | 6c 73 6f 20 62 65 20 61 | w can a|lso be a|
|00000dc0| 20 57 69 6e 64 6f 77 50 | 74 72 2c 20 44 69 61 6c | WindowP|tr, Dial|
|00000dd0| 6f 67 50 74 72 2c 20 6f | 72 20 47 57 6f 72 6c 64 |ogPtr, o|r GWorld|
|00000de0| 50 74 72 20 66 6f 72 20 | 61 6e 79 20 6f 66 20 74 |Ptr for |any of t|
|00000df0| 68 65 73 65 2e 0d 23 64 | 65 66 69 6e 65 20 57 49 |hese..#d|efine WI|
|00000e00| 4e 50 4f 52 54 52 45 43 | 54 28 77 29 09 09 28 28 |NPORTREC|T(w)..((|
|00000e10| 28 28 57 69 6e 64 6f 77 | 50 65 65 6b 29 28 77 29 |((Window|Peek)(w)|
|00000e20| 29 2d 3e 70 6f 72 74 29 | 2e 70 6f 72 74 52 65 63 |)->port)|.portRec|
|00000e30| 74 29 0d 23 64 65 66 69 | 6e 65 20 57 49 4e 44 4f |t).#defi|ne WINDO|
|00000e40| 57 57 49 44 54 48 28 77 | 29 09 09 28 57 49 4e 50 |WWIDTH(w|)..(WINP|
|00000e50| 4f 52 54 52 45 43 54 28 | 77 29 2e 72 69 67 68 74 |ORTRECT(|w).right|
|00000e60| 20 2d 20 57 49 4e 50 4f | 52 54 52 45 43 54 28 77 | - WINPO|RTRECT(w|
|00000e70| 29 2e 6c 65 66 74 29 0d | 23 64 65 66 69 6e 65 20 |).left).|#define |
|00000e80| 57 49 4e 44 4f 57 48 45 | 49 47 48 54 28 77 29 09 |WINDOWHE|IGHT(w).|
|00000e90| 09 28 57 49 4e 50 4f 52 | 54 52 45 43 54 28 77 29 |.(WINPOR|TRECT(w)|
|00000ea0| 2e 62 6f 74 74 6f 6d 20 | 2d 20 57 49 4e 50 4f 52 |.bottom |- WINPOR|
|00000eb0| 54 52 45 43 54 28 77 29 | 2e 74 6f 70 29 0d 23 64 |TRECT(w)|.top).#d|
|00000ec0| 65 66 69 6e 65 20 57 49 | 4e 43 4f 4e 54 45 4e 54 |efine WI|NCONTENT|
|00000ed0| 52 45 43 54 28 77 29 09 | 28 28 2a 2a 28 28 57 69 |RECT(w).|((**((Wi|
|00000ee0| 6e 64 6f 77 50 65 65 6b | 29 28 77 29 29 2d 3e 63 |ndowPeek|)(w))->c|
|00000ef0| 6f 6e 74 52 67 6e 29 2e | 72 67 6e 42 42 6f 78 29 |ontRgn).|rgnBBox)|
|00000f00| 0d 23 64 65 66 69 6e 65 | 20 57 49 4e 43 4f 4e 54 |.#define| WINCONT|
|00000f10| 45 4e 54 52 47 4e 28 77 | 29 09 28 28 28 57 69 6e |ENTRGN(w|).(((Win|
|00000f20| 64 6f 77 50 65 65 6b 29 | 28 77 29 29 2d 3e 63 6f |dowPeek)|(w))->co|
|00000f30| 6e 74 52 67 6e 29 0d 23 | 64 65 66 69 6e 65 20 57 |ntRgn).#|define W|
|00000f40| 49 4e 56 49 53 49 42 4c | 45 52 47 4e 28 77 29 09 |INVISIBL|ERGN(w).|
|00000f50| 28 28 28 57 69 6e 64 6f | 77 50 65 65 6b 29 28 77 |(((Windo|wPeek)(w|
|00000f60| 29 29 2d 3e 70 6f 72 74 | 2e 76 69 73 52 67 6e 29 |))->port|.visRgn)|
|00000f70| 0d 23 64 65 66 69 6e 65 | 20 57 49 4e 53 54 52 55 |.#define| WINSTRU|
|00000f80| 43 54 52 45 43 54 28 77 | 29 09 28 28 2a 2a 28 28 |CTRECT(w|).((**((|
|00000f90| 57 69 6e 64 6f 77 50 65 | 65 6b 29 28 77 29 29 2d |WindowPe|ek)(w))-|
|00000fa0| 3e 73 74 72 75 63 52 67 | 6e 29 2e 72 67 6e 42 42 |>strucRg|n).rgnBB|
|00000fb0| 6f 78 29 0d 23 64 65 66 | 69 6e 65 20 57 49 4e 53 |ox).#def|ine WINS|
|00000fc0| 54 52 55 43 54 52 47 4e | 28 77 29 09 09 28 28 28 |TRUCTRGN|(w)..(((|
|00000fd0| 57 69 6e 64 6f 77 50 65 | 65 6b 29 28 77 29 29 2d |WindowPe|ek)(w))-|
|00000fe0| 3e 73 74 72 75 63 52 67 | 6e 29 0d 23 64 65 66 69 |>strucRg|n).#defi|
|00000ff0| 6e 65 20 57 49 4e 55 50 | 44 41 54 45 52 45 43 54 |ne WINUP|DATERECT|
|00001000| 28 77 29 09 28 28 2a 2a | 28 28 57 69 6e 64 6f 77 |(w).((**|((Window|
|00001010| 50 65 65 6b 29 28 77 29 | 29 2d 3e 75 70 64 61 74 |Peek)(w)|)->updat|
|00001020| 65 52 67 6e 29 2e 72 67 | 6e 42 42 6f 78 29 0d 23 |eRgn).rg|nBBox).#|
|00001030| 64 65 66 69 6e 65 20 57 | 49 4e 55 50 44 41 54 45 |define W|INUPDATE|
|00001040| 52 47 4e 28 77 29 09 09 | 28 28 28 57 69 6e 64 6f |RGN(w)..|(((Windo|
|00001050| 77 50 65 65 6b 29 28 77 | 29 29 2d 3e 75 70 64 61 |wPeek)(w|))->upda|
|00001060| 74 65 52 67 6e 29 0d 0d | 2f 2f 20 54 68 69 73 20 |teRgn)..|// This |
|00001070| 74 61 6b 65 73 20 61 20 | 47 44 48 61 6e 64 6c 65 |takes a |GDHandle|
|00001080| 20 28 64 65 76 69 63 65 | 20 68 61 6e 64 6c 65 29 | (device| handle)|
|00001090| 0d 23 64 65 66 69 6e 65 | 20 50 49 58 45 4c 44 45 |.#define| PIXELDE|
|000010a0| 50 54 48 28 78 29 09 09 | 28 28 2a 2a 28 28 2a 2a |PTH(x)..|((**((**|
|000010b0| 28 78 29 29 2e 67 64 50 | 4d 61 70 29 29 2e 70 69 |(x)).gdP|Map)).pi|
|000010c0| 78 65 6c 53 69 7a 65 29 | 0d 0d 2f 2f 20 72 20 69 |xelSize)|..// r i|
|000010d0| 73 20 61 20 52 65 63 74 | 0d 23 64 65 66 69 6e 65 |s a Rect|.#define|
|000010e0| 20 54 4f 50 4c 45 46 54 | 28 72 29 09 09 09 28 2a | TOPLEFT|(r)...(*|
|000010f0| 20 28 50 6f 69 6e 74 2a | 29 20 26 28 72 2e 74 6f | (Point*|) &(r.to|
|00001100| 70 29 20 29 0d 23 64 65 | 66 69 6e 65 20 42 4f 54 |p) ).#de|fine BOT|
|00001110| 52 49 47 48 54 28 72 29 | 09 09 09 28 2a 20 28 50 |RIGHT(r)|...(* (P|
|00001120| 6f 69 6e 74 2a 29 20 26 | 28 72 2e 62 6f 74 74 6f |oint*) &|(r.botto|
|00001130| 6d 29 20 29 0d 0d 2f 2f | 20 3d 3d 3d 3d 3d 3d 3d |m) )..//| =======|
|00001140| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 20 50 |========|====== P|
|00001150| 52 4f 54 4f 54 59 50 45 | 53 20 3d 3d 3d 3d 3d 3d |ROTOTYPE|S ======|
|00001160| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 0d |========|=======.|
|00001170| 0d 76 6f 69 64 20 6d 61 | 69 6e 28 20 76 6f 69 64 |.void ma|in( void|
|00001180| 20 29 3b 0d 76 6f 69 64 | 20 49 6e 69 74 54 6f 6f | );.void| InitToo|
|00001190| 6c 62 6f 78 28 20 76 6f | 69 64 20 29 3b 0d 0d 73 |lbox( vo|id );..s|
|000011a0| 68 6f 72 74 09 47 65 74 | 53 79 73 56 65 72 73 69 |hort.Get|SysVersi|
|000011b0| 6f 6e 28 20 76 6f 69 64 | 20 29 3b 0d 42 6f 6f 6c |on( void| );.Bool|
|000011c0| 65 61 6e 09 48 61 73 43 | 6f 6c 6f 72 51 75 69 63 |ean.HasC|olorQuic|
|000011d0| 6b 44 72 61 77 28 20 76 | 6f 69 64 20 29 3b 0d 0d |kDraw( v|oid );..|
|000011e0| 48 61 6e 64 6c 65 09 47 | 65 74 49 74 65 6d 48 61 |Handle.G|etItemHa|
|000011f0| 6e 64 6c 65 28 20 44 69 | 61 6c 6f 67 50 74 72 20 |ndle( Di|alogPtr |
|00001200| 64 6c 67 2c 20 73 68 6f | 72 74 20 69 74 65 6d 4e |dlg, sho|rt itemN|
|00001210| 6f 20 29 3b 0d 76 6f 69 | 64 09 47 65 74 49 74 65 |o );.voi|d.GetIte|
|00001220| 6d 52 65 63 74 28 20 44 | 69 61 6c 6f 67 50 74 72 |mRect( D|ialogPtr|
|00001230| 20 64 6c 67 2c 20 73 68 | 6f 72 74 20 69 74 65 6d | dlg, sh|ort item|
|00001240| 4e 6f 2c 20 52 65 63 74 | 20 2a 61 52 65 63 74 20 |No, Rect| *aRect |
|00001250| 29 3b 0d 6c 6f 6e 67 09 | 47 65 74 44 69 61 6c 6f |);.long.|GetDialo|
|00001260| 67 4e 75 6d 62 65 72 46 | 69 65 6c 64 28 20 44 69 |gNumberF|ield( Di|
|00001270| 61 6c 6f 67 50 74 72 20 | 64 6c 67 2c 20 73 68 6f |alogPtr |dlg, sho|
|00001280| 72 74 20 69 74 65 6d 4e | 6f 20 29 3b 0d 0d 76 6f |rt itemN|o );..vo|
|00001290| 69 64 09 44 6f 41 6c 65 | 72 74 28 20 73 68 6f 72 |id.DoAle|rt( shor|
|000012a0| 74 20 64 6c 67 49 44 2c | 20 42 6f 6f 6c 65 61 6e |t dlgID,| Boolean|
|000012b0| 20 70 6c 61 79 41 6c 65 | 72 74 20 29 3b 0d 0d 47 | playAle|rt );..G|
|000012c0| 44 48 61 6e 64 6c 65 20 | 57 69 6e 64 6f 77 44 65 |DHandle |WindowDe|
|000012d0| 76 69 63 65 28 20 57 69 | 6e 64 6f 77 50 74 72 20 |vice( Wi|ndowPtr |
|000012e0| 77 69 6e 50 74 72 20 29 | 3b 0d 0d 76 6f 69 64 20 |winPtr )|;..void |
|000012f0| 46 61 64 65 54 6f 42 6c | 61 63 6b 28 20 57 69 6e |FadeToBl|ack( Win|
|00001300| 64 6f 77 50 74 72 20 64 | 65 73 74 57 69 6e 2c 20 |dowPtr d|estWin, |
|00001310| 52 65 63 74 20 2a 64 65 | 73 74 52 65 63 74 2c 20 |Rect *de|stRect, |
|00001320| 73 68 6f 72 74 20 66 61 | 64 65 53 70 65 65 64 20 |short fa|deSpeed |
|00001330| 29 3b 0d 0d 76 6f 69 64 | 20 46 61 64 65 54 6f 49 |);..void| FadeToI|
|00001340| 6d 61 67 65 28 20 47 57 | 6f 72 6c 64 50 74 72 20 |mage( GW|orldPtr |
|00001350| 73 72 63 49 6d 61 67 65 | 2c 20 52 65 63 74 20 2a |srcImage|, Rect *|
|00001360| 73 72 63 52 65 63 74 2c | 0d 09 57 69 6e 64 6f 77 |srcRect,|..Window|
|00001370| 50 74 72 20 64 65 73 74 | 57 69 6e 2c 20 52 65 63 |Ptr dest|Win, Rec|
|00001380| 74 20 2a 64 65 73 74 52 | 65 63 74 2c 20 73 68 6f |t *destR|ect, sho|
|00001390| 72 74 20 66 61 64 65 53 | 70 65 65 64 20 29 3b 0d |rt fadeS|peed );.|
|000013a0| 0d 76 6f 69 64 20 46 6c | 69 63 6b 65 72 41 6e 69 |.void Fl|ickerAni|
|000013b0| 6d 61 74 65 28 20 47 57 | 6f 72 6c 64 50 74 72 20 |mate( GW|orldPtr |
|000013c0| 73 72 63 50 69 63 74 2c | 20 52 65 63 74 20 2a 64 |srcPict,| Rect *d|
|000013d0| 65 73 74 52 65 63 74 20 | 29 3b 0d 76 6f 69 64 20 |estRect |);.void |
|000013e0| 53 6d 6f 6f 74 68 41 6e | 69 6d 61 74 65 28 20 47 |SmoothAn|imate( G|
|000013f0| 57 6f 72 6c 64 50 74 72 | 20 73 72 63 50 69 63 74 |WorldPtr| srcPict|
|00001400| 2c 20 52 65 63 74 20 2a | 64 65 73 74 52 65 63 74 |, Rect *|destRect|
|00001410| 20 29 3b 0d 0d 2f 2f 20 | 3d 3d 3d 3d 3d 3d 3d 3d | );..// |========|
|00001420| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 20 46 55 |========|===== FU|
|00001430| 4e 43 54 49 4f 4e 53 20 | 3d 3d 3d 3d 3d 3d 3d 3d |NCTIONS |========|
|00001440| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0d 0d 76 |========|=====..v|
|00001450| 6f 69 64 20 6d 61 69 6e | 28 20 76 6f 69 64 20 29 |oid main|( void )|
|00001460| 0d 7b 0d 09 44 69 61 6c | 6f 67 50 74 72 09 09 6d |.{..Dial|ogPtr..m|
|00001470| 61 69 6e 44 6c 67 3b 0d | 09 44 69 61 6c 6f 67 50 |ainDlg;.|.DialogP|
|00001480| 74 72 09 09 61 44 6c 67 | 3b 0d 09 52 65 63 74 09 |tr..aDlg|;..Rect.|
|00001490| 09 09 70 69 63 74 31 52 | 65 63 74 3b 0d 09 52 65 |..pict1R|ect;..Re|
|000014a0| 63 74 09 09 09 70 69 63 | 74 32 52 65 63 74 3b 0d |ct...pic|t2Rect;.|
|000014b0| 09 52 65 63 74 09 09 09 | 64 65 73 74 52 65 63 74 |.Rect...|destRect|
|000014c0| 3b 0d 09 50 65 6e 53 74 | 61 74 65 09 09 73 61 76 |;..PenSt|ate..sav|
|000014d0| 65 64 50 65 6e 3b 0d 09 | 73 68 6f 72 74 09 09 09 |edPen;..|short...|
|000014e0| 69 74 65 6d 48 69 74 3b | 0d 09 52 47 42 43 6f 6c |itemHit;|..RGBCol|
|000014f0| 6f 72 09 09 73 61 76 65 | 64 46 6f 72 65 3b 0d 09 |or..save|dFore;..|
|00001500| 52 47 42 43 6f 6c 6f 72 | 09 09 73 61 76 65 64 42 |RGBColor|..savedB|
|00001510| 61 63 6b 3b 0d 09 52 47 | 42 43 6f 6c 6f 72 09 09 |ack;..RG|BColor..|
|00001520| 62 6c 61 63 6b 43 6f 6c | 6f 72 3b 0d 09 52 47 42 |blackCol|or;..RGB|
|00001530| 43 6f 6c 6f 72 09 09 77 | 68 69 74 65 43 6f 6c 6f |Color..w|hiteColo|
|00001540| 72 3b 0d 09 73 68 6f 72 | 74 09 09 09 66 61 64 65 |r;..shor|t...fade|
|00001550| 53 70 65 65 64 3b 0d 09 | 4f 53 45 72 72 09 09 09 |Speed;..|OSErr...|
|00001560| 6d 79 45 72 72 3b 0d 09 | 52 65 63 74 09 09 09 70 |myErr;..|Rect...p|
|00001570| 69 63 74 31 47 52 65 63 | 74 3b 0d 09 52 65 63 74 |ict1GRec|t;..Rect|
|00001580| 09 09 09 70 69 63 74 32 | 47 52 65 63 74 3b 0d 09 |...pict2|GRect;..|
|00001590| 47 57 6f 72 6c 64 50 74 | 72 09 09 70 69 63 74 31 |GWorldPt|r..pict1|
|000015a0| 47 57 6f 72 6c 64 3b 0d | 09 47 57 6f 72 6c 64 50 |GWorld;.|.GWorldP|
|000015b0| 74 72 09 09 70 69 63 74 | 32 47 57 6f 72 6c 64 3b |tr..pict|2GWorld;|
|000015c0| 0d 09 45 76 65 6e 74 52 | 65 63 6f 72 64 09 09 6d |..EventR|ecord..m|
|000015d0| 79 45 76 65 6e 74 3b 0d | 09 0d 09 2f 2f 20 4d 61 |yEvent;.|...// Ma|
|000015e0| 6b 65 20 63 6f 6c 6f 72 | 73 20 66 6f 72 20 75 73 |ke color|s for us|
|000015f0| 65 20 6c 61 74 65 72 2e | 0d 09 0d 09 09 62 6c 61 |e later.|.....bla|
|00001600| 63 6b 43 6f 6c 6f 72 2e | 72 65 64 20 3d 20 62 6c |ckColor.|red = bl|
|00001610| 61 63 6b 43 6f 6c 6f 72 | 2e 67 72 65 65 6e 20 3d |ackColor|.green =|
|00001620| 20 62 6c 61 63 6b 43 6f | 6c 6f 72 2e 62 6c 75 65 | blackCo|lor.blue|
|00001630| 20 3d 20 30 3b 0d 09 09 | 77 68 69 74 65 43 6f 6c | = 0;...|whiteCol|
|00001640| 6f 72 2e 72 65 64 20 3d | 20 77 68 69 74 65 43 6f |or.red =| whiteCo|
|00001650| 6c 6f 72 2e 67 72 65 65 | 6e 20 3d 20 77 68 69 74 |lor.gree|n = whit|
|00001660| 65 43 6f 6c 6f 72 2e 62 | 6c 75 65 20 3d 20 30 78 |eColor.b|lue = 0x|
|00001670| 46 46 46 46 3b 0d 09 0d | 09 2f 2f 20 49 6e 69 74 |FFFF;...|.// Init|
|00001680| 69 61 6c 69 7a 65 20 74 | 68 65 20 4d 61 63 20 54 |ialize t|he Mac T|
|00001690| 6f 6f 6c 62 6f 78 0d 09 | 0d 09 49 6e 69 74 54 6f |oolbox..|..InitTo|
|000016a0| 6f 6c 62 6f 78 28 29 3b | 0d 09 0d 09 2f 2f 20 43 |olbox();|....// C|
|000016b0| 68 65 63 6b 20 74 68 65 | 20 73 79 73 74 65 6d 20 |heck the| system |
|000016c0| 76 65 72 73 69 6f 6e 2e | 20 54 68 69 73 20 70 72 |version.| This pr|
|000016d0| 6f 6a 65 63 74 20 72 65 | 71 75 69 72 65 73 20 53 |oject re|quires S|
|000016e0| 79 73 74 65 6d 20 37 0d | 09 2f 2f 20 6f 72 20 6c |ystem 7.|.// or l|
|000016f0| 61 74 65 72 20 66 6f 72 | 20 74 68 65 20 47 57 6f |ater for| the GWo|
|00001700| 72 6c 64 73 2e 0d 09 0d | 09 69 66 20 28 20 47 65 |rlds....|.if ( Ge|
|00001710| 74 53 79 73 56 65 72 73 | 69 6f 6e 28 29 20 3c 20 |tSysVers|ion() < |
|00001720| 37 20 29 0d 09 7b 0d 09 | 09 44 6f 41 6c 65 72 74 |7 )..{..|.DoAlert|
|00001730| 28 20 6b 53 79 73 37 44 | 6c 67 49 44 2c 20 74 72 |( kSys7D|lgID, tr|
|00001740| 75 65 20 29 3b 0d 09 09 | 45 78 69 74 54 6f 53 68 |ue );...|ExitToSh|
|00001750| 65 6c 6c 28 29 3b 0d 09 | 7d 0d 09 0d 09 2f 2f 20 |ell();..|}....// |
|00001760| 4c 6f 61 64 20 74 68 65 | 20 6d 61 69 6e 20 28 6f |Load the| main (o|
|00001770| 6e 6c 79 29 20 64 69 61 | 6c 6f 67 20 61 6e 64 20 |nly) dia|log and |
|00001780| 64 69 73 70 6c 61 79 20 | 69 74 20 6f 6e 20 73 63 |display |it on sc|
|00001790| 72 65 65 6e 2e 20 54 68 | 69 73 0d 09 2f 2f 20 61 |reen. Th|is..// a|
|000017a0| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 64 69 73 |utomatic|ally dis|
|000017b0| 70 6c 61 79 73 20 6f 75 | 72 20 74 77 6f 20 73 6f |plays ou|r two so|
|000017c0| 75 72 63 65 20 50 49 43 | 54 53 2e 20 53 69 6e 63 |urce PIC|TS. Sinc|
|000017d0| 65 20 74 68 65 72 65 20 | 69 73 0d 09 2f 2f 20 61 |e there |is..// a|
|000017e0| 20 27 64 63 74 62 27 20 | 28 44 69 61 6c 6f 67 20 | 'dctb' |(Dialog |
|000017f0| 43 6f 6c 6f 72 20 54 61 | 62 6c 65 29 20 72 65 73 |Color Ta|ble) res|
|00001800| 6f 75 72 63 65 20 77 69 | 74 68 20 74 68 65 20 73 |ource wi|th the s|
|00001810| 61 6d 65 20 49 44 0d 09 | 2f 2f 20 61 73 20 74 68 |ame ID..|// as th|
|00001820| 65 20 64 69 61 6c 6f 67 | 2c 20 74 68 65 20 44 69 |e dialog|, the Di|
|00001830| 61 6c 6f 67 20 4d 61 6e | 61 67 65 72 20 75 73 65 |alog Man|ager use|
|00001840| 73 20 4e 65 77 43 6f 6c | 6f 72 44 69 61 6c 6f 67 |s NewCol|orDialog|
|00001850| 20 74 6f 0d 09 2f 2f 20 | 6d 61 6b 65 20 74 68 65 | to..// |make the|
|00001860| 20 64 69 61 6c 6f 67 2c | 20 74 68 75 73 20 67 69 | dialog,| thus gi|
|00001870| 76 69 6e 67 20 75 73 20 | 61 20 63 6f 6c 6f 72 20 |ving us |a color |
|00001880| 64 72 61 77 69 6e 67 20 | 70 6f 72 74 2e 0d 09 0d |drawing |port....|
|00001890| 09 6d 61 69 6e 44 6c 67 | 20 3d 20 47 65 74 4e 65 |.mainDlg| = GetNe|
|000018a0| 77 44 69 61 6c 6f 67 28 | 20 6b 4d 61 69 6e 44 6c |wDialog(| kMainDl|
|000018b0| 67 49 44 2c 20 4e 55 4c | 4c 2c 20 28 57 69 6e 64 |gID, NUL|L, (Wind|
|000018c0| 6f 77 50 74 72 29 28 2d | 31 4c 29 20 29 3b 0d 09 |owPtr)(-|1L) );..|
|000018d0| 69 66 20 28 20 21 6d 61 | 69 6e 44 6c 67 20 29 0d |if ( !ma|inDlg ).|
|000018e0| 09 7b 0d 09 09 44 6f 41 | 6c 65 72 74 28 20 6b 4d |.{...DoA|lert( kM|
|000018f0| 65 6d 6f 72 79 4f 75 74 | 44 6c 67 49 44 2c 20 74 |emoryOut|DlgID, t|
|00001900| 72 75 65 20 29 3b 0d 09 | 09 45 78 69 74 54 6f 53 |rue );..|.ExitToS|
|00001910| 68 65 6c 6c 28 29 3b 0d | 09 7d 0d 09 0d 09 2f 2f |hell();.|.}....//|
|00001920| 20 53 65 6c 65 63 74 20 | 74 68 65 20 74 65 78 74 | Select |the text|
|00001930| 20 69 6e 20 74 68 65 20 | 66 61 64 65 20 73 70 65 | in the |fade spe|
|00001940| 65 64 20 74 65 78 74 20 | 65 64 69 74 20 62 6f 78 |ed text |edit box|
|00001950| 2e 0d 09 0d 09 53 65 6c | 65 63 74 44 69 61 6c 6f |.....Sel|ectDialo|
|00001960| 67 49 74 65 6d 54 65 78 | 74 28 20 6d 61 69 6e 44 |gItemTex|t( mainD|
|00001970| 6c 67 2c 20 6b 4d 61 69 | 6e 44 6c 67 46 61 64 65 |lg, kMai|nDlgFade|
|00001980| 53 70 65 65 64 2c 20 30 | 2c 20 32 35 35 20 29 3b |Speed, 0|, 255 );|
|00001990| 0d 09 0d 09 2f 2f 20 4d | 61 6b 65 20 73 75 72 65 |....// M|ake sure|
|000019a0| 20 74 68 65 20 64 69 61 | 6c 6f 67 20 69 73 20 76 | the dia|log is v|
|000019b0| 69 73 69 62 6c 65 2e 0d | 09 0d 09 53 68 6f 77 57 |isible..|...ShowW|
|000019c0| 69 6e 64 6f 77 28 20 6d | 61 69 6e 44 6c 67 20 29 |indow( m|ainDlg )|
|000019d0| 3b 0d 09 53 65 74 47 57 | 6f 72 6c 64 28 20 28 43 |;..SetGW|orld( (C|
|000019e0| 47 72 61 66 50 74 72 29 | 6d 61 69 6e 44 6c 67 2c |GrafPtr)|mainDlg,|
|000019f0| 20 4e 55 4c 4c 20 29 3b | 0d 09 50 65 6e 4e 6f 72 | NULL );|..PenNor|
|00001a00| 6d 61 6c 28 29 3b 0d 09 | 0d 09 2f 2f 20 47 65 74 |mal();..|..// Get|
|00001a10| 20 74 68 65 20 70 69 63 | 74 75 72 65 20 72 65 63 | the pic|ture rec|
|00001a20| 74 61 6e 67 6c 65 73 20 | 61 6e 64 20 74 68 65 20 |tangles |and the |
|00001a30| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 70 69 63 74 |destinat|ion pict|
|00001a40| 75 72 65 27 73 0d 09 2f | 2f 20 72 65 63 74 61 6e |ure's../|/ rectan|
|00001a50| 67 6c 65 2e 20 53 61 76 | 65 20 74 68 65 6d 20 66 |gle. Sav|e them f|
|00001a60| 6f 72 20 6c 61 74 65 72 | 20 75 73 65 2e 0d 09 0d |or later| use....|
|00001a70| 09 47 65 74 49 74 65 6d | 52 65 63 74 28 20 6d 61 |.GetItem|Rect( ma|
|00001a80| 69 6e 44 6c 67 2c 20 6b | 4d 61 69 6e 44 6c 67 50 |inDlg, k|MainDlgP|
|00001a90| 49 43 54 4f 6e 65 2c 20 | 26 70 69 63 74 31 52 65 |ICTOne, |&pict1Re|
|00001aa0| 63 74 20 29 3b 0d 09 47 | 65 74 49 74 65 6d 52 65 |ct );..G|etItemRe|
|00001ab0| 63 74 28 20 6d 61 69 6e | 44 6c 67 2c 20 6b 4d 61 |ct( main|Dlg, kMa|
|00001ac0| 69 6e 44 6c 67 50 49 43 | 54 54 77 6f 2c 20 26 70 |inDlgPIC|TTwo, &p|
|00001ad0| 69 63 74 32 52 65 63 74 | 20 29 3b 0d 09 47 65 74 |ict2Rect| );..Get|
|00001ae0| 49 74 65 6d 52 65 63 74 | 28 20 6d 61 69 6e 44 6c |ItemRect|( mainDl|
|00001af0| 67 2c 20 6b 4d 61 69 6e | 44 6c 67 44 65 73 74 50 |g, kMain|DlgDestP|
|00001b00| 49 43 54 2c 20 26 64 65 | 73 74 52 65 63 74 20 29 |ICT, &de|stRect )|
|00001b10| 3b 0d 09 0d 09 2f 2f 20 | 44 72 61 77 20 61 20 62 |;....// |Draw a b|
|00001b20| 6f 78 20 61 72 6f 75 6e | 64 20 65 61 63 68 20 6f |ox aroun|d each o|
|00001b30| 66 20 74 68 65 20 70 69 | 63 74 75 72 65 20 61 72 |f the pi|cture ar|
|00001b40| 65 61 73 2e 0d 09 0d 09 | 7b 0d 09 09 52 65 63 74 |eas.....|{...Rect|
|00001b50| 09 09 74 65 6d 70 52 65 | 63 74 3b 0d 09 09 0d 09 |..tempRe|ct;.....|
|00001b60| 09 74 65 6d 70 52 65 63 | 74 20 3d 20 64 65 73 74 |.tempRec|t = dest|
|00001b70| 52 65 63 74 3b 0d 09 09 | 49 6e 73 65 74 52 65 63 |Rect;...|InsetRec|
|00001b80| 74 28 20 26 74 65 6d 70 | 52 65 63 74 2c 20 2d 31 |t( &temp|Rect, -1|
|00001b90| 2c 20 2d 31 20 29 3b 0d | 09 09 46 72 61 6d 65 52 |, -1 );.|..FrameR|
|00001ba0| 65 63 74 28 20 26 74 65 | 6d 70 52 65 63 74 20 29 |ect( &te|mpRect )|
|00001bb0| 3b 0d 09 09 74 65 6d 70 | 52 65 63 74 20 3d 20 70 |;...temp|Rect = p|
|00001bc0| 69 63 74 31 52 65 63 74 | 3b 0d 09 09 49 6e 73 65 |ict1Rect|;...Inse|
|00001bd0| 74 52 65 63 74 28 20 26 | 74 65 6d 70 52 65 63 74 |tRect( &|tempRect|
|00001be0| 2c 20 2d 31 2c 20 2d 31 | 20 29 3b 0d 09 09 46 72 |, -1, -1| );...Fr|
|00001bf0| 61 6d 65 52 65 63 74 28 | 20 26 74 65 6d 70 52 65 |ameRect(| &tempRe|
|00001c00| 63 74 20 29 3b 0d 09 09 | 74 65 6d 70 52 65 63 74 |ct );...|tempRect|
|00001c10| 20 3d 20 70 69 63 74 32 | 52 65 63 74 3b 0d 09 09 | = pict2|Rect;...|
|00001c20| 49 6e 73 65 74 52 65 63 | 74 28 20 26 74 65 6d 70 |InsetRec|t( &temp|
|00001c30| 52 65 63 74 2c 20 2d 31 | 2c 20 2d 31 20 29 3b 0d |Rect, -1|, -1 );.|
|00001c40| 09 09 46 72 61 6d 65 52 | 65 63 74 28 20 26 74 65 |..FrameR|ect( &te|
|00001c50| 6d 70 52 65 63 74 20 29 | 3b 0d 09 7d 0d 09 0d 09 |mpRect )|;..}....|
|00001c60| 2f 2f 20 44 72 61 77 20 | 65 61 63 68 20 6f 66 20 |// Draw |each of |
|00001c70| 74 68 65 20 74 77 6f 20 | 22 73 6f 75 72 63 65 22 |the two |"source"|
|00001c80| 20 70 69 63 74 75 72 65 | 73 20 69 6e 74 6f 20 61 | picture|s into a|
|00001c90| 6e 20 6f 66 66 73 63 72 | 65 65 6e 0d 09 2f 2f 20 |n offscr|een..// |
|00001ca0| 47 72 61 70 68 69 63 73 | 20 57 6f 72 6c 64 20 66 |Graphics| World f|
|00001cb0| 6f 72 20 75 73 65 20 6c | 61 74 65 72 2e 20 46 6f |or use l|ater. Fo|
|00001cc0| 72 20 65 78 61 6d 70 6c | 65 2c 20 77 68 65 6e 20 |r exampl|e, when |
|00001cd0| 74 68 65 20 75 73 65 72 | 0d 09 2f 2f 20 70 61 73 |the user|..// pas|
|00001ce0| 73 65 73 20 74 68 65 20 | 63 75 72 73 6f 72 20 6f |ses the |cursor o|
|00001cf0| 76 65 72 20 74 68 65 20 | 6c 65 66 74 20 70 69 63 |ver the |left pic|
|00001d00| 74 75 72 65 2c 20 72 65 | 67 75 6c 61 72 20 61 6e |ture, re|gular an|
|00001d10| 69 6d 61 74 69 6f 6e 0d | 09 2f 2f 20 74 65 63 68 |imation.|.// tech|
|00001d20| 6e 69 71 75 65 73 20 61 | 72 65 20 75 73 65 64 20 |niques a|re used |
|00001d30| 74 6f 20 6d 61 6b 65 20 | 61 20 63 69 72 63 6c 65 |to make |a circle|
|00001d40| 20 22 66 6c 6f 61 74 22 | 20 61 62 6f 76 65 20 74 | "float"| above t|
|00001d50| 68 65 0d 09 2f 2f 20 70 | 69 63 74 75 72 65 20 28 |he..// p|icture (|
|00001d60| 63 61 75 73 65 73 20 66 | 6c 69 63 6b 65 72 29 2e |causes f|licker).|
|00001d70| 20 54 68 69 73 20 69 6e | 76 6f 6c 76 65 73 20 72 | This in|volves r|
|00001d80| 65 70 65 61 74 65 64 6c | 79 0d 09 2f 2f 20 63 6f |epeatedl|y..// co|
|00001d90| 70 79 69 6e 67 20 74 68 | 65 20 6f 72 69 67 69 6e |pying th|e origin|
|00001da0| 61 6c 20 70 69 63 74 75 | 72 65 20 74 6f 20 74 68 |al pictu|re to th|
|00001db0| 65 20 77 69 6e 64 6f 77 | 2c 20 74 68 65 6e 20 64 |e window|, then d|
|00001dc0| 72 61 77 69 6e 67 0d 09 | 2f 2f 20 74 68 65 20 63 |rawing..|// the c|
|00001dd0| 69 72 63 6c 65 20 6f 76 | 65 72 20 69 74 2e 20 57 |ircle ov|er it. W|
|00001de0| 68 65 6e 20 74 68 65 20 | 75 73 65 72 20 70 61 73 |hen the |user pas|
|00001df0| 73 65 73 20 74 68 65 20 | 63 75 72 73 6f 72 20 6f |ses the |cursor o|
|00001e00| 76 65 72 0d 09 2f 2f 20 | 74 68 65 20 72 69 67 68 |ver..// |the righ|
|00001e10| 74 20 70 69 63 74 75 72 | 65 2c 20 74 68 65 20 6f |t pictur|e, the o|
|00001e20| 72 69 67 69 6e 61 6c 20 | 70 69 63 74 75 72 65 20 |riginal |picture |
|00001e30| 69 73 20 64 72 61 77 6e | 20 74 6f 20 61 6e 0d 09 |is drawn| to an..|
|00001e40| 2f 2f 20 6f 66 66 73 63 | 72 65 65 6e 20 67 77 6f |// offsc|reen gwo|
|00001e50| 72 6c 64 20 61 6e 64 20 | 74 68 65 20 63 69 72 63 |rld and |the circ|
|00001e60| 6c 65 20 69 73 20 64 72 | 61 77 6e 20 6f 76 65 72 |le is dr|awn over|
|00001e70| 20 69 74 2c 20 74 68 65 | 6e 0d 09 2f 2f 20 74 68 | it, the|n..// th|
|00001e80| 61 74 20 69 6d 61 67 65 | 20 69 73 20 64 72 61 77 |at image| is draw|
|00001e90| 6e 20 74 6f 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |n to the| window |
|00001ea0| 72 65 73 75 6c 74 69 6e | 67 20 69 6e 20 66 6c 69 |resultin|g in fli|
|00001eb0| 63 6b 65 72 2d 66 72 65 | 65 0d 09 2f 2f 20 61 6e |cker-fre|e..// an|
|00001ec0| 69 6d 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 66 |imation |of the f|
|00001ed0| 6c 6f 61 74 69 6e 67 20 | 63 69 72 63 6c 65 2e 0d |loating |circle..|
|00001ee0| 09 2f 2f 0d 09 2f 2f 20 | 57 65 20 6e 65 65 64 20 |.//..// |We need |
|00001ef0| 74 68 65 20 74 77 6f 20 | 67 77 6f 72 6c 64 73 20 |the two |gworlds |
|00001f00| 68 65 72 65 20 73 6f 20 | 77 65 20 68 61 76 65 20 |here so |we have |
|00001f10| 74 68 65 20 6f 72 69 67 | 69 6e 61 6c 0d 09 2f 2f |the orig|inal..//|
|00001f20| 20 70 69 63 74 75 72 65 | 73 20 74 6f 20 63 6f 70 | picture|s to cop|
|00001f30| 79 20 66 72 6f 6d 2e 0d | 09 0d 09 09 2f 2f 20 43 |y from..|....// C|
|00001f40| 6f 6e 76 65 72 74 20 74 | 68 65 20 64 65 73 74 69 |onvert t|he desti|
|00001f50| 6e 61 74 69 6f 6e 20 72 | 65 63 74 61 6e 67 6c 65 |nation r|ectangle|
|00001f60| 73 20 69 6e 74 6f 20 67 | 6c 6f 62 61 6c 20 63 6f |s into g|lobal co|
|00001f70| 6f 72 64 69 6e 61 74 65 | 73 0d 09 0d 09 09 70 69 |ordinate|s.....pi|
|00001f80| 63 74 31 47 52 65 63 74 | 20 3d 20 70 69 63 74 31 |ct1GRect| = pict1|
|00001f90| 52 65 63 74 3b 0d 09 09 | 4c 6f 63 61 6c 54 6f 47 |Rect;...|LocalToG|
|00001fa0| 6c 6f 62 61 6c 28 20 26 | 54 4f 50 4c 45 46 54 28 |lobal( &|TOPLEFT(|
|00001fb0| 70 69 63 74 31 47 52 65 | 63 74 29 20 29 3b 0d 09 |pict1GRe|ct) );..|
|00001fc0| 09 4c 6f 63 61 6c 54 6f | 47 6c 6f 62 61 6c 28 20 |.LocalTo|Global( |
|00001fd0| 26 42 4f 54 52 49 47 48 | 54 28 70 69 63 74 31 47 |&BOTRIGH|T(pict1G|
|00001fe0| 52 65 63 74 29 20 29 3b | 0d 0d 09 09 70 69 63 74 |Rect) );|....pict|
|00001ff0| 32 47 52 65 63 74 20 3d | 20 70 69 63 74 32 52 65 |2GRect =| pict2Re|
|00002000| 63 74 3b 0d 09 09 4c 6f | 63 61 6c 54 6f 47 6c 6f |ct;...Lo|calToGlo|
|00002010| 62 61 6c 28 20 26 54 4f | 50 4c 45 46 54 28 70 69 |bal( &TO|PLEFT(pi|
|00002020| 63 74 32 47 52 65 63 74 | 29 20 29 3b 0d 09 09 4c |ct2GRect|) );...L|
|00002030| 6f 63 61 6c 54 6f 47 6c | 6f 62 61 6c 28 20 26 42 |ocalToGl|obal( &B|
|00002040| 4f 54 52 49 47 48 54 28 | 70 69 63 74 32 47 52 65 |OTRIGHT(|pict2GRe|
|00002050| 63 74 29 20 29 3b 0d 0d | 09 09 2f 2f 20 43 72 65 |ct) );..|..// Cre|
|00002060| 61 74 65 20 6f 66 66 73 | 63 72 65 65 6e 20 47 57 |ate offs|creen GW|
|00002070| 6f 72 6c 64 73 20 77 69 | 74 68 20 74 68 65 20 73 |orlds wi|th the s|
|00002080| 61 6d 65 20 73 69 7a 65 | 20 61 6e 64 20 64 65 70 |ame size| and dep|
|00002090| 74 68 20 61 73 20 74 68 | 65 0d 09 09 2f 2f 20 64 |th as th|e...// d|
|000020a0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 72 65 63 74 61 |estinati|on recta|
|000020b0| 6e 67 6c 65 73 2e 20 54 | 68 65 20 70 61 72 61 6d |ngles. T|he param|
|000020c0| 65 74 65 72 73 20 61 72 | 65 20 61 73 20 66 6f 6c |eters ar|e as fol|
|000020d0| 6c 6f 77 73 3a 0d 09 09 | 2f 2f 09 09 26 70 69 63 |lows:...|//..&pic|
|000020e0| 74 78 47 57 6f 72 6c 64 | 09 09 70 74 72 20 74 6f |txGWorld|..ptr to|
|000020f0| 20 6e 65 77 20 67 72 61 | 70 68 69 63 73 20 77 6f | new gra|phics wo|
|00002100| 72 6c 64 0d 09 09 2f 2f | 09 09 30 09 09 09 09 09 |rld...//|..0.....|
|00002110| 62 69 74 20 64 65 70 74 | 68 20 73 61 6d 65 20 61 |bit dept|h same a|
|00002120| 73 20 67 72 61 70 68 69 | 63 73 20 64 65 76 69 63 |s graphi|cs devic|
|00002130| 65 20 6f 66 20 64 65 73 | 74 20 72 65 63 74 0d 09 |e of des|t rect..|
|00002140| 09 2f 2f 09 09 26 70 69 | 63 74 78 47 52 65 63 74 |.//..&pi|ctxGRect|
|00002150| 09 09 09 62 6f 75 6e 64 | 73 20 72 65 63 74 61 6e |...bound|s rectan|
|00002160| 67 6c 65 20 6f 66 20 47 | 57 6f 72 6c 64 0d 09 09 |gle of G|World...|
|00002170| 2f 2f 09 09 4e 55 4c 4c | 09 09 09 09 68 61 6e 64 |//..NULL|....hand|
|00002180| 6c 65 20 74 6f 20 61 20 | 63 6f 6c 6f 72 20 74 61 |le to a |color ta|
|00002190| 62 6c 65 20 72 65 63 6f | 72 64 20 2d 20 4e 55 4c |ble reco|rd - NUL|
|000021a0| 4c 20 6d 65 61 6e 73 0d | 09 09 2f 2f 09 09 09 09 |L means.|..//....|
|000021b0| 09 09 09 75 73 65 20 74 | 68 65 20 64 65 66 61 75 |...use t|he defau|
|000021c0| 6c 74 20 72 65 63 6f 72 | 64 20 66 6f 72 20 74 68 |lt recor|d for th|
|000021d0| 61 74 20 64 65 70 74 68 | 0d 09 09 2f 2f 09 09 4e |at depth|...//..N|
|000021e0| 55 4c 4c 09 09 09 09 68 | 61 6e 64 6c 65 20 74 6f |ULL....h|andle to|
|000021f0| 20 61 20 67 72 61 70 68 | 69 63 73 20 64 65 76 69 | a graph|ics devi|
|00002200| 63 65 20 72 65 63 6f 72 | 64 20 2d 20 77 65 20 61 |ce recor|d - we a|
|00002210| 72 65 6e 27 74 0d 09 09 | 2f 2f 09 09 09 09 09 09 |ren't...|//......|
|00002220| 09 63 72 65 61 74 69 6e | 67 20 61 20 6e 65 77 20 |.creatin|g a new |
|00002230| 67 72 61 70 68 69 63 73 | 20 64 65 76 69 63 65 0d |graphics| device.|
|00002240| 09 09 2f 2f 09 09 30 4c | 09 09 09 09 09 6e 6f 20 |..//..0L|.....no |
|00002250| 66 6c 61 67 73 0d 09 0d | 09 09 6d 79 45 72 72 20 |flags...|..myErr |
|00002260| 3d 20 4e 65 77 47 57 6f | 72 6c 64 28 20 26 70 69 |= NewGWo|rld( &pi|
|00002270| 63 74 31 47 57 6f 72 6c | 64 2c 20 30 2c 20 26 70 |ct1GWorl|d, 0, &p|
|00002280| 69 63 74 31 47 52 65 63 | 74 2c 20 4e 55 4c 4c 2c |ict1GRec|t, NULL,|
|00002290| 20 4e 55 4c 4c 2c 20 30 | 4c 20 29 3b 0d 09 09 6d | NULL, 0|L );...m|
|000022a0| 79 45 72 72 20 3d 20 4e | 65 77 47 57 6f 72 6c 64 |yErr = N|ewGWorld|
|000022b0| 28 20 26 70 69 63 74 32 | 47 57 6f 72 6c 64 2c 20 |( &pict2|GWorld, |
|000022c0| 30 2c 20 26 70 69 63 74 | 32 47 52 65 63 74 2c 20 |0, &pict|2GRect, |
|000022d0| 4e 55 4c 4c 2c 20 4e 55 | 4c 4c 2c 20 30 4c 20 29 |NULL, NU|LL, 0L )|
|000022e0| 3b 0d 09 09 0d 09 09 2f | 2f 20 49 27 6d 20 6a 75 |;....../|/ I'm ju|
|000022f0| 73 74 20 61 73 73 75 6d | 69 6e 67 20 68 65 72 65 |st assum|ing here|
|00002300| 20 74 68 61 74 20 61 6e | 20 65 72 72 6f 72 20 6d | that an| error m|
|00002310| 65 61 6e 73 20 77 65 20 | 64 6f 6e 27 74 20 68 61 |eans we |don't ha|
|00002320| 76 65 20 65 6e 6f 75 67 | 68 20 6d 65 6d 6f 72 79 |ve enoug|h memory|
|00002330| 2e 0d 09 0d 09 09 69 66 | 20 28 20 6d 79 45 72 72 |......if| ( myErr|
|00002340| 20 7c 7c 20 21 70 69 63 | 74 31 47 57 6f 72 6c 64 | || !pic|t1GWorld|
|00002350| 20 7c 7c 20 21 70 69 63 | 74 32 47 57 6f 72 6c 64 | || !pic|t2GWorld|
|00002360| 20 29 0d 09 09 7b 0d 09 | 09 09 44 6f 41 6c 65 72 | )...{..|..DoAler|
|00002370| 74 28 20 6b 4d 65 6d 6f | 72 79 4f 75 74 44 6c 67 |t( kMemo|ryOutDlg|
|00002380| 49 44 2c 20 74 72 75 65 | 20 29 3b 0d 09 09 09 45 |ID, true| );....E|
|00002390| 78 69 74 54 6f 53 68 65 | 6c 6c 28 29 3b 0d 09 09 |xitToShe|ll();...|
|000023a0| 7d 0d 09 09 0d 09 09 2f | 2f 20 44 72 61 77 20 74 |}....../|/ Draw t|
|000023b0| 68 65 20 70 69 63 74 75 | 72 65 73 20 69 6e 20 74 |he pictu|res in t|
|000023c0| 68 65 20 70 69 63 74 75 | 72 65 20 6f 66 66 73 63 |he pictu|re offsc|
|000023d0| 72 65 65 6e 20 67 72 61 | 70 68 69 63 73 20 77 6f |reen gra|phics wo|
|000023e0| 72 6c 64 73 2e 0d 09 09 | 2f 2f 20 57 68 65 6e 20 |rlds....|// When |
|000023f0| 49 20 72 65 61 64 20 69 | 6e 20 74 68 65 20 50 49 |I read i|n the PI|
|00002400| 43 54 20 72 65 73 6f 75 | 72 63 65 73 2c 20 49 27 |CT resou|rces, I'|
|00002410| 6d 20 6a 75 73 74 20 61 | 73 73 75 6d 69 6e 67 20 |m just a|ssuming |
|00002420| 74 68 65 72 65 20 77 6f | 6e 27 74 0d 09 09 2f 2f |there wo|n't...//|
|00002430| 20 62 65 20 61 6e 79 20 | 65 72 72 6f 72 73 20 62 | be any |errors b|
|00002440| 65 63 61 75 73 65 20 74 | 68 65 79 27 72 65 20 61 |ecause t|hey're a|
|00002450| 6c 72 65 61 64 79 20 6c | 6f 61 64 65 64 20 62 79 |lready l|oaded by|
|00002460| 20 74 68 65 20 64 69 61 | 6c 6f 67 0d 09 09 2f 2f | the dia|log...//|
|00002470| 20 61 6e 79 77 61 79 2c | 20 62 75 74 20 79 6f 75 | anyway,| but you|
|00002480| 20 6e 65 76 65 72 20 6b | 6e 6f 77 2e 20 59 6f 75 | never k|now. You|
|00002490| 20 70 72 6f 62 61 62 6c | 79 20 72 65 61 6c 6c 79 | probabl|y really|
|000024a0| 20 73 68 6f 75 6c 64 20 | 63 68 65 63 6b 20 3a 29 | should |check :)|
|000024b0| 0d 09 09 2f 2f 20 53 65 | 65 20 74 68 65 20 46 61 |...// Se|e the Fa|
|000024c0| 64 65 54 6f 42 6c 61 63 | 6b 20 72 6f 75 74 69 6e |deToBlac|k routin|
|000024d0| 65 20 66 6f 72 20 6d 6f | 72 65 20 65 78 70 6c 61 |e for mo|re expla|
|000024e0| 6e 61 74 69 6f 6e 20 6f | 6e 20 6c 6f 63 6b 69 6e |nation o|n lockin|
|000024f0| 67 20 61 6e 64 0d 09 09 | 2f 2f 20 75 6e 6c 6f 63 |g and...|// unloc|
|00002500| 6b 69 6e 67 20 70 69 78 | 65 6c 73 2e 0d 09 09 7b |king pix|els....{|
|00002510| 0d 09 09 09 50 69 63 48 | 61 6e 64 6c 65 09 09 61 |....PicH|andle..a|
|00002520| 50 69 63 74 3b 0d 09 09 | 09 50 69 78 4d 61 70 48 |Pict;...|.PixMapH|
|00002530| 61 6e 64 6c 65 09 74 68 | 65 50 69 78 4d 61 70 3b |andle.th|ePixMap;|
|00002540| 0d 09 09 09 0d 09 09 09 | 2f 2f 20 67 65 74 20 61 |........|// get a|
|00002550| 6e 64 20 64 72 61 77 20 | 70 69 63 74 75 72 65 20 |nd draw |picture |
|00002560| 31 0d 09 09 09 0d 09 09 | 09 74 68 65 50 69 78 4d |1.......|.thePixM|
|00002570| 61 70 20 3d 20 47 65 74 | 47 57 6f 72 6c 64 50 69 |ap = Get|GWorldPi|
|00002580| 78 4d 61 70 28 20 70 69 | 63 74 31 47 57 6f 72 6c |xMap( pi|ct1GWorl|
|00002590| 64 20 29 3b 0d 09 09 09 | 4c 6f 63 6b 50 69 78 65 |d );....|LockPixe|
|000025a0| 6c 73 28 20 74 68 65 50 | 69 78 4d 61 70 20 29 3b |ls( theP|ixMap );|
|000025b0| 0d 09 09 09 53 65 74 47 | 57 6f 72 6c 64 28 20 28 |....SetG|World( (|
|000025c0| 43 47 72 61 66 50 74 72 | 29 70 69 63 74 31 47 57 |CGrafPtr|)pict1GW|
|000025d0| 6f 72 6c 64 2c 20 4e 55 | 4c 4c 20 29 3b 0d 09 09 |orld, NU|LL );...|
|000025e0| 09 61 50 69 63 74 20 3d | 20 47 65 74 50 69 63 74 |.aPict =| GetPict|
|000025f0| 75 72 65 28 20 6b 50 69 | 63 74 31 49 44 20 29 3b |ure( kPi|ct1ID );|
|00002600| 0d 09 09 09 44 72 61 77 | 50 69 63 74 75 72 65 28 |....Draw|Picture(|
|00002610| 20 61 50 69 63 74 2c 20 | 26 57 49 4e 50 4f 52 54 | aPict, |&WINPORT|
|00002620| 52 45 43 54 28 20 70 69 | 63 74 31 47 57 6f 72 6c |RECT( pi|ct1GWorl|
|00002630| 64 20 29 20 29 3b 0d 09 | 09 09 55 6e 6c 6f 63 6b |d ) );..|..Unlock|
|00002640| 50 69 78 65 6c 73 28 20 | 74 68 65 50 69 78 4d 61 |Pixels( |thePixMa|
|00002650| 70 20 29 3b 0d 09 09 09 | 0d 09 09 09 2f 2f 20 67 |p );....|....// g|
|00002660| 65 74 20 61 6e 64 20 64 | 72 61 77 20 70 69 63 74 |et and d|raw pict|
|00002670| 75 72 65 20 32 0d 09 09 | 09 0d 09 09 09 74 68 65 |ure 2...|.....the|
|00002680| 50 69 78 4d 61 70 20 3d | 20 47 65 74 47 57 6f 72 |PixMap =| GetGWor|
|00002690| 6c 64 50 69 78 4d 61 70 | 28 20 70 69 63 74 32 47 |ldPixMap|( pict2G|
|000026a0| 57 6f 72 6c 64 20 29 3b | 0d 09 09 09 4c 6f 63 6b |World );|....Lock|
|000026b0| 50 69 78 65 6c 73 28 20 | 74 68 65 50 69 78 4d 61 |Pixels( |thePixMa|
|000026c0| 70 20 29 3b 0d 09 09 09 | 53 65 74 47 57 6f 72 6c |p );....|SetGWorl|
|000026d0| 64 28 20 28 43 47 72 61 | 66 50 74 72 29 70 69 63 |d( (CGra|fPtr)pic|
|000026e0| 74 32 47 57 6f 72 6c 64 | 2c 20 4e 55 4c 4c 20 29 |t2GWorld|, NULL )|
|000026f0| 3b 0d 09 09 09 61 50 69 | 63 74 20 3d 20 47 65 74 |;....aPi|ct = Get|
|00002700| 50 69 63 74 75 72 65 28 | 20 6b 50 69 63 74 32 49 |Picture(| kPict2I|
|00002710| 44 20 29 3b 0d 09 09 09 | 44 72 61 77 50 69 63 74 |D );....|DrawPict|
|00002720| 75 72 65 28 20 61 50 69 | 63 74 2c 20 26 57 49 4e |ure( aPi|ct, &WIN|
|00002730| 50 4f 52 54 52 45 43 54 | 28 20 70 69 63 74 32 47 |PORTRECT|( pict2G|
|00002740| 57 6f 72 6c 64 20 29 20 | 29 3b 0d 09 09 09 55 6e |World ) |);....Un|
|00002750| 6c 6f 63 6b 50 69 78 65 | 6c 73 28 20 74 68 65 50 |lockPixe|ls( theP|
|00002760| 69 78 4d 61 70 20 29 3b | 0d 09 09 09 0d 09 09 09 |ixMap );|........|
|00002770| 2f 2f 20 6d 61 6b 65 20 | 73 75 72 65 20 61 6e 64 |// make |sure and|
|00002780| 20 72 65 73 74 6f 72 65 | 20 74 68 65 20 64 69 61 | restore| the dia|
|00002790| 6c 6f 67 20 61 73 20 74 | 68 65 20 63 75 72 72 65 |log as t|he curre|
|000027a0| 6e 74 20 70 6f 72 74 0d | 09 09 09 0d 09 09 09 53 |nt port.|.......S|
|000027b0| 65 74 47 57 6f 72 6c 64 | 28 20 28 43 47 72 61 66 |etGWorld|( (CGraf|
|000027c0| 50 74 72 29 6d 61 69 6e | 44 6c 67 2c 20 4e 55 4c |Ptr)main|Dlg, NUL|
|000027d0| 4c 20 29 3b 0d 09 09 7d | 0d 09 09 0d 09 2f 2f 20 |L );...}|.....// |
|000027e0| 4e 6f 77 20 77 61 69 74 | 20 66 6f 72 20 74 68 65 |Now wait| for the|
|000027f0| 20 75 73 65 72 20 74 6f | 20 70 72 65 73 73 20 61 | user to| press a|
|00002800| 20 62 75 74 74 6f 6e 20 | 69 6e 20 74 68 65 20 64 | button |in the d|
|00002810| 69 61 6c 6f 67 0d 09 0d | 09 69 74 65 6d 48 69 74 |ialog...|.itemHit|
|00002820| 20 3d 20 2d 31 3b 0d 09 | 77 68 69 6c 65 20 28 20 | = -1;..|while ( |
|00002830| 69 74 65 6d 48 69 74 20 | 21 3d 20 6b 4d 61 69 6e |itemHit |!= kMain|
|00002840| 44 6c 67 51 75 69 74 20 | 29 0d 09 7b 0d 09 09 57 |DlgQuit |)..{...W|
|00002850| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 28 20 65 76 |aitNextE|vent( ev|
|00002860| 65 72 79 45 76 65 6e 74 | 2c 20 26 6d 79 45 76 65 |eryEvent|, &myEve|
|00002870| 6e 74 2c 20 47 65 74 43 | 61 72 65 74 54 69 6d 65 |nt, GetC|aretTime|
|00002880| 28 29 2c 20 4e 55 4c 4c | 20 29 3b 0d 09 09 0d 09 |(), NULL| );.....|
|00002890| 09 2f 2f 20 43 68 65 63 | 6b 20 66 6f 72 20 64 69 |.// Chec|k for di|
|000028a0| 73 6b 20 65 76 65 6e 74 | 73 20 28 62 61 64 20 64 |sk event|s (bad d|
|000028b0| 69 73 6b 20 6d 6f 75 6e | 74 29 2e 0d 09 09 0d 09 |isk moun|t)......|
|000028c0| 09 69 66 20 28 20 28 6d | 79 45 76 65 6e 74 2e 77 |.if ( (m|yEvent.w|
|000028d0| 68 61 74 20 3d 3d 20 64 | 69 73 6b 45 76 74 29 20 |hat == d|iskEvt) |
|000028e0| 26 26 0d 09 09 09 28 48 | 69 57 6f 72 64 28 6d 79 |&&....(H|iWord(my|
|000028f0| 45 76 65 6e 74 2e 6d 65 | 73 73 61 67 65 29 20 21 |Event.me|ssage) !|
|00002900| 3d 20 6e 6f 45 72 72 29 | 20 29 0d 09 09 7b 0d 09 |= noErr)| )...{..|
|00002910| 09 09 50 6f 69 6e 74 09 | 09 64 6c 67 55 70 4c 65 |..Point.|.dlgUpLe|
|00002920| 66 74 43 6f 72 6e 65 72 | 20 3d 20 7b 20 31 30 30 |ftCorner| = { 100|
|00002930| 2c 20 38 30 20 7d 3b 09 | 2f 2f 20 69 67 6e 6f 72 |, 80 };.|// ignor|
|00002940| 65 64 20 69 6e 20 53 79 | 73 20 37 0d 09 09 09 0d |ed in Sy|s 7.....|
|00002950| 09 09 09 44 49 42 61 64 | 4d 6f 75 6e 74 28 20 64 |...DIBad|Mount( d|
|00002960| 6c 67 55 70 4c 65 66 74 | 43 6f 72 6e 65 72 2c 20 |lgUpLeft|Corner, |
|00002970| 6d 79 45 76 65 6e 74 2e | 6d 65 73 73 61 67 65 20 |myEvent.|message |
|00002980| 29 3b 09 2f 2f 20 69 67 | 6e 6f 72 65 20 72 65 73 |);.// ig|nore res|
|00002990| 75 6c 74 0d 09 09 7d 0d | 09 09 2f 2f 20 49 66 20 |ult...}.|..// If |
|000029a0| 77 65 20 67 65 74 20 61 | 6e 20 75 70 64 61 74 65 |we get a|n update|
|000029b0| 20 65 76 65 6e 74 2c 20 | 72 65 64 72 61 77 20 74 | event, |redraw t|
|000029c0| 68 65 20 73 71 75 61 72 | 65 73 20 61 72 6f 75 6e |he squar|es aroun|
|000029d0| 64 20 74 68 65 0d 09 09 | 2f 2f 20 70 69 63 74 75 |d the...|// pictu|
|000029e0| 72 65 20 61 72 65 61 73 | 2e 0d 09 09 65 6c 73 65 |re areas|....else|
|000029f0| 20 69 66 20 28 20 6d 79 | 45 76 65 6e 74 2e 77 68 | if ( my|Event.wh|
|00002a00| 61 74 20 3d 3d 20 75 70 | 64 61 74 65 45 76 74 20 |at == up|dateEvt |
|00002a10| 29 0d 09 09 7b 0d 09 09 | 09 52 65 63 74 09 09 74 |)...{...|.Rect..t|
|00002a20| 65 6d 70 52 65 63 74 3b | 0d 09 09 09 0d 09 09 09 |empRect;|........|
|00002a30| 74 65 6d 70 52 65 63 74 | 20 3d 20 64 65 73 74 52 |tempRect| = destR|
|00002a40| 65 63 74 3b 0d 09 09 09 | 49 6e 73 65 74 52 65 63 |ect;....|InsetRec|
|00002a50| 74 28 20 26 74 65 6d 70 | 52 65 63 74 2c 20 2d 31 |t( &temp|Rect, -1|
|00002a60| 2c 20 2d 31 20 29 3b 0d | 09 09 09 46 72 61 6d 65 |, -1 );.|...Frame|
|00002a70| 52 65 63 74 28 20 26 74 | 65 6d 70 52 65 63 74 20 |Rect( &t|empRect |
|00002a80| 29 3b 0d 09 09 09 74 65 | 6d 70 52 65 63 74 20 3d |);....te|mpRect =|
|00002a90| 20 70 69 63 74 31 52 65 | 63 74 3b 0d 09 09 09 49 | pict1Re|ct;....I|
|00002aa0| 6e 73 65 74 52 65 63 74 | 28 20 26 74 65 6d 70 52 |nsetRect|( &tempR|
|00002ab0| 65 63 74 2c 20 2d 31 2c | 20 2d 31 20 29 3b 0d 09 |ect, -1,| -1 );..|
|00002ac0| 09 09 46 72 61 6d 65 52 | 65 63 74 28 20 26 74 65 |..FrameR|ect( &te|
|00002ad0| 6d 70 52 65 63 74 20 29 | 3b 0d 09 09 09 74 65 6d |mpRect )|;....tem|
|00002ae0| 70 52 65 63 74 20 3d 20 | 70 69 63 74 32 52 65 63 |pRect = |pict2Rec|
|00002af0| 74 3b 0d 09 09 09 49 6e | 73 65 74 52 65 63 74 28 |t;....In|setRect(|
|00002b00| 20 26 74 65 6d 70 52 65 | 63 74 2c 20 2d 31 2c 20 | &tempRe|ct, -1, |
|00002b10| 2d 31 20 29 3b 0d 09 09 | 09 46 72 61 6d 65 52 65 |-1 );...|.FrameRe|
|00002b20| 63 74 28 20 26 74 65 6d | 70 52 65 63 74 20 29 3b |ct( &tem|pRect );|
|00002b30| 0d 09 09 7d 0d 09 09 0d | 09 09 2f 2f 20 49 66 20 |...}....|..// If |
|00002b40| 74 68 65 20 6d 6f 75 73 | 65 20 69 73 20 6f 76 65 |the mous|e is ove|
|00002b50| 72 20 6f 6e 65 20 6f 66 | 20 74 68 65 20 70 69 63 |r one of| the pic|
|00002b60| 74 75 72 65 73 2c 20 63 | 61 6c 6c 20 61 20 72 6f |tures, c|all a ro|
|00002b70| 75 74 69 6e 65 0d 09 09 | 2f 2f 20 74 6f 20 61 6e |utine...|// to an|
|00002b80| 69 6d 61 74 65 20 61 20 | 22 66 6c 6f 61 74 69 6e |imate a |"floatin|
|00002b90| 67 20 63 69 72 63 6c 65 | 22 20 6f 76 65 72 20 74 |g circle|" over t|
|00002ba0| 68 65 20 70 69 63 74 75 | 72 65 2e 20 41 0d 09 09 |he pictu|re. A...|
|00002bb0| 2f 2f 20 64 69 66 66 65 | 72 65 6e 74 20 6d 65 74 |// diffe|rent met|
|00002bc0| 68 6f 64 20 69 73 20 75 | 73 65 64 20 66 6f 72 20 |hod is u|sed for |
|00002bd0| 65 61 63 68 20 70 69 63 | 74 75 72 65 2e 0d 09 09 |each pic|ture....|
|00002be0| 7b 0d 09 09 09 50 6f 69 | 6e 74 09 09 6d 6f 75 73 |{....Poi|nt..mous|
|00002bf0| 65 4c 6f 63 3b 0d 09 09 | 09 0d 09 09 09 47 65 74 |eLoc;...|.....Get|
|00002c00| 4d 6f 75 73 65 28 20 26 | 6d 6f 75 73 65 4c 6f 63 |Mouse( &|mouseLoc|
|00002c10| 20 29 3b 0d 09 09 09 0d | 09 09 09 69 66 20 28 20 | );.....|...if ( |
|00002c20| 50 74 49 6e 52 65 63 74 | 28 20 6d 6f 75 73 65 4c |PtInRect|( mouseL|
|00002c30| 6f 63 2c 20 26 70 69 63 | 74 31 52 65 63 74 20 29 |oc, &pic|t1Rect )|
|00002c40| 20 29 0d 09 09 09 09 46 | 6c 69 63 6b 65 72 41 6e | ).....F|lickerAn|
|00002c50| 69 6d 61 74 65 28 20 70 | 69 63 74 31 47 57 6f 72 |imate( p|ict1GWor|
|00002c60| 6c 64 2c 20 26 70 69 63 | 74 31 52 65 63 74 20 29 |ld, &pic|t1Rect )|
|00002c70| 3b 0d 09 09 09 65 6c 73 | 65 20 69 66 20 28 20 50 |;....els|e if ( P|
|00002c80| 74 49 6e 52 65 63 74 28 | 20 6d 6f 75 73 65 4c 6f |tInRect(| mouseLo|
|00002c90| 63 2c 20 26 70 69 63 74 | 32 52 65 63 74 20 29 20 |c, &pict|2Rect ) |
|00002ca0| 29 0d 09 09 09 09 53 6d | 6f 6f 74 68 41 6e 69 6d |).....Sm|oothAnim|
|00002cb0| 61 74 65 28 20 70 69 63 | 74 32 47 57 6f 72 6c 64 |ate( pic|t2GWorld|
|00002cc0| 2c 20 26 70 69 63 74 32 | 52 65 63 74 20 29 3b 0d |, &pict2|Rect );.|
|00002cd0| 09 09 7d 0d 0d 09 09 2f | 2f 20 50 61 73 73 20 74 |..}..../|/ Pass t|
|00002ce0| 68 65 20 65 76 65 6e 74 | 20 74 6f 20 44 69 61 6c |he event| to Dial|
|00002cf0| 6f 67 53 65 6c 65 63 74 | 20 77 68 69 63 68 20 74 |ogSelect| which t|
|00002d00| 61 6b 65 73 20 63 61 72 | 65 20 6f 66 20 74 72 61 |akes car|e of tra|
|00002d10| 63 6b 69 6e 67 0d 09 09 | 2f 2f 20 63 6f 6e 74 72 |cking...|// contr|
|00002d20| 6f 6c 73 20 61 6e 64 20 | 75 70 64 61 74 69 6e 67 |ols and |updating|
|00002d30| 20 65 76 65 72 79 74 68 | 69 6e 67 20 28 65 78 63 | everyth|ing (exc|
|00002d40| 65 70 74 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 |ept the |destinat|
|00002d50| 69 6f 6e 0d 09 09 2f 2f | 20 61 72 65 61 29 20 66 |ion...//| area) f|
|00002d60| 6f 72 20 75 73 2e 0d 09 | 09 0d 09 09 69 66 20 28 |or us...|....if (|
|00002d70| 20 44 69 61 6c 6f 67 53 | 65 6c 65 63 74 28 20 26 | DialogS|elect( &|
|00002d80| 6d 79 45 76 65 6e 74 2c | 20 26 61 44 6c 67 2c 20 |myEvent,| &aDlg, |
|00002d90| 26 69 74 65 6d 48 69 74 | 20 29 20 29 0d 09 09 7b |&itemHit| ) )...{|
|00002da0| 0d 09 09 09 2f 2f 20 57 | 68 61 74 20 77 65 20 64 |....// W|hat we d|
|00002db0| 6f 20 68 65 72 65 20 64 | 65 70 65 6e 64 73 20 6f |o here d|epends o|
|00002dc0| 6e 20 77 68 61 74 20 74 | 68 65 20 75 73 65 72 20 |n what t|he user |
|00002dd0| 63 6c 69 63 6b 65 64 0d | 09 09 09 0d 09 09 09 73 |clicked.|.......s|
|00002de0| 77 69 74 63 68 28 20 69 | 74 65 6d 48 69 74 20 29 |witch( i|temHit )|
|00002df0| 0d 09 09 09 7b 0d 09 09 | 09 09 63 61 73 65 20 6b |....{...|..case k|
|00002e00| 4d 61 69 6e 44 6c 67 43 | 6f 70 79 4f 6e 65 3a 0d |MainDlgC|opyOne:.|
|00002e10| 09 09 09 09 0d 09 09 09 | 09 09 2f 2f 20 53 61 76 |........|..// Sav|
|00002e20| 65 20 74 68 65 20 70 65 | 6e 20 73 74 61 74 65 20 |e the pe|n state |
|00002e30| 61 6e 64 20 66 6f 72 65 | 67 72 6f 75 6e 64 2f 62 |and fore|ground/b|
|00002e40| 61 63 6b 67 72 6f 75 6e | 64 20 63 6f 6c 6f 72 73 |ackgroun|d colors|
|00002e50| 0d 09 09 09 09 09 0d 09 | 09 09 09 09 09 47 65 74 |........|.....Get|
|00002e60| 50 65 6e 53 74 61 74 65 | 28 20 26 73 61 76 65 64 |PenState|( &saved|
|00002e70| 50 65 6e 20 29 3b 0d 09 | 09 09 09 09 09 47 65 74 |Pen );..|.....Get|
|00002e80| 46 6f 72 65 43 6f 6c 6f | 72 28 20 26 73 61 76 65 |ForeColo|r( &save|
|00002e90| 64 46 6f 72 65 20 29 3b | 0d 09 09 09 09 09 09 47 |dFore );|.......G|
|00002ea0| 65 74 42 61 63 6b 43 6f | 6c 6f 72 28 20 26 73 61 |etBackCo|lor( &sa|
|00002eb0| 76 65 64 42 61 63 6b 20 | 29 3b 0d 09 09 09 09 09 |vedBack |);......|
|00002ec0| 0d 09 09 09 09 09 2f 2f | 20 53 65 74 20 66 6f 72 |......//| Set for|
|00002ed0| 65 67 72 6f 75 6e 64 20 | 63 6f 6c 6f 72 20 74 6f |eground |color to|
|00002ee0| 20 62 6c 61 63 6b 2c 20 | 62 61 63 6b 67 72 6f 75 | black, |backgrou|
|00002ef0| 6e 64 20 63 6f 6c 6f 72 | 20 74 6f 20 77 68 69 74 |nd color| to whit|
|00002f00| 65 0d 09 09 09 09 09 0d | 09 09 09 09 09 09 52 47 |e.......|......RG|
|00002f10| 42 46 6f 72 65 43 6f 6c | 6f 72 28 20 26 62 6c 61 |BForeCol|or( &bla|
|00002f20| 63 6b 43 6f 6c 6f 72 20 | 29 3b 0d 09 09 09 09 09 |ckColor |);......|
|00002f30| 09 52 47 42 42 61 63 6b | 43 6f 6c 6f 72 28 20 26 |.RGBBack|Color( &|
|00002f40| 77 68 69 74 65 43 6f 6c | 6f 72 20 29 3b 0d 09 09 |whiteCol|or );...|
|00002f50| 09 09 09 09 0d 09 09 09 | 09 09 2f 2f 20 4a 75 73 |........|..// Jus|
|00002f60| 74 20 75 73 65 20 43 6f | 70 79 42 69 74 73 20 74 |t use Co|pyBits t|
|00002f70| 6f 20 63 6f 70 79 20 74 | 68 65 20 50 49 43 54 2e |o copy t|he PICT.|
|00002f80| 20 57 65 27 72 65 20 61 | 63 74 75 61 6c 6c 79 0d | We're a|ctually.|
|00002f90| 09 09 09 09 09 2f 2f 20 | 63 6f 70 79 69 6e 67 20 |.....// |copying |
|00002fa0| 66 72 6f 6d 20 6f 6e 65 | 20 70 6c 61 63 65 20 6f |from one| place o|
|00002fb0| 6e 20 74 68 65 20 64 69 | 61 6c 6f 67 20 74 6f 20 |n the di|alog to |
|00002fc0| 61 6e 6f 74 68 65 72 20 | 68 65 72 65 2e 0d 0d 09 |another |here....|
|00002fd0| 09 09 09 09 09 43 6f 70 | 79 42 69 74 73 28 20 26 |.....Cop|yBits( &|
|00002fe0| 57 49 4e 42 49 54 4d 41 | 50 28 20 6d 61 69 6e 44 |WINBITMA|P( mainD|
|00002ff0| 6c 67 20 29 2c 20 26 57 | 49 4e 42 49 54 4d 41 50 |lg ), &W|INBITMAP|
|00003000| 28 20 6d 61 69 6e 44 6c | 67 20 29 2c 0d 09 09 09 |( mainDl|g ),....|
|00003010| 09 09 09 09 26 70 69 63 | 74 31 52 65 63 74 2c 20 |....&pic|t1Rect, |
|00003020| 26 64 65 73 74 52 65 63 | 74 2c 20 73 72 63 43 6f |&destRec|t, srcCo|
|00003030| 70 79 2c 20 4e 55 4c 4c | 20 29 3b 0d 09 09 09 09 |py, NULL| );.....|
|00003040| 09 0d 09 09 09 09 09 2f | 2f 20 52 65 73 74 6f 72 |......./|/ Restor|
|00003050| 65 20 74 68 65 20 73 61 | 76 65 64 20 70 65 6e 20 |e the sa|ved pen |
|00003060| 73 74 61 74 65 20 61 6e | 64 20 63 6f 6c 6f 72 73 |state an|d colors|
|00003070| 0d 09 09 09 09 09 0d 09 | 09 09 09 09 09 53 65 74 |........|.....Set|
|00003080| 50 65 6e 53 74 61 74 65 | 28 20 26 73 61 76 65 64 |PenState|( &saved|
|00003090| 50 65 6e 20 29 3b 0d 09 | 09 09 09 09 09 52 47 42 |Pen );..|.....RGB|
|000030a0| 46 6f 72 65 43 6f 6c 6f | 72 28 20 26 73 61 76 65 |ForeColo|r( &save|
|000030b0| 64 46 6f 72 65 20 29 3b | 0d 09 09 09 09 09 09 52 |dFore );|.......R|
|000030c0| 47 42 42 61 63 6b 43 6f | 6c 6f 72 28 20 26 73 61 |GBBackCo|lor( &sa|
|000030d0| 76 65 64 42 61 63 6b 20 | 29 3b 0d 09 09 09 09 09 |vedBack |);......|
|000030e0| 09 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 0d |.......b|reak;...|
|000030f0| 09 09 09 09 63 61 73 65 | 20 6b 4d 61 69 6e 44 6c |....case| kMainDl|
|00003100| 67 46 61 64 65 4f 6e 65 | 3a 0d 09 09 09 09 0d 09 |gFadeOne|:.......|
|00003110| 09 09 09 09 2f 2f 20 53 | 65 6c 65 63 74 20 74 68 |....// S|elect th|
|00003120| 65 20 66 61 64 65 20 73 | 70 65 65 64 2e 0d 09 09 |e fade s|peed....|
|00003130| 09 09 09 0d 09 09 09 09 | 09 53 65 6c 65 63 74 44 |........|.SelectD|
|00003140| 69 61 6c 6f 67 49 74 65 | 6d 54 65 78 74 28 20 6d |ialogIte|mText( m|
|00003150| 61 69 6e 44 6c 67 2c 20 | 6b 4d 61 69 6e 44 6c 67 |ainDlg, |kMainDlg|
|00003160| 46 61 64 65 53 70 65 65 | 64 2c 20 30 2c 20 32 35 |FadeSpee|d, 0, 25|
|00003170| 35 20 29 3b 0d 09 09 09 | 09 09 0d 09 09 09 09 09 |5 );....|........|
|00003180| 2f 2f 20 47 65 74 20 74 | 68 65 20 66 61 64 65 20 |// Get t|he fade |
|00003190| 73 70 65 65 64 20 66 72 | 6f 6d 20 74 68 65 20 64 |speed fr|om the d|
|000031a0| 69 61 6c 6f 67 2e 0d 09 | 09 09 09 09 0d 09 09 09 |ialog...|........|
|000031b0| 09 09 66 61 64 65 53 70 | 65 65 64 20 3d 20 47 65 |..fadeSp|eed = Ge|
|000031c0| 74 44 69 61 6c 6f 67 4e | 75 6d 62 65 72 46 69 65 |tDialogN|umberFie|
|000031d0| 6c 64 28 20 6d 61 69 6e | 44 6c 67 2c 0d 09 09 09 |ld( main|Dlg,....|
|000031e0| 09 09 09 6b 4d 61 69 6e | 44 6c 67 46 61 64 65 53 |...kMain|DlgFadeS|
|000031f0| 70 65 65 64 20 29 3b 0d | 09 09 09 09 09 0d 09 09 |peed );.|........|
|00003200| 09 09 09 2f 2f 20 43 61 | 6c 6c 20 46 61 64 65 54 |...// Ca|ll FadeT|
|00003210| 6f 49 6d 61 67 65 20 74 | 6f 20 66 61 64 65 20 70 |oImage t|o fade p|
|00003220| 69 63 74 75 72 65 20 31 | 20 69 6e 74 6f 20 74 68 |icture 1| into th|
|00003230| 65 0d 09 09 09 09 09 2f | 2f 20 64 65 73 74 69 6e |e....../|/ destin|
|00003240| 61 74 69 6f 6e 20 61 72 | 65 61 2e 0d 09 09 09 09 |ation ar|ea......|
|00003250| 09 0d 09 09 09 09 09 46 | 61 64 65 54 6f 49 6d 61 |.......F|adeToIma|
|00003260| 67 65 28 20 70 69 63 74 | 31 47 57 6f 72 6c 64 2c |ge( pict|1GWorld,|
|00003270| 20 26 57 49 4e 50 4f 52 | 54 52 45 43 54 28 20 70 | &WINPOR|TRECT( p|
|00003280| 69 63 74 31 47 57 6f 72 | 6c 64 20 29 2c 0d 09 09 |ict1GWor|ld ),...|
|00003290| 09 09 09 09 6d 61 69 6e | 44 6c 67 2c 20 26 64 65 |....main|Dlg, &de|
|000032a0| 73 74 52 65 63 74 2c 20 | 66 61 64 65 53 70 65 65 |stRect, |fadeSpee|
|000032b0| 64 20 29 3b 0d 09 09 09 | 09 09 0d 09 09 09 09 09 |d );....|........|
|000032c0| 62 72 65 61 6b 3b 0d 09 | 0d 09 09 09 09 63 61 73 |break;..|.....cas|
|000032d0| 65 20 6b 4d 61 69 6e 44 | 6c 67 43 6f 70 79 54 77 |e kMainD|lgCopyTw|
|000032e0| 6f 3a 0d 09 09 09 09 0d | 09 09 09 09 09 2f 2f 20 |o:......|.....// |
|000032f0| 53 61 76 65 20 74 68 65 | 20 70 65 6e 20 73 74 61 |Save the| pen sta|
|00003300| 74 65 20 61 6e 64 20 66 | 6f 72 65 67 72 6f 75 6e |te and f|oregroun|
|00003310| 64 2f 62 61 63 6b 67 72 | 6f 75 6e 64 20 63 6f 6c |d/backgr|ound col|
|00003320| 6f 72 73 0d 09 09 09 09 | 09 0d 09 09 09 09 09 09 |ors.....|........|
|00003330| 47 65 74 50 65 6e 53 74 | 61 74 65 28 20 26 73 61 |GetPenSt|ate( &sa|
|00003340| 76 65 64 50 65 6e 20 29 | 3b 0d 09 09 09 09 09 09 |vedPen )|;.......|
|00003350| 47 65 74 46 6f 72 65 43 | 6f 6c 6f 72 28 20 26 73 |GetForeC|olor( &s|
|00003360| 61 76 65 64 46 6f 72 65 | 20 29 3b 0d 09 09 09 09 |avedFore| );.....|
|00003370| 09 09 47 65 74 42 61 63 | 6b 43 6f 6c 6f 72 28 20 |..GetBac|kColor( |
|00003380| 26 73 61 76 65 64 42 61 | 63 6b 20 29 3b 0d 09 09 |&savedBa|ck );...|
|00003390| 09 09 09 0d 09 09 09 09 | 09 2f 2f 20 53 65 74 20 |........|.// Set |
|000033a0| 66 6f 72 65 67 72 6f 75 | 6e 64 20 63 6f 6c 6f 72 |foregrou|nd color|
|000033b0| 20 74 6f 20 62 6c 61 63 | 6b 2c 20 62 61 63 6b 67 | to blac|k, backg|
|000033c0| 72 6f 75 6e 64 20 63 6f | 6c 6f 72 20 74 6f 20 77 |round co|lor to w|
|000033d0| 68 69 74 65 0d 09 09 09 | 09 09 0d 09 09 09 09 09 |hite....|........|
|000033e0| 09 52 47 42 46 6f 72 65 | 43 6f 6c 6f 72 28 20 26 |.RGBFore|Color( &|
|000033f0| 62 6c 61 63 6b 43 6f 6c | 6f 72 20 29 3b 0d 09 09 |blackCol|or );...|
|00003400| 09 09 09 09 52 47 42 42 | 61 63 6b 43 6f 6c 6f 72 |....RGBB|ackColor|
|00003410| 28 20 26 77 68 69 74 65 | 43 6f 6c 6f 72 20 29 3b |( &white|Color );|
|00003420| 0d 09 09 09 09 09 09 0d | 09 09 09 09 09 2f 2f 20 |........|.....// |
|00003430| 4a 75 73 74 20 75 73 65 | 20 43 6f 70 79 42 69 74 |Just use| CopyBit|
|00003440| 73 20 74 6f 20 63 6f 70 | 79 20 74 68 65 20 50 49 |s to cop|y the PI|
|00003450| 43 54 20 66 72 6f 6d 20 | 6f 6e 65 20 70 6c 61 63 |CT from |one plac|
|00003460| 65 20 69 6e 0d 09 09 09 | 09 09 2f 2f 20 74 68 65 |e in....|..// the|
|00003470| 20 77 69 6e 64 6f 77 20 | 74 6f 20 61 6e 6f 74 68 | window |to anoth|
|00003480| 65 72 2e 0d 09 09 09 09 | 09 0d 09 09 09 09 09 09 |er......|........|
|00003490| 43 6f 70 79 42 69 74 73 | 28 20 26 57 49 4e 42 49 |CopyBits|( &WINBI|
|000034a0| 54 4d 41 50 28 20 6d 61 | 69 6e 44 6c 67 20 29 2c |TMAP( ma|inDlg ),|
|000034b0| 20 26 57 49 4e 42 49 54 | 4d 41 50 28 20 6d 61 69 | &WINBIT|MAP( mai|
|000034c0| 6e 44 6c 67 20 29 2c 0d | 09 09 09 09 09 09 09 26 |nDlg ),.|.......&|
|000034d0| 70 69 63 74 32 52 65 63 | 74 2c 20 26 64 65 73 74 |pict2Rec|t, &dest|
|000034e0| 52 65 63 74 2c 20 73 72 | 63 43 6f 70 79 2c 20 4e |Rect, sr|cCopy, N|
|000034f0| 55 4c 4c 20 29 3b 0d 09 | 09 09 09 09 0d 09 09 09 |ULL );..|........|
|00003500| 09 09 2f 2f 20 52 65 73 | 74 6f 72 65 20 74 68 65 |..// Res|tore the|
|00003510| 20 73 61 76 65 64 20 70 | 65 6e 20 73 74 61 74 65 | saved p|en state|
|00003520| 20 61 6e 64 20 63 6f 6c | 6f 72 73 0d 09 09 09 09 | and col|ors.....|
|00003530| 09 0d 09 09 09 09 09 09 | 53 65 74 50 65 6e 53 74 |........|SetPenSt|
|00003540| 61 74 65 28 20 26 73 61 | 76 65 64 50 65 6e 20 29 |ate( &sa|vedPen )|
|00003550| 3b 0d 09 09 09 09 09 09 | 52 47 42 46 6f 72 65 43 |;.......|RGBForeC|
|00003560| 6f 6c 6f 72 28 20 26 73 | 61 76 65 64 46 6f 72 65 |olor( &s|avedFore|
|00003570| 20 29 3b 0d 09 09 09 09 | 09 09 52 47 42 42 61 63 | );.....|..RGBBac|
|00003580| 6b 43 6f 6c 6f 72 28 20 | 26 73 61 76 65 64 42 61 |kColor( |&savedBa|
|00003590| 63 6b 20 29 3b 0d 09 09 | 09 09 09 09 0d 09 09 09 |ck );...|........|
|000035a0| 09 09 62 72 65 61 6b 3b | 0d 09 0d 09 09 09 09 63 |..break;|.......c|
|000035b0| 61 73 65 20 6b 4d 61 69 | 6e 44 6c 67 46 61 64 65 |ase kMai|nDlgFade|
|000035c0| 54 77 6f 3a 0d 09 09 09 | 09 0d 09 09 09 09 09 2f |Two:....|......./|
|000035d0| 2f 20 53 65 6c 65 63 74 | 20 74 68 65 20 66 61 64 |/ Select| the fad|
|000035e0| 65 20 73 70 65 65 64 2e | 0d 09 09 09 09 09 0d 09 |e speed.|........|
|000035f0| 09 09 09 09 53 65 6c 65 | 63 74 44 69 61 6c 6f 67 |....Sele|ctDialog|
|00003600| 49 74 65 6d 54 65 78 74 | 28 20 6d 61 69 6e 44 6c |ItemText|( mainDl|
|00003610| 67 2c 20 6b 4d 61 69 6e | 44 6c 67 46 61 64 65 53 |g, kMain|DlgFadeS|
|00003620| 70 65 65 64 2c 20 30 2c | 20 32 35 35 20 29 3b 0d |peed, 0,| 255 );.|
|00003630| 09 09 09 09 09 0d 09 09 | 09 09 09 2f 2f 20 47 65 |........|...// Ge|
|00003640| 74 20 74 68 65 20 66 61 | 64 65 20 73 70 65 65 64 |t the fa|de speed|
|00003650| 20 66 72 6f 6d 20 74 68 | 65 20 64 69 61 6c 6f 67 | from th|e dialog|
|00003660| 2e 0d 09 09 09 09 09 0d | 09 09 09 09 09 66 61 64 |........|.....fad|
|00003670| 65 53 70 65 65 64 20 3d | 20 47 65 74 44 69 61 6c |eSpeed =| GetDial|
|00003680| 6f 67 4e 75 6d 62 65 72 | 46 69 65 6c 64 28 20 6d |ogNumber|Field( m|
|00003690| 61 69 6e 44 6c 67 2c 0d | 09 09 09 09 09 09 6b 4d |ainDlg,.|......kM|
|000036a0| 61 69 6e 44 6c 67 46 61 | 64 65 53 70 65 65 64 20 |ainDlgFa|deSpeed |
|000036b0| 29 3b 0d 09 09 09 09 09 | 0d 09 09 09 09 09 2f 2f |);......|......//|
|000036c0| 20 43 61 6c 6c 20 46 61 | 64 65 54 6f 49 6d 61 67 | Call Fa|deToImag|
|000036d0| 65 20 74 6f 20 66 61 64 | 65 20 70 69 63 74 75 72 |e to fad|e pictur|
|000036e0| 65 20 32 20 69 6e 74 6f | 20 74 68 65 0d 09 09 09 |e 2 into| the....|
|000036f0| 09 09 2f 2f 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |..// des|tination|
|00003700| 20 61 72 65 61 2e 0d 09 | 09 09 09 09 0d 09 09 09 | area...|........|
|00003710| 09 09 46 61 64 65 54 6f | 49 6d 61 67 65 28 20 70 |..FadeTo|Image( p|
|00003720| 69 63 74 32 47 57 6f 72 | 6c 64 2c 20 26 57 49 4e |ict2GWor|ld, &WIN|
|00003730| 50 4f 52 54 52 45 43 54 | 28 20 70 69 63 74 32 47 |PORTRECT|( pict2G|
|00003740| 57 6f 72 6c 64 20 29 2c | 0d 09 09 09 09 09 09 6d |World ),|.......m|
|00003750| 61 69 6e 44 6c 67 2c 20 | 26 64 65 73 74 52 65 63 |ainDlg, |&destRec|
|00003760| 74 2c 20 66 61 64 65 53 | 70 65 65 64 20 29 3b 0d |t, fadeS|peed );.|
|00003770| 09 09 09 09 09 09 09 09 | 09 09 0d 09 09 09 09 09 |........|........|
|00003780| 62 72 65 61 6b 3b 0d 09 | 0d 09 09 09 09 63 61 73 |break;..|.....cas|
|00003790| 65 20 6b 4d 61 69 6e 44 | 6c 67 45 72 61 73 65 3a |e kMainD|lgErase:|
|000037a0| 0d 09 09 09 09 0d 09 09 | 09 09 09 2f 2f 20 45 72 |........|...// Er|
|000037b0| 61 73 65 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 |ase the |destinat|
|000037c0| 69 6f 6e 20 61 72 65 61 | 2e 0d 09 09 09 09 09 0d |ion area|........|
|000037d0| 09 09 09 09 09 45 72 61 | 73 65 52 65 63 74 28 20 |.....Era|seRect( |
|000037e0| 26 64 65 73 74 52 65 63 | 74 20 29 3b 0d 09 09 09 |&destRec|t );....|
|000037f0| 09 09 0d 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |........|break;..|
|00003800| 0d 09 09 09 09 63 61 73 | 65 20 6b 4d 61 69 6e 44 |.....cas|e kMainD|
|00003810| 6c 67 46 61 64 65 54 6f | 42 6c 61 63 6b 3a 0d 09 |lgFadeTo|Black:..|
|00003820| 09 09 09 09 0d 09 09 09 | 09 09 2f 2f 20 53 65 6c |........|..// Sel|
|00003830| 65 63 74 20 74 68 65 20 | 66 61 64 65 20 73 70 65 |ect the |fade spe|
|00003840| 65 64 2e 0d 09 09 09 09 | 09 0d 09 09 09 09 09 53 |ed......|.......S|
|00003850| 65 6c 65 63 74 44 69 61 | 6c 6f 67 49 74 65 6d 54 |electDia|logItemT|
|00003860| 65 78 74 28 20 6d 61 69 | 6e 44 6c 67 2c 20 6b 4d |ext( mai|nDlg, kM|
|00003870| 61 69 6e 44 6c 67 46 61 | 64 65 53 70 65 65 64 2c |ainDlgFa|deSpeed,|
|00003880| 20 30 2c 20 32 35 35 20 | 29 3b 0d 09 09 09 09 09 | 0, 255 |);......|
|00003890| 0d 09 09 09 09 09 2f 2f | 20 47 65 74 20 74 68 65 |......//| Get the|
|000038a0| 20 66 61 64 65 20 73 70 | 65 65 64 20 66 72 6f 6d | fade sp|eed from|
|000038b0| 20 74 68 65 20 64 69 61 | 6c 6f 67 2e 0d 09 09 09 | the dia|log.....|
|000038c0| 09 09 0d 09 09 09 09 09 | 66 61 64 65 53 70 65 65 |........|fadeSpee|
|000038d0| 64 20 3d 20 47 65 74 44 | 69 61 6c 6f 67 4e 75 6d |d = GetD|ialogNum|
|000038e0| 62 65 72 46 69 65 6c 64 | 28 20 6d 61 69 6e 44 6c |berField|( mainDl|
|000038f0| 67 2c 0d 09 09 09 09 09 | 09 6b 4d 61 69 6e 44 6c |g,......|.kMainDl|
|00003900| 67 46 61 64 65 53 70 65 | 65 64 20 29 3b 0d 09 09 |gFadeSpe|ed );...|
|00003910| 09 09 09 0d 09 09 09 09 | 09 2f 2f 20 41 6e 64 20 |........|.// And |
|00003920| 63 61 6c 6c 20 46 61 64 | 65 54 6f 42 6c 61 63 6b |call Fad|eToBlack|
|00003930| 20 74 6f 20 66 61 64 65 | 20 74 68 65 20 64 65 73 | to fade| the des|
|00003940| 74 69 6e 61 74 69 6f 6e | 20 72 65 63 74 61 6e 67 |tination| rectang|
|00003950| 6c 65 2e 0d 09 09 09 09 | 09 0d 09 09 09 09 09 46 |le......|.......F|
|00003960| 61 64 65 54 6f 42 6c 61 | 63 6b 28 20 6d 61 69 6e |adeToBla|ck( main|
|00003970| 44 6c 67 2c 20 26 64 65 | 73 74 52 65 63 74 2c 20 |Dlg, &de|stRect, |
|00003980| 66 61 64 65 53 70 65 65 | 64 20 29 3b 0d 0d 09 09 |fadeSpee|d );....|
|00003990| 09 09 09 62 72 65 61 6b | 3b 0d 09 0d 09 09 09 09 |...break|;.......|
|000039a0| 63 61 73 65 20 6b 4d 61 | 69 6e 44 6c 67 51 75 69 |case kMa|inDlgQui|
|000039b0| 74 3a 0d 09 09 09 09 0d | 09 09 09 09 09 62 72 65 |t:......|.....bre|
|000039c0| 61 6b 3b 0d 09 09 09 7d | 0d 09 09 7d 0d 09 7d 0d |ak;....}|...}..}.|
|000039d0| 7d 0d 0d 76 6f 69 64 20 | 49 6e 69 74 54 6f 6f 6c |}..void |InitTool|
|000039e0| 62 6f 78 28 20 76 6f 69 | 64 20 29 0d 7b 0d 09 2f |box( voi|d ).{../|
|000039f0| 2a 20 49 6e 69 74 69 61 | 6c 69 7a 65 20 74 68 65 |* Initia|lize the|
|00003a00| 20 4d 61 63 20 54 6f 6f | 6c 62 6f 78 20 4d 61 6e | Mac Too|lbox Man|
|00003a10| 61 67 65 72 73 20 2a 2f | 0d 09 0d 09 49 6e 69 74 |agers */|....Init|
|00003a20| 47 72 61 66 28 28 50 74 | 72 29 20 26 71 64 2e 74 |Graf((Pt|r) &qd.t|
|00003a30| 68 65 50 6f 72 74 29 3b | 0d 09 49 6e 69 74 46 6f |hePort);|..InitFo|
|00003a40| 6e 74 73 28 29 3b 0d 09 | 49 6e 69 74 57 69 6e 64 |nts();..|InitWind|
|00003a50| 6f 77 73 28 29 3b 0d 09 | 49 6e 69 74 4d 65 6e 75 |ows();..|InitMenu|
|00003a60| 73 28 29 3b 0d 09 46 6c | 75 73 68 45 76 65 6e 74 |s();..Fl|ushEvent|
|00003a70| 73 28 65 76 65 72 79 45 | 76 65 6e 74 2c 30 29 3b |s(everyE|vent,0);|
|00003a80| 0d 09 54 45 49 6e 69 74 | 28 29 3b 0d 09 49 6e 69 |..TEInit|();..Ini|
|00003a90| 74 44 69 61 6c 6f 67 73 | 28 30 4c 29 3b 0d 09 49 |tDialogs|(0L);..I|
|00003aa0| 6e 69 74 43 75 72 73 6f | 72 28 29 3b 0d 7d 0d 0d |nitCurso|r();.}..|
|00003ab0| 2f 2f 20 47 65 74 53 79 | 73 56 65 72 73 69 6f 6e |// GetSy|sVersion|
|00003ac0| 20 72 65 74 75 72 6e 73 | 20 37 20 69 66 20 74 68 | returns| 7 if th|
|00003ad0| 65 20 73 79 73 74 65 6d | 20 76 65 72 73 69 6f 6e |e system| version|
|00003ae0| 20 69 73 20 37 20 6f 72 | 20 6c 61 74 65 72 2c 0d | is 7 or| later,.|
|00003af0| 2f 2f 20 36 20 69 66 20 | 69 74 27 73 20 36 20 6f |// 6 if |it's 6 o|
|00003b00| 72 20 6c 61 74 65 72 20 | 28 62 75 74 20 6e 6f 74 |r later |(but not|
|00003b10| 20 37 29 2c 20 61 6e 64 | 20 30 20 69 66 20 65 61 | 7), and| 0 if ea|
|00003b20| 72 6c 69 65 72 20 74 68 | 61 6e 20 36 2e 0d 2f 2f |rlier th|an 6..//|
|00003b30| 0d 73 68 6f 72 74 09 47 | 65 74 53 79 73 56 65 72 |.short.G|etSysVer|
|00003b40| 73 69 6f 6e 28 20 76 6f | 69 64 20 29 0d 7b 0d 09 |sion( vo|id ).{..|
|00003b50| 53 79 73 45 6e 76 52 65 | 63 09 09 65 6e 76 3b 0d |SysEnvRe|c..env;.|
|00003b60| 09 0d 09 53 79 73 45 6e | 76 69 72 6f 6e 73 28 20 |...SysEn|virons( |
|00003b70| 32 2c 20 26 65 6e 76 20 | 29 3b 0d 09 0d 09 69 66 |2, &env |);....if|
|00003b80| 20 28 20 65 6e 76 2e 73 | 79 73 74 65 6d 56 65 72 | ( env.s|ystemVer|
|00003b90| 73 69 6f 6e 20 3e 3d 20 | 30 78 30 37 30 30 20 29 |sion >= |0x0700 )|
|00003ba0| 0d 09 09 72 65 74 75 72 | 6e 20 37 3b 0d 09 65 6c |...retur|n 7;..el|
|00003bb0| 73 65 20 69 66 20 28 20 | 65 6e 76 2e 73 79 73 74 |se if ( |env.syst|
|00003bc0| 65 6d 56 65 72 73 69 6f | 6e 20 3e 3d 20 30 78 30 |emVersio|n >= 0x0|
|00003bd0| 36 30 30 20 29 0d 09 09 | 72 65 74 75 72 6e 20 36 |600 )...|return 6|
|00003be0| 3b 0d 09 65 6c 73 65 0d | 09 09 72 65 74 75 72 6e |;..else.|..return|
|00003bf0| 20 30 3b 0d 7d 0d 0d 2f | 2f 20 48 61 73 43 6f 6c | 0;.}../|/ HasCol|
|00003c00| 6f 72 51 75 69 63 6b 44 | 72 61 77 20 72 65 74 75 |orQuickD|raw retu|
|00003c10| 72 6e 73 20 74 72 75 65 | 20 69 66 20 74 68 65 20 |rns true| if the |
|00003c20| 4d 61 63 20 68 61 73 20 | 63 6f 6c 6f 72 0d 2f 2f |Mac has |color.//|
|00003c30| 20 51 75 69 63 6b 44 72 | 61 77 2e 0d 2f 2f 0d 42 | QuickDr|aw..//.B|
|00003c40| 6f 6f 6c 65 61 6e 20 48 | 61 73 43 6f 6c 6f 72 51 |oolean H|asColorQ|
|00003c50| 75 69 63 6b 44 72 61 77 | 28 20 76 6f 69 64 20 29 |uickDraw|( void )|
|00003c60| 0d 7b 0d 09 53 79 73 45 | 6e 76 52 65 63 09 09 65 |.{..SysE|nvRec..e|
|00003c70| 6e 76 3b 0d 09 0d 09 53 | 79 73 45 6e 76 69 72 6f |nv;....S|ysEnviro|
|00003c80| 6e 73 28 20 32 2c 20 26 | 65 6e 76 20 29 3b 0d 09 |ns( 2, &|env );..|
|00003c90| 0d 09 72 65 74 75 72 6e | 20 65 6e 76 2e 68 61 73 |..return| env.has|
|00003ca0| 43 6f 6c 6f 72 51 44 3b | 0d 7d 0d 0d 2f 2f 20 47 |ColorQD;|.}..// G|
|00003cb0| 65 74 49 74 65 6d 48 61 | 6e 64 6c 65 20 72 65 74 |etItemHa|ndle ret|
|00003cc0| 75 72 6e 73 20 61 20 68 | 61 6e 64 6c 65 20 74 6f |urns a h|andle to|
|00003cd0| 20 61 20 64 69 61 6c 6f | 67 20 69 74 65 6d 20 67 | a dialo|g item g|
|00003ce0| 69 76 65 6e 20 74 68 65 | 0d 2f 2f 20 64 69 61 6c |iven the|.// dial|
|00003cf0| 6f 67 20 70 74 72 20 61 | 6e 64 20 74 68 65 20 69 |og ptr a|nd the i|
|00003d00| 74 65 6d 20 6e 75 6d 62 | 65 72 2e 0d 2f 2f 0d 48 |tem numb|er..//.H|
|00003d10| 61 6e 64 6c 65 20 47 65 | 74 49 74 65 6d 48 61 6e |andle Ge|tItemHan|
|00003d20| 64 6c 65 28 20 44 69 61 | 6c 6f 67 50 74 72 20 64 |dle( Dia|logPtr d|
|00003d30| 6c 67 2c 20 73 68 6f 72 | 74 20 69 74 65 6d 4e 6f |lg, shor|t itemNo|
|00003d40| 20 29 0d 7b 0d 09 73 68 | 6f 72 74 09 09 09 69 74 | ).{..sh|ort...it|
|00003d50| 65 6d 54 79 70 65 3b 0d | 09 48 61 6e 64 6c 65 09 |emType;.|.Handle.|
|00003d60| 09 09 69 74 65 6d 48 61 | 6e 64 6c 65 3b 0d 09 52 |..itemHa|ndle;..R|
|00003d70| 65 63 74 09 09 09 69 74 | 65 6d 52 65 63 74 3b 0d |ect...it|emRect;.|
|00003d80| 09 0d 09 47 65 74 44 69 | 61 6c 6f 67 49 74 65 6d |...GetDi|alogItem|
|00003d90| 28 20 64 6c 67 2c 20 69 | 74 65 6d 4e 6f 2c 20 26 |( dlg, i|temNo, &|
|00003da0| 69 74 65 6d 54 79 70 65 | 2c 20 26 69 74 65 6d 48 |itemType|, &itemH|
|00003db0| 61 6e 64 6c 65 2c 20 26 | 69 74 65 6d 52 65 63 74 |andle, &|itemRect|
|00003dc0| 20 29 3b 0d 09 0d 09 72 | 65 74 75 72 6e 20 69 74 | );....r|eturn it|
|00003dd0| 65 6d 48 61 6e 64 6c 65 | 3b 0d 7d 0d 0d 2f 2f 20 |emHandle|;.}..// |
|00003de0| 47 65 74 49 74 65 6d 52 | 65 63 74 20 72 65 74 75 |GetItemR|ect retu|
|00003df0| 72 6e 73 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c |rns the |rectangl|
|00003e00| 65 20 6f 66 20 61 20 64 | 69 61 6c 6f 67 20 69 74 |e of a d|ialog it|
|00003e10| 65 6d 20 28 69 6e 20 6c | 6f 63 61 6c 0d 2f 2f 20 |em (in l|ocal.// |
|00003e20| 63 6f 6f 72 64 69 6e 61 | 74 65 73 29 20 67 69 76 |coordina|tes) giv|
|00003e30| 65 6e 20 74 68 65 20 64 | 69 61 6c 6f 67 20 70 74 |en the d|ialog pt|
|00003e40| 72 2c 20 61 6e 64 20 74 | 68 65 20 69 74 65 6d 20 |r, and t|he item |
|00003e50| 6e 75 6d 62 65 72 2e 0d | 2f 2f 0d 76 6f 69 64 09 |number..|//.void.|
|00003e60| 47 65 74 49 74 65 6d 52 | 65 63 74 28 20 44 69 61 |GetItemR|ect( Dia|
|00003e70| 6c 6f 67 50 74 72 20 64 | 6c 67 2c 20 73 68 6f 72 |logPtr d|lg, shor|
|00003e80| 74 20 69 74 65 6d 4e 6f | 2c 20 52 65 63 74 20 2a |t itemNo|, Rect *|
|00003e90| 61 52 65 63 74 20 29 0d | 7b 0d 09 73 68 6f 72 74 |aRect ).|{..short|
|00003ea0| 09 09 09 69 74 65 6d 54 | 79 70 65 3b 0d 09 48 61 |...itemT|ype;..Ha|
|00003eb0| 6e 64 6c 65 09 09 09 69 | 74 65 6d 48 61 6e 64 6c |ndle...i|temHandl|
|00003ec0| 65 3b 0d 09 52 65 63 74 | 09 09 09 69 74 65 6d 52 |e;..Rect|...itemR|
|00003ed0| 65 63 74 3b 0d 09 0d 09 | 47 65 74 44 69 61 6c 6f |ect;....|GetDialo|
|00003ee0| 67 49 74 65 6d 28 20 64 | 6c 67 2c 20 69 74 65 6d |gItem( d|lg, item|
|00003ef0| 4e 6f 2c 20 26 69 74 65 | 6d 54 79 70 65 2c 20 26 |No, &ite|mType, &|
|00003f00| 69 74 65 6d 48 61 6e 64 | 6c 65 2c 20 26 69 74 65 |itemHand|le, &ite|
|00003f10| 6d 52 65 63 74 20 29 3b | 0d 09 0d 09 28 2a 61 52 |mRect );|....(*aR|
|00003f20| 65 63 74 29 20 3d 20 69 | 74 65 6d 52 65 63 74 3b |ect) = i|temRect;|
|00003f30| 0d 7d 0d 0d 2f 2f 20 47 | 65 74 44 69 61 6c 6f 67 |.}..// G|etDialog|
|00003f40| 4e 75 6d 62 65 72 46 69 | 65 6c 64 20 67 65 74 73 |NumberFi|eld gets|
|00003f50| 20 74 68 65 20 74 65 78 | 74 20 69 6e 20 74 68 65 | the tex|t in the|
|00003f60| 20 66 69 65 6c 64 20 73 | 70 65 63 69 66 69 65 64 | field s|pecified|
|00003f70| 20 62 79 20 69 74 65 6d | 4e 6f 0d 2f 2f 20 69 6e | by item|No.// in|
|00003f80| 20 74 68 65 20 64 69 61 | 6c 6f 67 20 73 70 65 63 | the dia|log spec|
|00003f90| 69 66 69 65 64 20 62 79 | 20 64 6c 67 20 61 6e 64 |ified by| dlg and|
|00003fa0| 20 63 6f 6e 76 65 72 74 | 73 20 69 74 20 69 6e 74 | convert|s it int|
|00003fb0| 6f 20 61 20 6e 75 6d 62 | 65 72 2e 20 54 68 65 0d |o a numb|er. The.|
|00003fc0| 2f 2f 20 6e 75 6d 62 65 | 72 20 69 73 20 72 65 74 |// numbe|r is ret|
|00003fd0| 75 72 6e 65 64 20 61 73 | 20 74 68 65 20 66 75 6e |urned as| the fun|
|00003fe0| 63 74 69 6f 6e 20 72 65 | 73 75 6c 74 2e 0d 2f 2f |ction re|sult..//|
|00003ff0| 0d 6c 6f 6e 67 09 47 65 | 74 44 69 61 6c 6f 67 4e |.long.Ge|tDialogN|
|00004000| 75 6d 62 65 72 46 69 65 | 6c 64 28 20 44 69 61 6c |umberFie|ld( Dial|
|00004010| 6f 67 50 74 72 20 64 6c | 67 2c 20 73 68 6f 72 74 |ogPtr dl|g, short|
|00004020| 20 69 74 65 6d 4e 6f 20 | 29 0d 7b 0d 09 53 74 72 | itemNo |).{..Str|
|00004030| 32 35 35 09 09 74 68 65 | 53 74 72 3b 0d 09 6c 6f |255..the|Str;..lo|
|00004040| 6e 67 09 09 74 68 65 4e | 75 6d 3b 0d 09 0d 09 47 |ng..theN|um;....G|
|00004050| 65 74 44 69 61 6c 6f 67 | 49 74 65 6d 54 65 78 74 |etDialog|ItemText|
|00004060| 28 20 47 65 74 49 74 65 | 6d 48 61 6e 64 6c 65 28 |( GetIte|mHandle(|
|00004070| 20 64 6c 67 2c 20 69 74 | 65 6d 4e 6f 20 29 2c 20 | dlg, it|emNo ), |
|00004080| 74 68 65 53 74 72 20 29 | 3b 0d 09 53 74 72 69 6e |theStr )|;..Strin|
|00004090| 67 54 6f 4e 75 6d 28 20 | 74 68 65 53 74 72 2c 20 |gToNum( |theStr, |
|000040a0| 26 74 68 65 4e 75 6d 20 | 29 3b 0d 09 72 65 74 75 |&theNum |);..retu|
|000040b0| 72 6e 20 74 68 65 4e 75 | 6d 3b 0d 7d 0d 0d 0d 76 |rn theNu|m;.}...v|
|000040c0| 6f 69 64 09 44 6f 41 6c | 65 72 74 28 20 73 68 6f |oid.DoAl|ert( sho|
|000040d0| 72 74 20 64 69 61 6c 6f | 67 49 44 2c 20 42 6f 6f |rt dialo|gID, Boo|
|000040e0| 6c 65 61 6e 20 70 6c 61 | 79 41 6c 65 72 74 20 29 |lean pla|yAlert )|
|000040f0| 0d 7b 0d 09 2f 2a 09 54 | 68 69 73 20 72 6f 75 74 |.{../*.T|his rout|
|00004100| 69 6e 65 20 64 69 73 70 | 6c 61 79 73 20 61 6e 20 |ine disp|lays an |
|00004110| 61 6c 65 72 74 20 77 68 | 6f 73 65 20 72 65 73 6f |alert wh|ose reso|
|00004120| 75 72 63 65 20 49 44 20 | 6e 75 6d 62 65 72 20 69 |urce ID |number i|
|00004130| 73 20 73 70 65 63 69 66 | 69 65 64 0d 09 20 2a 09 |s specif|ied.. *.|
|00004140| 69 6e 20 74 68 65 20 70 | 61 72 61 6d 65 74 65 72 |in the p|arameter|
|00004150| 20 64 69 61 6c 6f 67 49 | 44 2e 20 20 54 68 65 20 | dialogI|D. The |
|00004160| 64 69 61 6c 6f 67 20 73 | 70 65 63 69 66 69 65 64 |dialog s|pecified|
|00004170| 20 69 73 20 65 78 70 65 | 63 74 65 64 20 74 6f 20 | is expe|cted to |
|00004180| 68 61 76 65 0d 09 20 2a | 09 61 74 20 6c 65 61 73 |have.. *|.at leas|
|00004190| 74 20 6f 6e 65 20 62 75 | 74 74 6f 6e 20 28 75 73 |t one bu|tton (us|
|000041a0| 75 61 6c 6c 79 20 6c 61 | 62 65 6c 65 64 20 22 4f |ually la|beled "O|
|000041b0| 4b 22 29 20 77 68 69 63 | 68 20 77 69 6c 6c 20 62 |K") whic|h will b|
|000041c0| 65 20 74 68 65 20 64 65 | 66 61 75 6c 74 0d 09 20 |e the de|fault.. |
|000041d0| 2a 09 62 75 74 74 6f 6e | 20 61 6e 64 20 68 61 76 |*.button| and hav|
|000041e0| 65 20 61 6e 20 49 44 20 | 69 66 20 31 2e 20 20 57 |e an ID |if 1. W|
|000041f0| 68 65 6e 20 74 68 65 20 | 75 73 65 72 20 70 72 65 |hen the |user pre|
|00004200| 73 73 65 73 20 74 68 69 | 73 20 62 75 74 74 6f 6e |sses thi|s button|
|00004210| 2c 20 74 68 65 0d 09 20 | 2a 09 61 6c 65 72 74 20 |, the.. |*.alert |
|00004220| 77 69 6c 6c 20 62 65 20 | 64 69 73 6d 69 73 73 65 |will be |dismisse|
|00004230| 64 2e 0d 09 20 2a 2f 0d | 09 0d 09 57 69 6e 64 6f |d... */.|...Windo|
|00004240| 77 50 74 72 09 09 63 75 | 72 72 65 6e 74 50 6f 72 |wPtr..cu|rrentPor|
|00004250| 74 3b 09 2f 2a 20 73 74 | 6f 72 65 20 74 68 65 20 |t;./* st|ore the |
|00004260| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 20 68 65 72 |current |port her|
|00004270| 65 20 2a 2f 0d 09 44 69 | 61 6c 6f 67 50 74 72 09 |e */..Di|alogPtr.|
|00004280| 09 74 68 65 44 6c 67 3b | 09 09 09 2f 2a 20 74 6f |.theDlg;|.../* to|
|00004290| 20 73 74 6f 72 65 20 6f | 75 72 20 64 69 61 6c 6f | store o|ur dialo|
|000042a0| 67 20 69 6e 20 2a 2f 0d | 09 0d 09 73 68 6f 72 74 |g in */.|...short|
|000042b0| 09 09 69 74 65 6d 54 79 | 70 65 3b 09 09 2f 2a 20 |..itemTy|pe;../* |
|000042c0| 74 68 65 73 65 20 33 20 | 6c 6f 63 61 6c 20 76 61 |these 3 |local va|
|000042d0| 72 69 61 62 6c 65 73 20 | 61 72 65 20 75 73 65 64 |riables |are used|
|000042e0| 20 74 6f 20 2a 2f 0d 09 | 48 61 6e 64 6c 65 09 09 | to */..|Handle..|
|000042f0| 69 74 65 6d 48 61 6e 64 | 6c 65 3b 09 09 2f 2a 20 |itemHand|le;../* |
|00004300| 6d 61 6e 69 70 75 6c 61 | 74 65 20 69 74 65 6d 73 |manipula|te items|
|00004310| 20 69 6e 20 74 68 65 20 | 64 69 61 6c 6f 67 2e 20 | in the |dialog. |
|00004320| 20 20 20 20 2a 2f 0d 09 | 52 65 63 74 09 09 69 74 | */..|Rect..it|
|00004330| 65 6d 52 65 63 74 3b 0d | 0d 09 73 68 6f 72 74 09 |emRect;.|..short.|
|00004340| 09 69 74 65 6d 48 69 74 | 3b 09 09 2f 2a 20 75 73 |.itemHit|;../* us|
|00004350| 65 20 77 69 74 68 20 4d | 6f 64 61 6c 44 69 61 6c |e with M|odalDial|
|00004360| 6f 67 20 2a 2f 0d 0d 09 | 2f 2f 20 53 61 76 65 20 |og */...|// Save |
|00004370| 74 68 65 20 63 75 72 72 | 65 6e 74 20 67 72 61 66 |the curr|ent graf|
|00004380| 50 6f 72 74 0d 09 0d 09 | 09 47 65 74 50 6f 72 74 |Port....|.GetPort|
|00004390| 28 20 26 63 75 72 72 65 | 6e 74 50 6f 72 74 20 29 |( &curre|ntPort )|
|000043a0| 3b 0d 09 0d 09 2f 2f 20 | 4e 6f 77 2c 20 6c 6f 61 |;....// |Now, loa|
|000043b0| 64 20 6f 75 72 20 64 69 | 61 6c 6f 67 20 72 65 73 |d our di|alog res|
|000043c0| 6f 75 72 63 65 20 61 6e | 64 20 64 69 73 70 6c 61 |ource an|d displa|
|000043d0| 79 20 69 74 2e 0d 09 0d | 09 09 2f 2f 20 6c 6f 61 |y it....|..// loa|
|000043e0| 64 20 74 68 65 20 64 69 | 61 6c 6f 67 20 72 65 73 |d the di|alog res|
|000043f0| 6f 75 72 63 65 0d 09 09 | 0d 09 09 09 74 68 65 44 |ource...|....theD|
|00004400| 6c 67 20 3d 20 47 65 74 | 4e 65 77 44 69 61 6c 6f |lg = Get|NewDialo|
|00004410| 67 28 20 64 69 61 6c 6f | 67 49 44 2c 20 4e 55 4c |g( dialo|gID, NUL|
|00004420| 4c 2c 20 28 57 69 6e 64 | 6f 77 50 74 72 29 2d 31 |L, (Wind|owPtr)-1|
|00004430| 4c 20 29 3b 0d 09 09 0d | 09 09 2f 2f 20 6d 61 6b |L );....|..// mak|
|00004440| 65 20 74 68 65 20 64 69 | 61 6c 6f 67 20 74 68 65 |e the di|alog the|
|00004450| 20 63 75 72 72 65 6e 74 | 20 70 6f 72 74 0d 09 09 | current| port...|
|00004460| 0d 09 09 09 53 65 74 50 | 6f 72 74 28 20 74 68 65 |....SetP|ort( the|
|00004470| 44 6c 67 20 29 3b 0d 09 | 09 0d 09 09 2f 2f 20 69 |Dlg );..|....// i|
|00004480| 66 20 74 68 65 20 70 61 | 72 61 6d 65 74 65 72 20 |f the pa|rameter |
|00004490| 73 70 65 63 69 66 69 65 | 73 2c 20 64 6f 20 61 20 |specifie|s, do a |
|000044a0| 73 79 73 74 65 6d 20 62 | 65 65 70 0d 09 09 0d 09 |system b|eep.....|
|000044b0| 09 09 69 66 20 28 20 70 | 6c 61 79 41 6c 65 72 74 |..if ( p|layAlert|
|000044c0| 20 29 0d 09 09 09 09 53 | 79 73 42 65 65 70 28 20 | ).....S|ysBeep( |
|000044d0| 33 20 29 3b 0d 09 09 0d | 09 09 2f 2f 20 6e 6f 77 |3 );....|..// now|
|000044e0| 20 6d 61 6b 65 20 73 75 | 72 65 20 74 68 65 20 64 | make su|re the d|
|000044f0| 69 61 6c 6f 67 20 69 73 | 20 76 69 73 69 62 6c 65 |ialog is| visible|
|00004500| 0d 09 09 0d 09 09 09 53 | 68 6f 77 57 69 6e 64 6f |.......S|howWindo|
|00004510| 77 28 20 74 68 65 44 6c | 67 20 29 3b 0d 09 0d 09 |w( theDl|g );....|
|00004520| 20 2f 2a 09 47 65 74 20 | 74 68 65 20 4f 4b 20 62 | /*.Get |the OK b|
|00004530| 75 74 74 6f 6e 20 69 74 | 65 6d 20 61 6e 64 20 64 |utton it|em and d|
|00004540| 72 61 77 20 61 20 62 6f | 6c 64 20 62 6f 72 64 65 |raw a bo|ld borde|
|00004550| 72 20 61 72 6f 75 6e 64 | 20 69 74 20 74 6f 20 73 |r around| it to s|
|00004560| 68 6f 77 20 74 68 61 74 | 0d 09 20 20 2a 09 69 74 |how that|.. *.it|
|00004570| 27 73 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 62 |'s the d|efault b|
|00004580| 75 74 74 6f 6e 2e 0d 09 | 20 20 2a 2f 0d 09 20 0d |utton...| */.. .|
|00004590| 09 20 09 47 65 74 44 49 | 74 65 6d 28 20 74 68 65 |. .GetDI|tem( the|
|000045a0| 44 6c 67 2c 20 6b 41 6c | 65 72 74 4f 4b 42 75 74 |Dlg, kAl|ertOKBut|
|000045b0| 74 6f 6e 2c 20 26 69 74 | 65 6d 54 79 70 65 2c 20 |ton, &it|emType, |
|000045c0| 26 69 74 65 6d 48 61 6e | 64 6c 65 2c 20 26 69 74 |&itemHan|dle, &it|
|000045d0| 65 6d 52 65 63 74 20 29 | 3b 0d 09 20 09 49 6e 73 |emRect )|;.. .Ins|
|000045e0| 65 74 52 65 63 74 28 20 | 26 69 74 65 6d 52 65 63 |etRect( |&itemRec|
|000045f0| 74 2c 20 2d 34 2c 20 2d | 34 20 29 3b 0d 09 20 09 |t, -4, -|4 );.. .|
|00004600| 50 65 6e 53 69 7a 65 28 | 20 33 2c 20 33 20 29 3b |PenSize(| 3, 3 );|
|00004610| 0d 09 20 09 46 72 61 6d | 65 52 6f 75 6e 64 52 65 |.. .Fram|eRoundRe|
|00004620| 63 74 28 20 26 69 74 65 | 6d 52 65 63 74 2c 20 31 |ct( &ite|mRect, 1|
|00004630| 36 2c 20 31 36 20 29 3b | 0d 09 20 09 50 65 6e 53 |6, 16 );|.. .PenS|
|00004640| 69 7a 65 28 20 31 2c 20 | 31 20 29 3b 0d 09 20 0d |ize( 1, |1 );.. .|
|00004650| 09 20 2f 2f 09 4c 6f 6f | 70 20 61 6e 64 20 63 61 |. //.Loo|p and ca|
|00004660| 6c 6c 20 4d 6f 64 61 6c | 44 69 61 6c 6f 67 20 75 |ll Modal|Dialog u|
|00004670| 6e 74 69 6c 20 74 68 65 | 20 75 73 65 72 20 70 72 |ntil the| user pr|
|00004680| 65 73 73 65 73 20 74 68 | 65 20 4f 4b 20 62 75 74 |esses th|e OK but|
|00004690| 74 6f 6e 0d 09 20 2f 2f | 20 54 68 69 73 20 72 6f |ton.. //| This ro|
|000046a0| 75 74 69 6e 65 20 72 65 | 71 75 69 72 65 73 20 74 |utine re|quires t|
|000046b0| 68 61 74 20 77 68 61 74 | 65 76 65 72 20 61 6c 65 |hat what|ever ale|
|000046c0| 72 74 20 69 73 20 73 68 | 6f 77 6e 2c 20 74 68 65 |rt is sh|own, the|
|000046d0| 20 62 75 74 74 6f 6e 20 | 77 69 74 68 0d 09 20 2f | button |with.. /|
|000046e0| 2f 20 69 64 20 6e 75 6d | 62 65 72 20 6b 41 6c 65 |/ id num|ber kAle|
|000046f0| 72 74 4f 4b 42 75 74 74 | 6f 6e 20 69 73 20 74 68 |rtOKButt|on is th|
|00004700| 65 20 6f 6e 65 20 74 68 | 61 74 20 73 68 6f 75 6c |e one th|at shoul|
|00004710| 64 20 64 69 73 6d 69 73 | 73 20 74 68 65 20 64 69 |d dismis|s the di|
|00004720| 61 6c 6f 67 2e 0d 09 20 | 0d 09 20 09 4d 6f 64 61 |alog... |.. .Moda|
|00004730| 6c 44 69 61 6c 6f 67 28 | 20 4e 55 4c 4c 2c 20 26 |lDialog(| NULL, &|
|00004740| 69 74 65 6d 48 69 74 20 | 29 3b 0d 09 20 09 77 68 |itemHit |);.. .wh|
|00004750| 69 6c 65 20 28 20 69 74 | 65 6d 48 69 74 20 21 3d |ile ( it|emHit !=|
|00004760| 20 6b 41 6c 65 72 74 4f | 4b 42 75 74 74 6f 6e 20 | kAlertO|KButton |
|00004770| 29 0d 09 20 09 09 4d 6f | 64 61 6c 44 69 61 6c 6f |).. ..Mo|dalDialo|
|00004780| 67 28 20 4e 55 4c 4c 2c | 20 26 69 74 65 6d 48 69 |g( NULL,| &itemHi|
|00004790| 74 20 29 3b 0d 09 20 09 | 0d 09 20 2f 2a 09 4e 6f |t );.. .|.. /*.No|
|000047a0| 77 20 67 65 74 20 72 69 | 64 20 6f 66 20 74 68 65 |w get ri|d of the|
|000047b0| 20 64 69 61 6c 6f 67 20 | 61 6e 64 20 73 65 74 20 | dialog |and set |
|000047c0| 74 68 65 20 70 6f 72 74 | 20 62 61 63 6b 20 74 6f |the port| back to|
|000047d0| 20 74 68 65 20 63 6f 6e | 74 72 6f 6c 20 70 61 6e | the con|trol pan|
|000047e0| 65 6c 20 2a 2f 0d 09 20 | 0d 09 20 09 44 69 73 70 |el */.. |.. .Disp|
|000047f0| 6f 73 44 69 61 6c 6f 67 | 28 20 74 68 65 44 6c 67 |osDialog|( theDlg|
|00004800| 20 29 3b 0d 09 20 09 53 | 65 74 50 6f 72 74 28 20 | );.. .S|etPort( |
|00004810| 63 75 72 72 65 6e 74 50 | 6f 72 74 20 29 3b 0d 7d |currentP|ort );.}|
|00004820| 0d 0d 2f 2f 20 57 69 6e | 64 6f 77 44 65 76 69 63 |..// Win|dowDevic|
|00004830| 65 20 72 65 74 75 72 6e | 73 20 61 20 68 61 6e 64 |e return|s a hand|
|00004840| 6c 65 20 74 6f 20 74 68 | 65 20 67 72 61 70 68 69 |le to th|e graphi|
|00004850| 63 73 20 64 65 76 69 63 | 65 20 72 65 63 6f 72 64 |cs devic|e record|
|00004860| 20 6f 66 0d 2f 2f 20 74 | 68 65 20 6d 6f 6e 69 74 | of.// t|he monit|
|00004870| 6f 72 20 74 68 61 74 20 | 74 68 65 20 77 69 6e 64 |or that |the wind|
|00004880| 6f 77 20 73 70 65 63 69 | 66 69 65 64 20 69 73 20 |ow speci|fied is |
|00004890| 64 69 73 70 6c 61 79 65 | 64 20 6f 6e 2e 0d 2f 2f |displaye|d on..//|
|000048a0| 0d 47 44 48 61 6e 64 6c | 65 20 57 69 6e 64 6f 77 |.GDHandl|e Window|
|000048b0| 44 65 76 69 63 65 28 20 | 57 69 6e 64 6f 77 50 74 |Device( |WindowPt|
|000048c0| 72 20 77 69 6e 50 74 72 | 20 29 0d 7b 0d 09 47 44 |r winPtr| ).{..GD|
|000048d0| 48 61 6e 64 6c 65 09 09 | 74 68 65 44 65 76 69 63 |Handle..|theDevic|
|000048e0| 65 3b 0d 09 50 6f 69 6e | 74 09 09 09 74 61 72 67 |e;..Poin|t...targ|
|000048f0| 65 74 50 74 3b 0d 09 0d | 09 74 61 72 67 65 74 50 |etPt;...|.targetP|
|00004900| 74 20 3d 20 54 4f 50 4c | 45 46 54 28 20 28 28 57 |t = TOPL|EFT( ((W|
|00004910| 69 6e 64 6f 77 50 65 65 | 6b 29 77 69 6e 50 74 72 |indowPee|k)winPtr|
|00004920| 29 2d 3e 70 6f 72 74 2e | 70 6f 72 74 52 65 63 74 |)->port.|portRect|
|00004930| 20 29 3b 0d 09 0d 09 74 | 68 65 44 65 76 69 63 65 | );....t|heDevice|
|00004940| 20 3d 20 47 65 74 44 65 | 76 69 63 65 4c 69 73 74 | = GetDe|viceList|
|00004950| 28 29 3b 0d 09 77 68 69 | 6c 65 20 28 20 21 50 74 |();..whi|le ( !Pt|
|00004960| 49 6e 52 65 63 74 28 20 | 74 61 72 67 65 74 50 74 |InRect( |targetPt|
|00004970| 2c 20 26 28 28 2a 2a 74 | 68 65 44 65 76 69 63 65 |, &((**t|heDevice|
|00004980| 29 2e 67 64 52 65 63 74 | 29 20 29 20 29 0d 09 7b |).gdRect|) ) )..{|
|00004990| 0d 09 09 74 68 65 44 65 | 76 69 63 65 20 3d 20 47 |...theDe|vice = G|
|000049a0| 65 74 4e 65 78 74 44 65 | 76 69 63 65 28 20 74 68 |etNextDe|vice( th|
|000049b0| 65 44 65 76 69 63 65 20 | 29 3b 0d 09 09 69 66 20 |eDevice |);...if |
|000049c0| 28 20 74 68 65 44 65 76 | 69 63 65 20 3d 3d 20 4e |( theDev|ice == N|
|000049d0| 55 4c 4c 20 29 0d 09 09 | 7b 0d 09 09 09 74 68 65 |ULL )...|{....the|
|000049e0| 44 65 76 69 63 65 20 3d | 20 47 65 74 4d 61 69 6e |Device =| GetMain|
|000049f0| 44 65 76 69 63 65 28 29 | 3b 0d 09 09 09 62 72 65 |Device()|;....bre|
|00004a00| 61 6b 3b 0d 09 09 7d 0d | 09 7d 0d 09 0d 09 72 65 |ak;...}.|.}....re|
|00004a10| 74 75 72 6e 20 74 68 65 | 44 65 76 69 63 65 3b 0d |turn the|Device;.|
|00004a20| 7d 0d 0d 2f 2f 20 46 61 | 64 65 54 6f 42 6c 61 63 |}..// Fa|deToBlac|
|00004a30| 6b 20 75 73 65 73 20 43 | 6f 70 79 42 69 74 73 20 |k uses C|opyBits |
|00004a40| 61 6e 64 20 61 6e 20 6f | 66 66 73 63 72 65 65 6e |and an o|ffscreen|
|00004a50| 20 67 72 61 70 68 69 63 | 73 20 77 6f 72 6c 64 20 | graphic|s world |
|00004a60| 74 6f 0d 2f 2f 20 66 61 | 64 65 20 61 6e 20 61 72 |to.// fa|de an ar|
|00004a70| 65 61 20 28 73 70 65 63 | 69 66 69 65 64 20 62 79 |ea (spec|ified by|
|00004a80| 20 64 65 73 74 52 65 63 | 74 29 20 69 6e 20 61 20 | destRec|t) in a |
|00004a90| 77 69 6e 64 6f 77 20 28 | 73 70 65 63 69 66 69 65 |window (|specifie|
|00004aa0| 64 0d 2f 2f 20 62 79 20 | 64 65 73 74 57 69 6e 29 |d.// by |destWin)|
|00004ab0| 20 74 6f 20 62 6c 61 63 | 6b 2e 20 49 74 20 64 6f | to blac|k. It do|
|00004ac0| 65 73 20 74 68 69 73 20 | 62 79 20 63 72 65 61 74 |es this |by creat|
|00004ad0| 69 6e 67 20 61 6e 20 6f | 66 66 73 63 72 65 65 6e |ing an o|ffscreen|
|00004ae0| 0d 2f 2f 20 67 72 61 70 | 68 69 63 73 20 77 6f 72 |.// grap|hics wor|
|00004af0| 6c 64 2c 20 70 61 69 6e | 74 69 6e 67 20 74 68 65 |ld, pain|ting the|
|00004b00| 20 47 57 6f 72 6c 64 20 | 67 72 61 79 2c 20 74 68 | GWorld |gray, th|
|00004b10| 65 6e 20 72 65 70 65 61 | 74 65 64 6c 79 0d 2f 2f |en repea|tedly.//|
|00004b20| 20 63 6f 70 79 69 6e 67 | 20 74 68 65 20 67 72 61 | copying| the gra|
|00004b30| 79 20 72 65 63 74 61 6e | 67 6c 65 20 74 6f 20 74 |y rectan|gle to t|
|00004b40| 68 65 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 61 |he desti|nation a|
|00004b50| 72 65 61 20 75 73 69 6e | 67 20 74 68 65 0d 2f 2f |rea usin|g the.//|
|00004b60| 20 73 75 62 50 69 6e 20 | 74 72 61 6e 73 66 65 72 | subPin |transfer|
|00004b70| 20 6d 65 74 68 6f 64 20 | 6f 66 20 43 6f 70 79 42 | method |of CopyB|
|00004b80| 69 74 73 2e 20 54 68 69 | 73 20 63 61 75 73 65 73 |its. Thi|s causes|
|00004b90| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00004ba0| 0d 2f 2f 20 74 6f 20 67 | 72 6f 77 20 64 61 72 6b |.// to g|row dark|
|00004bb0| 65 72 20 61 6e 64 20 64 | 61 72 6b 65 72 2e 0d 2f |er and d|arker../|
|00004bc0| 2f 0d 76 6f 69 64 20 46 | 61 64 65 54 6f 42 6c 61 |/.void F|adeToBla|
|00004bd0| 63 6b 28 20 57 69 6e 64 | 6f 77 50 74 72 20 64 65 |ck( Wind|owPtr de|
|00004be0| 73 74 57 69 6e 2c 20 52 | 65 63 74 20 2a 64 65 73 |stWin, R|ect *des|
|00004bf0| 74 52 65 63 74 2c 20 73 | 68 6f 72 74 20 66 61 64 |tRect, s|hort fad|
|00004c00| 65 53 70 65 65 64 20 29 | 0d 7b 0d 09 43 47 72 61 |eSpeed )|.{..CGra|
|00004c10| 66 50 74 72 09 09 73 61 | 76 65 64 50 6f 72 74 3b |fPtr..sa|vedPort;|
|00004c20| 0d 09 47 44 48 61 6e 64 | 6c 65 09 09 73 61 76 65 |..GDHand|le..save|
|00004c30| 64 44 65 76 69 63 65 3b | 0d 09 47 57 6f 72 6c 64 |dDevice;|..GWorld|
|00004c40| 50 74 72 09 09 6f 66 66 | 73 63 72 65 65 6e 57 6f |Ptr..off|screenWo|
|00004c50| 72 6c 64 3b 0d 09 52 65 | 63 74 09 09 09 6f 66 66 |rld;..Re|ct...off|
|00004c60| 73 63 72 65 65 6e 52 65 | 63 74 3b 0d 09 4f 53 45 |screenRe|ct;..OSE|
|00004c70| 72 72 09 09 09 6d 79 45 | 72 72 3b 0d 09 50 65 6e |rr...myE|rr;..Pen|
|00004c80| 53 74 61 74 65 09 09 73 | 61 76 65 64 50 65 6e 3b |State..s|avedPen;|
|00004c90| 0d 09 52 47 42 43 6f 6c | 6f 72 09 09 73 61 76 65 |..RGBCol|or..save|
|00004ca0| 64 46 6f 72 65 3b 0d 09 | 52 47 42 43 6f 6c 6f 72 |dFore;..|RGBColor|
|00004cb0| 09 09 73 61 76 65 64 42 | 61 63 6b 3b 0d 09 50 69 |..savedB|ack;..Pi|
|00004cc0| 78 4d 61 70 48 61 6e 64 | 6c 65 09 74 68 65 50 69 |xMapHand|le.thePi|
|00004cd0| 78 4d 61 70 3b 0d 09 6c | 6f 6e 67 09 09 09 72 65 |xMap;..l|ong...re|
|00004ce0| 70 65 74 69 74 69 6f 6e | 73 3b 0d 09 52 47 42 43 |petition|s;..RGBC|
|00004cf0| 6f 6c 6f 72 09 09 67 72 | 61 79 43 6f 6c 6f 72 3b |olor..gr|ayColor;|
|00004d00| 0d 09 52 47 42 43 6f 6c | 6f 72 09 09 62 6c 61 63 |..RGBCol|or..blac|
|00004d10| 6b 43 6f 6c 6f 72 3b 0d | 09 52 47 42 43 6f 6c 6f |kColor;.|.RGBColo|
|00004d20| 72 09 09 77 68 69 74 65 | 43 6f 6c 6f 72 3b 0d 09 |r..white|Color;..|
|00004d30| 0d 09 2f 2f 20 4d 61 6b | 65 20 74 68 65 20 62 6c |..// Mak|e the bl|
|00004d40| 61 63 6b 20 61 6e 64 20 | 77 68 69 74 65 20 63 6f |ack and |white co|
|00004d50| 6c 6f 72 73 0d 09 0d 09 | 09 62 6c 61 63 6b 43 6f |lors....|.blackCo|
|00004d60| 6c 6f 72 2e 62 6c 75 65 | 20 3d 20 62 6c 61 63 6b |lor.blue| = black|
|00004d70| 43 6f 6c 6f 72 2e 67 72 | 65 65 6e 20 3d 20 62 6c |Color.gr|een = bl|
|00004d80| 61 63 6b 43 6f 6c 6f 72 | 2e 72 65 64 20 3d 20 30 |ackColor|.red = 0|
|00004d90| 3b 0d 09 09 77 68 69 74 | 65 43 6f 6c 6f 72 2e 62 |;...whit|eColor.b|
|00004da0| 6c 75 65 20 3d 20 77 68 | 69 74 65 43 6f 6c 6f 72 |lue = wh|iteColor|
|00004db0| 2e 67 72 65 65 6e 20 3d | 20 77 68 69 74 65 43 6f |.green =| whiteCo|
|00004dc0| 6c 6f 72 2e 72 65 64 20 | 3d 20 30 78 46 46 46 46 |lor.red |= 0xFFFF|
|00004dd0| 3b 0d 09 09 0d 09 2f 2f | 20 53 61 76 65 20 74 68 |;.....//| Save th|
|00004de0| 65 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 2f 64 |e curren|t port/d|
|00004df0| 65 76 69 63 65 2e 20 54 | 68 69 73 20 73 68 6f 75 |evice. T|his shou|
|00004e00| 6c 64 20 62 65 20 75 73 | 65 64 20 69 6e 73 74 65 |ld be us|ed inste|
|00004e10| 61 64 0d 09 2f 2f 20 6f | 66 20 47 65 74 50 6f 72 |ad..// o|f GetPor|
|00004e20| 74 2e 20 54 68 6f 75 67 | 68 20 73 61 76 65 64 50 |t. Thoug|h savedP|
|00004e30| 6f 72 74 20 69 73 20 64 | 65 66 69 6e 65 64 20 61 |ort is d|efined a|
|00004e40| 73 20 61 20 43 47 72 61 | 66 50 74 72 2c 0d 09 2f |s a CGra|fPtr,../|
|00004e50| 2f 20 74 68 65 20 72 6f | 75 74 69 6e 65 20 6d 61 |/ the ro|utine ma|
|00004e60| 79 20 72 65 74 75 72 6e | 20 61 20 47 72 61 66 50 |y return| a GrafP|
|00004e70| 74 72 20 6f 72 20 70 6f | 69 6e 74 65 72 20 74 6f |tr or po|inter to|
|00004e80| 20 61 20 47 57 6f 72 6c | 64 0d 09 2f 2f 20 69 6e | a GWorl|d..// in|
|00004e90| 73 74 65 61 64 20 28 47 | 57 6f 72 6c 64 50 74 72 |stead (G|WorldPtr|
|00004ea0| 29 2e 0d 09 0d 09 09 47 | 65 74 47 57 6f 72 6c 64 |)......G|etGWorld|
|00004eb0| 28 20 26 73 61 76 65 64 | 50 6f 72 74 2c 20 26 73 |( &saved|Port, &s|
|00004ec0| 61 76 65 64 44 65 76 69 | 63 65 20 29 3b 0d 0d 09 |avedDevi|ce );...|
|00004ed0| 2f 2f 20 53 65 74 20 74 | 68 65 20 63 75 72 72 65 |// Set t|he curre|
|00004ee0| 6e 74 20 70 6f 72 74 20 | 74 6f 20 74 68 65 20 64 |nt port |to the d|
|00004ef0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 77 69 6e 64 6f |estinati|on windo|
|00004f00| 77 0d 09 0d 09 09 53 65 | 74 47 57 6f 72 6c 64 28 |w.....Se|tGWorld(|
|00004f10| 20 28 43 47 72 61 66 50 | 74 72 29 64 65 73 74 57 | (CGrafP|tr)destW|
|00004f20| 69 6e 2c 20 4e 55 4c 4c | 20 29 3b 0d 09 0d 09 2f |in, NULL| );..../|
|00004f30| 2f 20 53 61 76 65 20 74 | 68 65 20 70 65 6e 20 73 |/ Save t|he pen s|
|00004f40| 74 61 74 65 20 61 6e 64 | 20 63 6f 6c 6f 72 20 69 |tate and| color i|
|00004f50| 6e 66 6f 20 6f 66 20 74 | 68 65 20 64 65 73 74 69 |nfo of t|he desti|
|00004f60| 6e 61 74 69 6f 6e 20 77 | 69 6e 64 6f 77 0d 09 0d |nation w|indow...|
|00004f70| 09 09 47 65 74 50 65 6e | 53 74 61 74 65 28 20 26 |..GetPen|State( &|
|00004f80| 73 61 76 65 64 50 65 6e | 20 29 3b 0d 09 09 47 65 |savedPen| );...Ge|
|00004f90| 74 46 6f 72 65 43 6f 6c | 6f 72 28 20 26 73 61 76 |tForeCol|or( &sav|
|00004fa0| 65 64 46 6f 72 65 20 29 | 3b 0d 09 09 47 65 74 42 |edFore )|;...GetB|
|00004fb0| 61 63 6b 43 6f 6c 6f 72 | 28 20 26 73 61 76 65 64 |ackColor|( &saved|
|00004fc0| 42 61 63 6b 20 29 3b 0d | 09 0d 09 2f 2f 20 4d 61 |Back );.|...// Ma|
|00004fd0| 6b 65 20 73 75 72 65 20 | 74 68 65 20 66 6f 72 65 |ke sure |the fore|
|00004fe0| 67 72 6f 75 6e 64 20 63 | 6f 6c 6f 72 20 6f 66 20 |ground c|olor of |
|00004ff0| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|00005000| 77 69 6e 64 6f 77 0d 09 | 2f 2f 20 69 73 20 62 6c |window..|// is bl|
|00005010| 61 63 6b 20 61 6e 64 20 | 74 68 65 20 62 61 63 6b |ack and |the back|
|00005020| 67 72 6f 75 6e 64 20 63 | 6f 6c 6f 72 20 69 73 20 |ground c|olor is |
|00005030| 77 68 69 74 65 2e 0d 09 | 0d 09 09 52 47 42 46 6f |white...|...RGBFo|
|00005040| 72 65 43 6f 6c 6f 72 28 | 20 26 62 6c 61 63 6b 43 |reColor(| &blackC|
|00005050| 6f 6c 6f 72 20 29 3b 0d | 09 09 52 47 42 42 61 63 |olor );.|..RGBBac|
|00005060| 6b 43 6f 6c 6f 72 28 20 | 26 77 68 69 74 65 43 6f |kColor( |&whiteCo|
|00005070| 6c 6f 72 20 29 3b 0d 09 | 09 0d 09 2f 2f 20 43 6f |lor );..|...// Co|
|00005080| 6e 76 65 72 74 20 74 68 | 65 20 64 65 73 74 69 6e |nvert th|e destin|
|00005090| 61 74 69 6f 6e 20 72 65 | 63 74 61 6e 67 6c 65 20 |ation re|ctangle |
|000050a0| 69 6e 74 6f 20 67 6c 6f | 62 61 6c 20 63 6f 6f 72 |into glo|bal coor|
|000050b0| 64 69 6e 61 74 65 73 0d | 09 0d 09 09 6f 66 66 73 |dinates.|....offs|
|000050c0| 63 72 65 65 6e 52 65 63 | 74 20 3d 20 28 2a 64 65 |creenRec|t = (*de|
|000050d0| 73 74 52 65 63 74 29 3b | 0d 09 09 4c 6f 63 61 6c |stRect);|...Local|
|000050e0| 54 6f 47 6c 6f 62 61 6c | 28 20 26 54 4f 50 4c 45 |ToGlobal|( &TOPLE|
|000050f0| 46 54 28 6f 66 66 73 63 | 72 65 65 6e 52 65 63 74 |FT(offsc|reenRect|
|00005100| 29 20 29 3b 0d 09 09 4c | 6f 63 61 6c 54 6f 47 6c |) );...L|ocalToGl|
|00005110| 6f 62 61 6c 28 20 26 42 | 4f 54 52 49 47 48 54 28 |obal( &B|OTRIGHT(|
|00005120| 6f 66 66 73 63 72 65 65 | 6e 52 65 63 74 29 20 29 |offscree|nRect) )|
|00005130| 3b 0d 09 0d 09 2f 2f 20 | 4d 61 6b 65 20 74 68 65 |;....// |Make the|
|00005140| 20 6f 66 66 73 63 72 65 | 65 6e 20 72 65 63 74 61 | offscre|en recta|
|00005150| 6e 67 6c 65 20 73 6d 61 | 6c 6c 65 72 2e 20 49 74 |ngle sma|ller. It|
|00005160| 20 64 6f 65 73 6e 27 74 | 20 6d 61 74 74 65 72 20 | doesn't| matter |
|00005170| 73 69 6e 63 65 20 69 74 | 27 73 0d 09 2f 2f 20 61 |since it|'s..// a|
|00005180| 6c 6c 20 74 68 65 20 73 | 61 6d 65 20 63 6f 6c 6f |ll the s|ame colo|
|00005190| 72 20 61 6e 64 20 69 74 | 27 6c 6c 20 75 73 65 20 |r and it|'ll use |
|000051a0| 75 70 20 6c 65 73 73 20 | 6d 65 6d 6f 72 79 2e 0d |up less |memory..|
|000051b0| 09 0d 09 09 6f 66 66 73 | 63 72 65 65 6e 52 65 63 |....offs|creenRec|
|000051c0| 74 2e 72 69 67 68 74 20 | 3d 20 6f 66 66 73 63 72 |t.right |= offscr|
|000051d0| 65 65 6e 52 65 63 74 2e | 6c 65 66 74 20 2b 20 32 |eenRect.|left + 2|
|000051e0| 3b 0d 09 09 6f 66 66 73 | 63 72 65 65 6e 52 65 63 |;...offs|creenRec|
|000051f0| 74 2e 62 6f 74 74 6f 6d | 20 3d 20 6f 66 66 73 63 |t.bottom| = offsc|
|00005200| 72 65 65 6e 52 65 63 74 | 2e 74 6f 70 20 2b 20 32 |reenRect|.top + 2|
|00005210| 3b 0d 09 09 0d 09 2f 2f | 20 43 72 65 61 74 65 20 |;.....//| Create |
|00005220| 61 6e 20 6f 66 66 73 63 | 72 65 65 6e 20 47 57 6f |an offsc|reen GWo|
|00005230| 72 6c 64 20 77 69 74 68 | 20 74 68 65 20 73 61 6d |rld with| the sam|
|00005240| 65 20 64 65 70 74 68 20 | 61 73 20 74 68 65 0d 09 |e depth |as the..|
|00005250| 2f 2f 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 77 |// desti|nation w|
|00005260| 69 6e 64 6f 77 2f 72 65 | 63 74 61 6e 67 6c 65 2e |indow/re|ctangle.|
|00005270| 20 54 68 65 20 70 61 72 | 61 6d 65 74 65 72 73 20 | The par|ameters |
|00005280| 61 72 65 20 61 73 20 66 | 6f 6c 6c 6f 77 73 3a 0d |are as f|ollows:.|
|00005290| 09 2f 2f 09 09 26 6f 66 | 66 73 63 72 65 65 6e 57 |.//..&of|fscreenW|
|000052a0| 6f 72 6c 64 09 09 70 74 | 72 20 74 6f 20 6e 65 77 |orld..pt|r to new|
|000052b0| 20 67 72 61 70 68 69 63 | 73 20 77 6f 72 6c 64 0d | graphic|s world.|
|000052c0| 09 2f 2f 09 09 30 09 09 | 09 09 09 62 69 74 20 64 |.//..0..|...bit d|
|000052d0| 65 70 74 68 20 73 61 6d | 65 20 61 73 20 67 72 61 |epth sam|e as gra|
|000052e0| 70 68 69 63 73 20 64 65 | 76 69 63 65 20 6f 66 20 |phics de|vice of |
|000052f0| 64 65 73 74 20 72 65 63 | 74 0d 09 2f 2f 09 09 26 |dest rec|t..//..&|
|00005300| 6f 66 66 73 63 72 65 65 | 6e 52 65 63 74 09 09 62 |offscree|nRect..b|
|00005310| 6f 75 6e 64 73 20 72 65 | 63 74 61 6e 67 6c 65 20 |ounds re|ctangle |
|00005320| 6f 66 20 6d 79 20 47 57 | 6f 72 6c 64 0d 09 2f 2f |of my GW|orld..//|
|00005330| 09 09 4e 55 4c 4c 09 09 | 09 09 68 61 6e 64 6c 65 |..NULL..|..handle|
|00005340| 20 74 6f 20 61 20 63 6f | 6c 6f 72 20 74 61 62 6c | to a co|lor tabl|
|00005350| 65 20 72 65 63 6f 72 64 | 20 2d 20 4e 55 4c 4c 20 |e record| - NULL |
|00005360| 6d 65 61 6e 73 0d 09 2f | 2f 09 09 09 09 09 09 09 |means../|/.......|
|00005370| 75 73 65 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |use the |default |
|00005380| 72 65 63 6f 72 64 20 66 | 6f 72 20 74 68 61 74 20 |record f|or that |
|00005390| 64 65 70 74 68 0d 09 2f | 2f 09 09 4e 55 4c 4c 09 |depth../|/..NULL.|
|000053a0| 09 09 09 68 61 6e 64 6c | 65 20 74 6f 20 61 20 67 |...handl|e to a g|
|000053b0| 72 61 70 68 69 63 73 20 | 64 65 76 69 63 65 20 72 |raphics |device r|
|000053c0| 65 63 6f 72 64 20 2d 20 | 77 65 20 61 72 65 6e 27 |ecord - |we aren'|
|000053d0| 74 0d 09 2f 2f 09 09 09 | 09 09 09 09 63 72 65 61 |t..//...|....crea|
|000053e0| 74 69 6e 67 20 61 20 6e | 65 77 20 67 72 61 70 68 |ting a n|ew graph|
|000053f0| 69 63 73 20 64 65 76 69 | 63 65 0d 09 2f 2f 09 09 |ics devi|ce..//..|
|00005400| 30 4c 09 09 09 09 09 6e | 6f 20 66 6c 61 67 73 0d |0L.....n|o flags.|
|00005410| 09 0d 09 09 6d 79 45 72 | 72 20 3d 20 4e 65 77 47 |....myEr|r = NewG|
|00005420| 57 6f 72 6c 64 28 20 26 | 6f 66 66 73 63 72 65 65 |World( &|offscree|
|00005430| 6e 57 6f 72 6c 64 2c 20 | 30 2c 20 26 6f 66 66 73 |nWorld, |0, &offs|
|00005440| 63 72 65 65 6e 52 65 63 | 74 2c 20 4e 55 4c 4c 2c |creenRec|t, NULL,|
|00005450| 20 4e 55 4c 4c 2c 20 30 | 4c 20 29 3b 0d 09 0d 09 | NULL, 0|L );....|
|00005460| 2f 2f 20 4d 61 6b 65 20 | 73 75 72 65 20 74 68 65 |// Make |sure the|
|00005470| 20 47 57 6f 72 6c 64 20 | 77 61 73 20 63 72 65 61 | GWorld |was crea|
|00005480| 74 65 64 0d 09 0d 09 09 | 69 66 20 28 20 6d 79 45 |ted.....|if ( myE|
|00005490| 72 72 20 29 0d 09 09 7b | 0d 09 09 09 44 6f 41 6c |rr )...{|....DoAl|
|000054a0| 65 72 74 28 20 6b 47 57 | 6f 72 6c 64 45 72 72 44 |ert( kGW|orldErrD|
|000054b0| 6c 67 49 44 2c 20 74 72 | 75 65 20 29 3b 0d 09 09 |lgID, tr|ue );...|
|000054c0| 09 45 78 69 74 54 6f 53 | 68 65 6c 6c 28 29 3b 0d |.ExitToS|hell();.|
|000054d0| 09 09 7d 0d 09 0d 09 2f | 2f 20 4d 61 6b 65 20 74 |..}..../|/ Make t|
|000054e0| 68 65 20 47 57 6f 72 6c | 64 20 74 68 65 20 63 75 |he GWorl|d the cu|
|000054f0| 72 72 65 6e 74 20 70 6f | 72 74 0d 09 0d 09 09 53 |rrent po|rt.....S|
|00005500| 65 74 47 57 6f 72 6c 64 | 28 20 6f 66 66 73 63 72 |etGWorld|( offscr|
|00005510| 65 65 6e 57 6f 72 6c 64 | 2c 20 4e 55 4c 4c 20 29 |eenWorld|, NULL )|
|00005520| 3b 0d 09 09 0d 09 2f 2f | 20 47 65 74 20 74 68 65 |;.....//| Get the|
|00005530| 20 47 57 6f 72 6c 64 27 | 73 20 70 69 78 65 6c 20 | GWorld'|s pixel |
|00005540| 6d 61 70 20 68 61 6e 64 | 6c 65 20 61 6e 64 20 6c |map hand|le and l|
|00005550| 6f 63 6b 20 74 68 65 20 | 70 69 78 65 6c 73 20 77 |ock the |pixels w|
|00005560| 68 69 6c 65 20 77 65 27 | 72 65 0d 09 2f 2f 20 64 |hile we'|re..// d|
|00005570| 72 61 77 69 6e 67 20 69 | 6e 20 74 68 65 20 47 57 |rawing i|n the GW|
|00005580| 6f 72 6c 64 2e 20 57 65 | 20 68 61 76 65 20 74 6f |orld. We| have to|
|00005590| 20 64 6f 20 74 68 69 73 | 20 62 65 63 61 75 73 65 | do this| because|
|000055a0| 20 61 20 47 57 6f 72 6c | 64 20 61 63 74 75 61 6c | a GWorl|d actual|
|000055b0| 6c 79 0d 09 2f 2f 20 68 | 6f 6c 64 73 20 69 74 73 |ly..// h|olds its|
|000055c0| 20 70 69 78 65 6c 20 6d | 61 70 20 69 6e 20 61 20 | pixel m|ap in a |
|000055d0| 68 61 6e 64 6c 65 20 72 | 61 74 68 65 72 20 74 68 |handle r|ather th|
|000055e0| 61 6e 20 61 20 70 6f 69 | 6e 74 65 72 2e 20 4c 6f |an a poi|nter. Lo|
|000055f0| 63 6b 50 69 78 65 6c 73 | 0d 09 2f 2f 20 6d 61 6b |ckPixels|..// mak|
|00005600| 65 73 20 73 75 72 65 20 | 74 68 65 20 70 69 78 65 |es sure |the pixe|
|00005610| 6c 20 6d 61 70 20 64 6f | 65 73 6e 27 74 20 6d 6f |l map do|esn't mo|
|00005620| 76 65 2e 20 59 6f 75 20 | 73 68 6f 75 6c 64 20 6c |ve. You |should l|
|00005630| 6f 63 6b 20 61 20 47 57 | 6f 72 6c 64 27 73 0d 09 |ock a GW|orld's..|
|00005640| 2f 2f 20 70 69 78 65 6c | 73 20 62 65 66 6f 72 65 |// pixel|s before|
|00005650| 20 64 72 61 77 69 6e 67 | 20 74 6f 20 6f 72 20 63 | drawing| to or c|
|00005660| 6f 70 79 69 6e 67 20 66 | 72 6f 6d 20 74 68 65 20 |opying f|rom the |
|00005670| 47 57 6f 72 6c 64 20 28 | 61 6e 64 20 75 6e 6c 6f |GWorld (|and unlo|
|00005680| 63 6b 0d 09 2f 2f 20 74 | 68 65 6d 20 61 66 74 65 |ck..// t|hem afte|
|00005690| 72 77 61 72 64 29 2e 0d | 09 0d 09 09 74 68 65 50 |rward)..|....theP|
|000056a0| 69 78 4d 61 70 20 3d 20 | 47 65 74 47 57 6f 72 6c |ixMap = |GetGWorl|
|000056b0| 64 50 69 78 4d 61 70 28 | 20 6f 66 66 73 63 72 65 |dPixMap(| offscre|
|000056c0| 65 6e 57 6f 72 6c 64 20 | 29 3b 0d 09 09 4c 6f 63 |enWorld |);...Loc|
|000056d0| 6b 50 69 78 65 6c 73 28 | 20 74 68 65 50 69 78 4d |kPixels(| thePixM|
|000056e0| 61 70 20 29 3b 0d 09 0d | 09 2f 2f 20 54 68 65 20 |ap );...|.// The |
|000056f0| 73 70 65 65 64 20 6f 66 | 20 74 68 65 20 66 61 64 |speed of| the fad|
|00005700| 65 20 64 65 74 65 72 6d | 69 6e 65 73 20 77 68 61 |e determ|ines wha|
|00005710| 74 20 73 68 61 64 65 20 | 6f 66 20 67 72 61 79 20 |t shade |of gray |
|00005720| 77 65 27 6c 6c 20 70 61 | 69 6e 74 0d 09 2f 2f 20 |we'll pa|int..// |
|00005730| 74 68 65 20 6f 66 66 73 | 63 72 65 65 6e 20 47 57 |the offs|creen GW|
|00005740| 6f 72 6c 64 2e 20 66 61 | 64 65 53 70 65 65 64 20 |orld. fa|deSpeed |
|00005750| 63 61 6e 20 72 61 6e 67 | 65 20 66 72 6f 6d 20 30 |can rang|e from 0|
|00005760| 20 74 6f 20 32 30 20 77 | 69 74 68 20 32 30 0d 09 | to 20 w|ith 20..|
|00005770| 2f 2f 20 62 65 69 6e 67 | 20 74 68 65 20 66 61 73 |// being| the fas|
|00005780| 74 65 73 74 2e 0d 09 7b | 0d 09 09 75 6e 73 69 67 |test...{|...unsig|
|00005790| 6e 65 64 20 73 68 6f 72 | 74 09 6d 61 78 56 61 6c |ned shor|t.maxVal|
|000057a0| 75 65 3d 30 78 46 46 46 | 46 3b 0d 09 09 0d 09 09 |ue=0xFFF|F;......|
|000057b0| 69 66 20 28 20 66 61 64 | 65 53 70 65 65 64 20 3c |if ( fad|eSpeed <|
|000057c0| 3d 20 30 20 29 20 66 61 | 64 65 53 70 65 65 64 20 |= 0 ) fa|deSpeed |
|000057d0| 3d 20 31 3b 09 2f 2f 20 | 6d 61 6b 65 20 73 75 72 |= 1;.// |make sur|
|000057e0| 65 20 73 70 65 65 64 20 | 69 73 20 6e 6f 74 20 7a |e speed |is not z|
|000057f0| 65 72 6f 0d 09 09 69 66 | 20 28 20 66 61 64 65 53 |ero...if| ( fadeS|
|00005800| 70 65 65 64 20 3e 20 32 | 30 20 29 20 66 61 64 65 |peed > 2|0 ) fade|
|00005810| 53 70 65 65 64 20 3d 20 | 32 30 3b 09 2f 2f 20 6d |Speed = |20;.// m|
|00005820| 61 6b 65 20 73 75 72 65 | 20 6e 6f 74 20 6f 76 65 |ake sure| not ove|
|00005830| 72 20 32 30 0d 09 09 0d | 09 09 67 72 61 79 43 6f |r 20....|..grayCo|
|00005840| 6c 6f 72 2e 62 6c 75 65 | 20 3d 20 28 66 61 64 65 |lor.blue| = (fade|
|00005850| 53 70 65 65 64 20 2a 20 | 36 32 35 29 20 2b 20 38 |Speed * |625) + 8|
|00005860| 30 30 30 3b 0d 09 09 67 | 72 61 79 43 6f 6c 6f 72 |000;...g|rayColor|
|00005870| 2e 72 65 64 20 3d 20 67 | 72 61 79 43 6f 6c 6f 72 |.red = g|rayColor|
|00005880| 2e 67 72 65 65 6e 20 3d | 20 67 72 61 79 43 6f 6c |.green =| grayCol|
|00005890| 6f 72 2e 62 6c 75 65 3b | 0d 09 09 52 47 42 46 6f |or.blue;|...RGBFo|
|000058a0| 72 65 43 6f 6c 6f 72 28 | 20 26 67 72 61 79 43 6f |reColor(| &grayCo|
|000058b0| 6c 6f 72 20 29 3b 0d 09 | 09 72 65 70 65 74 69 74 |lor );..|.repetit|
|000058c0| 69 6f 6e 73 20 3d 20 6d | 61 78 56 61 6c 75 65 20 |ions = m|axValue |
|000058d0| 2f 20 67 72 61 79 43 6f | 6c 6f 72 2e 62 6c 75 65 |/ grayCo|lor.blue|
|000058e0| 3b 0d 09 7d 0d 0d 09 2f | 2f 20 50 61 69 6e 74 20 |;..}.../|/ Paint |
|000058f0| 69 74 20 61 6c 6c 20 67 | 72 61 79 0d 09 0d 09 09 |it all g|ray.....|
|00005900| 50 61 69 6e 74 52 65 63 | 74 28 20 26 28 6f 66 66 |PaintRec|t( &(off|
|00005910| 73 63 72 65 65 6e 57 6f | 72 6c 64 2d 3e 70 6f 72 |screenWo|rld->por|
|00005920| 74 52 65 63 74 29 20 29 | 3b 0d 09 0d 09 2f 2f 20 |tRect) )|;....// |
|00005930| 4d 61 6b 65 20 74 68 65 | 20 64 65 73 74 69 6e 61 |Make the| destina|
|00005940| 74 69 6f 6e 20 77 69 6e | 64 6f 77 20 74 68 65 20 |tion win|dow the |
|00005950| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 0d 09 0d 09 |current |port....|
|00005960| 09 53 65 74 47 57 6f 72 | 6c 64 28 20 28 43 47 72 |.SetGWor|ld( (CGr|
|00005970| 61 66 50 74 72 29 64 65 | 73 74 57 69 6e 2c 20 4e |afPtr)de|stWin, N|
|00005980| 55 4c 4c 20 29 3b 0d 09 | 09 0d 09 2f 2f 20 4c 6f |ULL );..|...// Lo|
|00005990| 6f 70 20 61 6e 64 20 75 | 73 65 20 43 6f 70 79 42 |op and u|se CopyB|
|000059a0| 69 74 73 20 74 6f 20 63 | 6f 70 79 20 74 68 65 20 |its to c|opy the |
|000059b0| 67 72 61 79 20 72 65 63 | 74 61 6e 67 6c 65 20 69 |gray rec|tangle i|
|000059c0| 6e 74 6f 20 74 68 65 0d | 09 2f 2f 20 64 65 73 74 |nto the.|.// dest|
|000059d0| 69 6e 61 74 69 6f 6e 20 | 77 69 6e 64 6f 77 2f 72 |ination |window/r|
|000059e0| 65 63 74 20 75 73 69 6e | 67 20 74 68 65 20 73 75 |ect usin|g the su|
|000059f0| 62 50 69 6e 20 74 72 61 | 6e 73 66 65 72 20 6d 65 |bPin tra|nsfer me|
|00005a00| 74 68 6f 64 0d 09 2f 2f | 20 73 6f 20 74 68 61 74 |thod..//| so that|
|00005a10| 20 74 68 65 20 70 69 63 | 74 75 72 65 20 67 65 74 | the pic|ture get|
|00005a20| 73 20 64 61 72 6b 65 72 | 20 61 6e 64 20 64 61 72 |s darker| and dar|
|00005a30| 6b 65 72 2e 0d 09 0d 09 | 09 77 68 69 6c 65 20 28 |ker.....|.while (|
|00005a40| 20 72 65 70 65 74 69 74 | 69 6f 6e 73 20 29 0d 09 | repetit|ions )..|
|00005a50| 09 7b 0d 09 09 09 43 6f | 70 79 42 69 74 73 28 20 |.{....Co|pyBits( |
|00005a60| 26 57 49 4e 42 49 54 4d | 41 50 28 20 6f 66 66 73 |&WINBITM|AP( offs|
|00005a70| 63 72 65 65 6e 57 6f 72 | 6c 64 20 29 2c 20 26 57 |creenWor|ld ), &W|
|00005a80| 49 4e 42 49 54 4d 41 50 | 28 20 64 65 73 74 57 69 |INBITMAP|( destWi|
|00005a90| 6e 20 29 2c 0d 09 09 09 | 09 26 28 6f 66 66 73 63 |n ),....|.&(offsc|
|00005aa0| 72 65 65 6e 57 6f 72 6c | 64 2d 3e 70 6f 72 74 52 |reenWorl|d->portR|
|00005ab0| 65 63 74 29 2c 20 64 65 | 73 74 52 65 63 74 2c 20 |ect), de|stRect, |
|00005ac0| 73 75 62 50 69 6e 2c 20 | 4e 55 4c 4c 20 29 3b 0d |subPin, |NULL );.|
|00005ad0| 0d 09 09 09 72 65 70 65 | 74 69 74 69 6f 6e 73 2d |....repe|titions-|
|00005ae0| 2d 3b 0d 09 09 7d 0d 0d | 09 2f 2f 20 4d 61 6b 65 |-;...}..|.// Make|
|00005af0| 20 74 68 65 20 47 57 6f | 72 6c 64 20 74 68 65 20 | the GWo|rld the |
|00005b00| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 0d 09 0d 09 |current |port....|
|00005b10| 09 53 65 74 47 57 6f 72 | 6c 64 28 20 6f 66 66 73 |.SetGWor|ld( offs|
|00005b20| 63 72 65 65 6e 57 6f 72 | 6c 64 2c 20 4e 55 4c 4c |creenWor|ld, NULL|
|00005b30| 20 29 3b 0d 09 09 0d 09 | 2f 2f 20 4e 6f 77 20 77 | );.....|// Now w|
|00005b40| 65 27 6c 6c 20 64 6f 20 | 61 20 66 61 73 74 20 66 |e'll do |a fast f|
|00005b50| 61 64 65 20 6a 75 73 74 | 20 74 6f 20 6d 61 6b 65 |ade just| to make|
|00005b60| 20 73 75 72 65 20 65 76 | 65 72 79 74 68 69 6e 67 | sure ev|erything|
|00005b70| 20 77 65 6e 74 20 63 6f | 6d 70 6c 65 74 65 6c 79 | went co|mpletely|
|00005b80| 0d 09 2f 2f 20 74 6f 20 | 62 6c 61 63 6b 2e 0d 09 |..// to |black...|
|00005b90| 7b 0d 09 09 75 6e 73 69 | 67 6e 65 64 20 73 68 6f |{...unsi|gned sho|
|00005ba0| 72 74 09 6d 61 78 56 61 | 6c 75 65 3d 30 78 46 46 |rt.maxVa|lue=0xFF|
|00005bb0| 46 46 3b 0d 09 09 0d 09 | 09 67 72 61 79 43 6f 6c |FF;.....|.grayCol|
|00005bc0| 6f 72 2e 62 6c 75 65 20 | 3d 20 32 30 35 30 30 3b |or.blue |= 20500;|
|00005bd0| 0d 09 09 67 72 61 79 43 | 6f 6c 6f 72 2e 72 65 64 |...grayC|olor.red|
|00005be0| 20 3d 20 67 72 61 79 43 | 6f 6c 6f 72 2e 67 72 65 | = grayC|olor.gre|
|00005bf0| 65 6e 20 3d 20 67 72 61 | 79 43 6f 6c 6f 72 2e 62 |en = gra|yColor.b|
|00005c00| 6c 75 65 3b 0d 09 09 52 | 47 42 46 6f 72 65 43 6f |lue;...R|GBForeCo|
|00005c10| 6c 6f 72 28 20 26 67 72 | 61 79 43 6f 6c 6f 72 20 |lor( &gr|ayColor |
|00005c20| 29 3b 0d 09 09 72 65 70 | 65 74 69 74 69 6f 6e 73 |);...rep|etitions|
|00005c30| 20 3d 20 6d 61 78 56 61 | 6c 75 65 20 2f 20 67 72 | = maxVa|lue / gr|
|00005c40| 61 79 43 6f 6c 6f 72 2e | 62 6c 75 65 20 2b 20 31 |ayColor.|blue + 1|
|00005c50| 3b 0d 09 7d 0d 0d 09 2f | 2f 20 50 61 69 6e 74 20 |;..}.../|/ Paint |
|00005c60| 69 74 20 61 6c 6c 20 67 | 72 61 79 0d 09 0d 09 09 |it all g|ray.....|
|00005c70| 50 61 69 6e 74 52 65 63 | 74 28 20 26 28 6f 66 66 |PaintRec|t( &(off|
|00005c80| 73 63 72 65 65 6e 57 6f | 72 6c 64 2d 3e 70 6f 72 |screenWo|rld->por|
|00005c90| 74 52 65 63 74 29 20 29 | 3b 0d 09 0d 09 2f 2f 20 |tRect) )|;....// |
|00005ca0| 4d 61 6b 65 20 74 68 65 | 20 64 65 73 74 69 6e 61 |Make the| destina|
|00005cb0| 74 69 6f 6e 20 77 69 6e | 64 6f 77 20 74 68 65 20 |tion win|dow the |
|00005cc0| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 0d 09 0d 09 |current |port....|
|00005cd0| 09 53 65 74 47 57 6f 72 | 6c 64 28 20 28 43 47 72 |.SetGWor|ld( (CGr|
|00005ce0| 61 66 50 74 72 29 64 65 | 73 74 57 69 6e 2c 20 4e |afPtr)de|stWin, N|
|00005cf0| 55 4c 4c 20 29 3b 0d 09 | 09 0d 09 2f 2f 20 4c 6f |ULL );..|...// Lo|
|00005d00| 6f 70 20 61 6e 64 20 75 | 73 65 20 43 6f 70 79 42 |op and u|se CopyB|
|00005d10| 69 74 73 20 74 6f 20 63 | 6f 70 79 20 74 68 65 20 |its to c|opy the |
|00005d20| 67 72 61 79 20 72 65 63 | 74 61 6e 67 6c 65 20 69 |gray rec|tangle i|
|00005d30| 6e 74 6f 20 74 68 65 0d | 09 2f 2f 20 64 65 73 74 |nto the.|.// dest|
|00005d40| 69 6e 61 74 69 6f 6e 20 | 77 69 6e 64 6f 77 2f 72 |ination |window/r|
|00005d50| 65 63 74 20 75 73 69 6e | 67 20 74 68 65 20 73 75 |ect usin|g the su|
|00005d60| 62 50 69 6e 20 74 72 61 | 6e 73 66 65 72 20 6d 65 |bPin tra|nsfer me|
|00005d70| 74 68 6f 64 0d 09 2f 2f | 20 73 6f 20 74 68 61 74 |thod..//| so that|
|00005d80| 20 74 68 65 20 70 69 63 | 74 75 72 65 20 67 65 74 | the pic|ture get|
|00005d90| 73 20 64 61 72 6b 65 72 | 20 61 6e 64 20 64 61 72 |s darker| and dar|
|00005da0| 6b 65 72 2e 0d 09 0d 09 | 09 77 68 69 6c 65 20 28 |ker.....|.while (|
|00005db0| 20 72 65 70 65 74 69 74 | 69 6f 6e 73 20 29 0d 09 | repetit|ions )..|
|00005dc0| 09 7b 0d 09 09 09 43 6f | 70 79 42 69 74 73 28 20 |.{....Co|pyBits( |
|00005dd0| 26 57 49 4e 42 49 54 4d | 41 50 28 20 6f 66 66 73 |&WINBITM|AP( offs|
|00005de0| 63 72 65 65 6e 57 6f 72 | 6c 64 20 29 2c 20 26 57 |creenWor|ld ), &W|
|00005df0| 49 4e 42 49 54 4d 41 50 | 28 20 64 65 73 74 57 69 |INBITMAP|( destWi|
|00005e00| 6e 20 29 2c 0d 09 09 09 | 09 26 28 6f 66 66 73 63 |n ),....|.&(offsc|
|00005e10| 72 65 65 6e 57 6f 72 6c | 64 2d 3e 70 6f 72 74 52 |reenWorl|d->portR|
|00005e20| 65 63 74 29 2c 20 64 65 | 73 74 52 65 63 74 2c 20 |ect), de|stRect, |
|00005e30| 73 75 62 50 69 6e 2c 20 | 4e 55 4c 4c 20 29 3b 0d |subPin, |NULL );.|
|00005e40| 0d 09 09 09 72 65 70 65 | 74 69 74 69 6f 6e 73 2d |....repe|titions-|
|00005e50| 2d 3b 0d 09 09 7d 0d 0d | 09 2f 2f 20 55 6e 6c 6f |-;...}..|.// Unlo|
|00005e60| 63 6b 20 74 68 65 20 70 | 69 78 65 6c 73 20 61 67 |ck the p|ixels ag|
|00005e70| 61 69 6e 2e 0d 09 0d 09 | 09 55 6e 6c 6f 63 6b 50 |ain.....|.UnlockP|
|00005e80| 69 78 65 6c 73 28 20 74 | 68 65 50 69 78 4d 61 70 |ixels( t|hePixMap|
|00005e90| 20 29 3b 0d 09 09 0d 09 | 2f 2f 20 52 65 73 74 6f | );.....|// Resto|
|00005ea0| 72 65 20 74 68 65 20 73 | 61 76 65 64 20 70 6f 72 |re the s|aved por|
|00005eb0| 74 2f 64 65 76 69 63 65 | 0d 09 0d 09 09 53 65 74 |t/device|.....Set|
|00005ec0| 47 57 6f 72 6c 64 28 20 | 73 61 76 65 64 50 6f 72 |GWorld( |savedPor|
|00005ed0| 74 2c 20 73 61 76 65 64 | 44 65 76 69 63 65 20 29 |t, saved|Device )|
|00005ee0| 3b 0d 09 09 0d 09 2f 2f | 20 52 65 73 74 6f 72 65 |;.....//| Restore|
|00005ef0| 20 74 68 65 20 70 65 6e | 20 73 74 61 74 65 20 61 | the pen| state a|
|00005f00| 6e 64 20 63 6f 6c 6f 72 | 20 69 6e 66 6f 20 6f 66 |nd color| info of|
|00005f10| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00005f20| 20 77 69 6e 64 6f 77 0d | 09 0d 09 09 53 65 74 50 | window.|....SetP|
|00005f30| 65 6e 53 74 61 74 65 28 | 20 26 73 61 76 65 64 50 |enState(| &savedP|
|00005f40| 65 6e 20 29 3b 0d 09 09 | 52 47 42 46 6f 72 65 43 |en );...|RGBForeC|
|00005f50| 6f 6c 6f 72 28 20 26 73 | 61 76 65 64 46 6f 72 65 |olor( &s|avedFore|
|00005f60| 20 29 3b 0d 09 09 52 47 | 42 42 61 63 6b 43 6f 6c | );...RG|BBackCol|
|00005f70| 6f 72 28 20 26 73 61 76 | 65 64 42 61 63 6b 20 29 |or( &sav|edBack )|
|00005f80| 3b 0d 09 09 0d 09 2f 2f | 20 44 69 73 70 6f 73 65 |;.....//| Dispose|
|00005f90| 20 6f 66 20 74 68 65 20 | 47 57 6f 72 6c 64 0d 09 | of the |GWorld..|
|00005fa0| 0d 09 09 44 69 73 70 6f | 73 65 47 57 6f 72 6c 64 |...Dispo|seGWorld|
|00005fb0| 28 20 6f 66 66 73 63 72 | 65 65 6e 57 6f 72 6c 64 |( offscr|eenWorld|
|00005fc0| 20 29 3b 0d 7d 0d 0d 0d | 2f 2f 20 46 61 64 65 54 | );.}...|// FadeT|
|00005fd0| 6f 49 6d 61 67 65 20 74 | 61 6b 65 73 20 74 68 65 |oImage t|akes the|
|00005fe0| 20 73 6f 75 72 63 65 20 | 69 6d 61 67 65 20 61 6e | source |image an|
|00005ff0| 64 20 64 6f 65 73 20 61 | 20 73 6d 6f 6f 74 68 20 |d does a| smooth |
|00006000| 66 61 64 65 20 69 6e 0d | 2f 2f 20 74 68 65 20 64 |fade in.|// the d|
|00006010| 65 73 74 69 6e 61 74 69 | 6f 6e 20 77 69 6e 64 6f |estinati|on windo|
|00006020| 77 20 61 6e 64 20 72 65 | 63 74 20 66 72 6f 6d 20 |w and re|ct from |
|00006030| 74 68 65 20 69 6d 61 67 | 65 20 74 68 61 74 20 69 |the imag|e that i|
|00006040| 73 20 63 75 72 72 65 6e | 74 6c 79 0d 2f 2f 20 74 |s curren|tly.// t|
|00006050| 68 65 72 65 20 74 6f 20 | 74 68 65 20 73 6f 75 72 |here to |the sour|
|00006060| 63 65 20 69 6d 61 67 65 | 2e 20 54 68 69 73 20 69 |ce image|. This i|
|00006070| 73 20 64 6f 6e 65 20 75 | 73 69 6e 67 20 43 6f 70 |s done u|sing Cop|
|00006080| 79 42 69 74 73 20 77 69 | 74 68 0d 2f 2f 20 74 68 |yBits wi|th.// th|
|00006090| 65 20 22 62 6c 65 6e 64 | 22 20 74 72 61 6e 73 66 |e "blend|" transf|
|000060a0| 65 72 20 6d 6f 64 65 2e | 0d 2f 2f 0d 76 6f 69 64 |er mode.|.//.void|
|000060b0| 20 46 61 64 65 54 6f 49 | 6d 61 67 65 28 20 47 57 | FadeToI|mage( GW|
|000060c0| 6f 72 6c 64 50 74 72 20 | 73 72 63 49 6d 61 67 65 |orldPtr |srcImage|
|000060d0| 2c 20 52 65 63 74 20 2a | 73 72 63 52 65 63 74 2c |, Rect *|srcRect,|
|000060e0| 0d 09 57 69 6e 64 6f 77 | 50 74 72 20 64 65 73 74 |..Window|Ptr dest|
|000060f0| 57 69 6e 2c 20 52 65 63 | 74 20 2a 64 65 73 74 52 |Win, Rec|t *destR|
|00006100| 65 63 74 2c 20 73 68 6f | 72 74 20 66 61 64 65 53 |ect, sho|rt fadeS|
|00006110| 70 65 65 64 20 29 0d 7b | 0d 09 43 47 72 61 66 50 |peed ).{|..CGrafP|
|00006120| 74 72 09 09 09 73 61 76 | 65 64 50 6f 72 74 3b 0d |tr...sav|edPort;.|
|00006130| 09 47 44 48 61 6e 64 6c | 65 09 09 09 73 61 76 65 |.GDHandl|e...save|
|00006140| 64 44 65 76 69 63 65 3b | 0d 09 52 47 42 43 6f 6c |dDevice;|..RGBCol|
|00006150| 6f 72 09 09 09 73 61 76 | 65 64 46 6f 72 65 2c 20 |or...sav|edFore, |
|00006160| 73 61 76 65 64 42 61 63 | 6b 3b 0d 09 50 65 6e 53 |savedBac|k;..PenS|
|00006170| 74 61 74 65 09 09 09 73 | 61 76 65 64 50 65 6e 3b |tate...s|avedPen;|
|00006180| 0d 09 52 47 42 43 6f 6c | 6f 72 09 09 09 67 72 61 |..RGBCol|or...gra|
|00006190| 79 43 6f 6c 6f 72 3b 0d | 09 52 47 42 43 6f 6c 6f |yColor;.|.RGBColo|
|000061a0| 72 09 09 09 62 6c 61 63 | 6b 43 6f 6c 6f 72 3b 0d |r...blac|kColor;.|
|000061b0| 09 52 47 42 43 6f 6c 6f | 72 09 09 09 77 68 69 74 |.RGBColo|r...whit|
|000061c0| 65 43 6f 6c 6f 72 3b 0d | 09 66 6c 6f 61 74 09 09 |eColor;.|.float..|
|000061d0| 09 09 73 70 65 65 64 3b | 0d 09 75 6e 73 69 67 6e |..speed;|..unsign|
|000061e0| 65 64 20 73 68 6f 72 74 | 09 09 6c 61 73 74 43 6f |ed short|..lastCo|
|000061f0| 6c 6f 72 3b 0d 09 0d 09 | 2f 2f 20 4d 61 6b 65 20 |lor;....|// Make |
|00006200| 73 75 72 65 20 73 70 65 | 65 64 20 69 73 20 77 69 |sure spe|ed is wi|
|00006210| 74 68 69 6e 20 6f 75 72 | 20 6c 69 6d 69 74 73 20 |thin our| limits |
|00006220| 61 6e 64 20 73 65 74 20 | 69 74 20 61 70 70 72 6f |and set |it appro|
|00006230| 70 72 69 61 74 65 6c 79 | 2e 0d 09 2f 2f 20 57 65 |priately|...// We|
|00006240| 20 77 61 6e 74 20 74 6f | 20 65 6e 64 20 75 70 20 | want to| end up |
|00006250| 77 69 74 68 20 61 20 72 | 61 6e 67 65 20 6f 66 20 |with a r|ange of |
|00006260| 31 2e 32 20 74 6f 20 33 | 2e 32 20 66 72 6f 6d 20 |1.2 to 3|.2 from |
|00006270| 74 68 65 20 6f 72 69 67 | 69 6e 61 6c 0d 09 2f 2f |the orig|inal..//|
|00006280| 20 30 20 74 6f 20 32 30 | 20 72 61 6e 67 65 2e 0d | 0 to 20| range..|
|00006290| 09 0d 09 69 66 20 28 20 | 66 61 64 65 53 70 65 65 |...if ( |fadeSpee|
|000062a0| 64 20 3c 20 31 20 29 20 | 73 70 65 65 64 20 3d 20 |d < 1 ) |speed = |
|000062b0| 31 2e 32 3b 0d 09 65 6c | 73 65 20 69 66 20 28 20 |1.2;..el|se if ( |
|000062c0| 66 61 64 65 53 70 65 65 | 64 20 3e 20 32 30 20 29 |fadeSpee|d > 20 )|
|000062d0| 20 73 70 65 65 64 20 3d | 20 33 2e 32 3b 0d 09 65 | speed =| 3.2;..e|
|000062e0| 6c 73 65 20 73 70 65 65 | 64 20 3d 20 31 2e 32 20 |lse spee|d = 1.2 |
|000062f0| 2b 20 28 66 61 64 65 53 | 70 65 65 64 2f 31 30 29 |+ (fadeS|peed/10)|
|00006300| 3b 0d 09 0d 09 2f 2f 20 | 4d 61 6b 65 20 74 68 65 |;....// |Make the|
|00006310| 20 62 6c 61 63 6b 20 61 | 6e 64 20 77 68 69 74 65 | black a|nd white|
|00006320| 20 63 6f 6c 6f 72 73 0d | 09 0d 09 09 62 6c 61 63 | colors.|....blac|
|00006330| 6b 43 6f 6c 6f 72 2e 62 | 6c 75 65 20 3d 20 62 6c |kColor.b|lue = bl|
|00006340| 61 63 6b 43 6f 6c 6f 72 | 2e 67 72 65 65 6e 20 3d |ackColor|.green =|
|00006350| 20 62 6c 61 63 6b 43 6f | 6c 6f 72 2e 72 65 64 20 | blackCo|lor.red |
|00006360| 3d 20 30 3b 0d 09 09 77 | 68 69 74 65 43 6f 6c 6f |= 0;...w|hiteColo|
|00006370| 72 2e 62 6c 75 65 20 3d | 20 77 68 69 74 65 43 6f |r.blue =| whiteCo|
|00006380| 6c 6f 72 2e 67 72 65 65 | 6e 20 3d 20 77 68 69 74 |lor.gree|n = whit|
|00006390| 65 43 6f 6c 6f 72 2e 72 | 65 64 20 3d 20 30 78 46 |eColor.r|ed = 0xF|
|000063a0| 46 46 46 3b 0d 09 09 0d | 09 2f 2f 20 53 61 76 65 |FFF;....|.// Save|
|000063b0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 70 6f 72 | the cur|rent por|
|000063c0| 74 20 61 6e 64 20 64 65 | 76 69 63 65 0d 09 0d 09 |t and de|vice....|
|000063d0| 09 47 65 74 47 57 6f 72 | 6c 64 28 20 26 73 61 76 |.GetGWor|ld( &sav|
|000063e0| 65 64 50 6f 72 74 2c 20 | 26 73 61 76 65 64 44 65 |edPort, |&savedDe|
|000063f0| 76 69 63 65 20 29 3b 0d | 09 09 0d 09 2f 2f 20 53 |vice );.|....// S|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.