home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1999-08-28 | 37.1 KB | [ TEXT/CWIE]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
You can browse this item here: PixPort.cpp
Confidence Program Detection Match Type Support
10%
dexvert
MacBinary (archive/macBinary)
fallback
Supported
1%
dexvert
Text File (text/txt)
fallback
Supported
100%
file
MacBinary II, inited, Sat Aug 28 22:41:25 1999, modified Sat Aug 28 22:41:25 1999, creator 'CWIE', type ASCII, 37353 bytes "PixPort.cpp" , at 0x9269 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 key value macFileType [ TEXT] macFileCreator [ CWIE]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 0b 50 69 78 50 6f 72 | 74 2e 63 70 70 00 00 00 |..PixPor|t.cpp...| |00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |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 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......| |00000050| 00 00 00 00 00 91 e9 00 | 00 01 9a b3 ee 4e 55 b3 |........|.....NU.| |00000060| ee 4e 55 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.NU.....|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fd 14 00 00 |........|........| |00000080| 23 69 6e 63 6c 75 64 65 | 20 22 50 69 78 50 6f 72 |#include| "PixPor| |00000090| 74 2e 68 22 0d 0d 23 69 | 6e 63 6c 75 64 65 20 3c |t.h"..#i|nclude <| |000000a0| 6d 61 74 68 2e 68 3e 0d | 0d 23 69 66 20 45 47 5f |math.h>.|.#if EG_| |000000b0| 4d 41 43 0d 23 69 6e 63 | 6c 75 64 65 20 3c 51 75 |MAC.#inc|lude <Qu| |000000c0| 69 63 6b 44 72 61 77 2e | 68 3e 0d 23 69 6e 63 6c |ickDraw.|h>.#incl| |000000d0| 75 64 65 20 3c 51 44 4f | 66 66 73 63 72 65 65 6e |ude <QDO|ffscreen| |000000e0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 44 69 |.h>.#inc|lude <Di| |000000f0| 73 70 6c 61 79 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |splays.h|>.#inclu| |00000100| 64 65 20 3c 73 74 72 69 | 6e 67 2e 68 3e 0d 23 65 |de <stri|ng.h>.#e| |00000110| 6e 64 69 66 0d 0d 0d 6c | 6f 6e 67 09 09 50 69 78 |ndif...l|ong..Pix| |00000120| 50 6f 72 74 3a 3a 73 4f | 53 44 65 70 74 68 09 09 |Port::sO|SDepth..| |00000130| 09 3d 20 31 36 3b 0d 6c | 6f 6e 67 09 09 50 69 78 |.= 16;.l|ong..Pix| |00000140| 50 6f 72 74 3a 3a 73 4d | 69 6e 44 65 70 74 68 20 |Port::sM|inDepth | |00000150| 09 09 09 3d 20 31 36 3b | 0d 6c 6f 6e 67 09 09 50 |...= 16;|.long..P| |00000160| 69 78 50 6f 72 74 3a 3a | 73 43 61 6e 46 75 6c 6c |ixPort::|sCanFull| |00000170| 73 63 72 65 65 6e 09 09 | 3d 20 66 61 6c 73 65 3b |screen..|= false;| |00000180| 0d 0d 0d 09 0d 0d 76 6f | 69 64 20 50 69 78 50 6f |......vo|id PixPo| |00000190| 72 74 3a 3a 53 74 61 72 | 74 75 70 28 29 20 7b 0d |rt::Star|tup() {.| |000001a0| 0d 09 23 69 66 20 45 47 | 5f 4d 41 43 0d 09 23 69 |..#if EG|_MAC..#i| |000001b0| 66 20 55 53 45 5f 44 52 | 41 57 5f 53 50 52 4f 43 |f USE_DR|AW_SPROC| |000001c0| 4b 45 54 53 0d 09 4f 53 | 53 74 61 74 75 73 20 65 |KETS..OS|Status e| |000001d0| 72 72 20 3d 20 3a 3a 44 | 53 70 53 74 61 72 74 75 |rr = ::D|SpStartu| |000001e0| 70 28 29 3b 0d 09 73 43 | 61 6e 46 75 6c 6c 73 63 |p();..sC|anFullsc| |000001f0| 72 65 65 6e 20 3d 20 65 | 72 72 20 3d 3d 20 30 3b |reen = e|rr == 0;| |00000200| 0d 09 23 65 6c 73 65 0d | 09 73 43 61 6e 46 75 6c |..#else.|.sCanFul| |00000210| 6c 73 63 72 65 65 6e 20 | 3d 20 66 61 6c 73 65 3b |lscreen |= false;| |00000220| 0d 09 23 65 6e 64 69 66 | 0d 09 0d 09 47 44 48 61 |..#endif|....GDHa| |00000230| 6e 64 6c 65 20 67 44 65 | 76 69 63 65 20 3d 20 3a |ndle gDe|vice = :| |00000240| 3a 47 65 74 4d 61 69 6e | 44 65 76 69 63 65 28 29 |:GetMain|Device()| |00000250| 3b 0d 09 69 66 20 28 20 | 67 44 65 76 69 63 65 20 |;..if ( |gDevice | |00000260| 29 0d 09 09 73 4f 53 44 | 65 70 74 68 20 3d 20 28 |)...sOSD|epth = (| |00000270| 2a 2a 28 2a 2a 67 44 65 | 76 69 63 65 29 2e 67 64 |**(**gDe|vice).gd| |00000280| 50 4d 61 70 29 2e 70 69 | 78 65 6c 53 69 7a 65 3b |PMap).pi|xelSize;| |00000290| 0d 09 65 6c 73 65 0d 09 | 09 73 4f 53 44 65 70 74 |..else..|.sOSDept| |000002a0| 68 20 3d 20 31 36 3b 0d | 09 23 65 6e 64 69 66 0d |h = 16;.|.#endif.| |000002b0| 09 0d 09 23 69 66 20 45 | 47 5f 57 49 4e 0d 09 0d |...#if E|G_WIN...| |000002c0| 09 23 69 66 20 55 53 45 | 5f 44 49 52 45 43 54 58 |.#if USE|_DIRECTX| |000002d0| 0d 09 73 43 61 6e 46 75 | 6c 6c 73 63 72 65 65 6e |..sCanFu|llscreen| |000002e0| 20 3d 20 74 72 75 65 3b | 0d 09 23 65 6c 73 65 0d | = true;|..#else.| |000002f0| 09 73 43 61 6e 46 75 6c | 6c 73 63 72 65 65 6e 20 |.sCanFul|lscreen | |00000300| 3d 20 66 61 6c 73 65 3b | 0d 09 23 65 6e 64 69 66 |= false;|..#endif| |00000310| 0d 09 48 44 43 20 68 64 | 63 20 3d 20 3a 3a 47 65 |..HDC hd|c = ::Ge| |00000320| 74 44 43 28 20 4e 55 4c | 4c 20 29 3b 0d 09 73 4f |tDC( NUL|L );..sO| |00000330| 53 44 65 70 74 68 20 3d | 20 3a 3a 47 65 74 44 65 |SDepth =| ::GetDe| |00000340| 76 69 63 65 43 61 70 73 | 28 20 68 64 63 2c 20 42 |viceCaps|( hdc, B| |00000350| 49 54 53 50 49 58 45 4c | 20 29 3b 0d 09 3a 3a 52 |ITSPIXEL| );..::R| |00000360| 65 6c 65 61 73 65 44 43 | 28 20 4e 55 4c 4c 2c 20 |eleaseDC|( NULL, | |00000370| 68 64 63 20 29 3b 0d 09 | 23 65 6e 64 69 66 0d 09 |hdc );..|#endif..| |00000380| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 50 69 78 50 6f 72 |.}...voi|d PixPor| |00000390| 74 3a 3a 53 68 75 74 64 | 6f 77 6e 28 29 20 7b 0d |t::Shutd|own() {.| |000003a0| 0d 09 23 69 66 20 55 53 | 45 5f 44 52 41 57 5f 53 |..#if US|E_DRAW_S| |000003b0| 50 52 4f 43 4b 45 54 53 | 0d 09 69 66 20 28 20 73 |PROCKETS|..if ( s| |000003c0| 43 61 6e 46 75 6c 6c 73 | 63 72 65 65 6e 20 29 0d |CanFulls|creen ).| |000003d0| 09 09 3a 3a 44 53 70 53 | 68 75 74 64 6f 77 6e 28 |..::DSpS|hutdown(| |000003e0| 29 3b 0d 09 23 65 6e 64 | 69 66 0d 7d 0d 0d 0d 0d |);..#end|if.}....| |000003f0| 0d 50 69 78 50 6f 72 74 | 3a 3a 50 69 78 50 6f 72 |.PixPort|::PixPor| |00000400| 74 28 29 20 7b 0d 09 6d | 42 4d 20 3d 20 4e 55 4c |t() {..m|BM = NUL| |00000410| 4c 3b 0d 09 6d 57 6f 72 | 6c 64 20 3d 20 4e 55 4c |L;..mWor|ld = NUL| |00000420| 4c 3b 0d 09 6d 58 20 3d | 20 30 3b 0d 09 6d 59 20 |L;..mX =| 0;..mY | |00000430| 3d 20 30 3b 0d 09 6d 4c | 69 6e 65 57 69 64 74 68 |= 0;..mL|ineWidth| |00000440| 20 3d 20 31 3b 0d 09 6d | 42 61 63 6b 43 6f 6c 6f | = 1;..m|BackColo| |00000450| 72 09 3d 20 30 3b 0d 09 | 6d 43 6f 6e 74 65 78 74 |r.= 0;..|mContext| |00000460| 52 65 66 20 3d 20 30 3b | 0d 09 6d 42 79 74 65 73 |Ref = 0;|..mBytes| |00000470| 50 65 72 50 69 78 20 3d | 20 30 3b 0d 0d 09 23 69 |PerPix =| 0;...#i| |00000480| 66 20 45 47 5f 57 49 4e | 0d 09 6d 57 6f 72 6c 64 |f EG_WIN|..mWorld| |00000490| 09 09 3d 20 3a 3a 43 72 | 65 61 74 65 43 6f 6d 70 |..= ::Cr|eateComp| |000004a0| 61 74 69 62 6c 65 44 43 | 28 20 4e 55 4c 4c 20 29 |atibleDC|( NULL )| |000004b0| 3b 0d 09 6d 42 4d 09 09 | 09 3d 20 4e 55 4c 4c 3b |;..mBM..|.= NULL;| |000004c0| 0d 09 6d 44 44 4f 62 6a | 09 09 3d 20 4e 55 4c 4c |..mDDObj|..= NULL| |000004d0| 3b 0d 09 23 65 6e 64 69 | 66 0d 09 0d 09 23 69 66 |;..#endi|f....#if| |000004e0| 20 45 47 5f 4d 41 43 0d | 09 6d 48 6e 64 6c 53 69 | EG_MAC.|.mHndlSi| |000004f0| 7a 65 09 3d 20 30 3b 0d | 09 6d 54 65 6d 70 48 6e |ze.= 0;.|.mTempHn| |00000500| 64 6c 09 3d 20 4e 55 4c | 4c 3b 0d 09 23 65 6e 64 |dl.= NUL|L;..#end| |00000510| 69 66 0d 7d 0d 0d 0d 0d | 50 69 78 50 6f 72 74 3a |if.}....|PixPort:| |00000520| 3a 7e 50 69 78 50 6f 72 | 74 28 29 20 7b 0d 0d 09 |:~PixPor|t() {...| |00000530| 69 66 20 28 20 49 73 46 | 75 6c 6c 73 63 72 65 65 |if ( IsF|ullscree| |00000540| 6e 28 29 20 29 0d 09 09 | 44 65 61 63 74 69 76 61 |n() )...|Deactiva| |00000550| 74 65 28 29 3b 0d 0d 09 | 23 69 66 20 45 47 5f 4d |te();...|#if EG_M| |00000560| 41 43 0d 09 69 66 20 28 | 20 6d 57 6f 72 6c 64 20 |AC..if (| mWorld | |00000570| 29 20 7b 0d 09 09 3a 3a | 55 6e 6c 6f 63 6b 50 69 |) {...::|UnlockPi| |00000580| 78 65 6c 73 28 20 6d 42 | 4d 20 29 3b 0d 09 09 3a |xels( mB|M );...:| |00000590| 3a 44 69 73 70 6f 73 65 | 47 57 6f 72 6c 64 28 20 |:Dispose|GWorld( | |000005a0| 6d 57 6f 72 6c 64 20 29 | 3b 0d 09 7d 0d 09 0d 09 |mWorld )|;..}....| |000005b0| 4f 53 45 72 72 20 65 72 | 72 3b 0d 09 69 66 20 28 |OSErr er|r;..if (| |000005c0| 20 6d 54 65 6d 70 48 6e | 64 6c 20 29 0d 09 09 3a | mTempHn|dl )...:| |000005d0| 3a 54 65 6d 70 44 69 73 | 70 6f 73 65 48 61 6e 64 |:TempDis|poseHand| |000005e0| 6c 65 28 20 6d 54 65 6d | 70 48 6e 64 6c 2c 20 26 |le( mTem|pHndl, &| |000005f0| 65 72 72 20 29 3b 0d 09 | 23 65 6c 69 66 20 45 47 |err );..|#elif EG| |00000600| 5f 57 49 4e 0d 09 69 66 | 20 28 20 6d 57 6f 72 6c |_WIN..if| ( mWorl| |00000610| 64 20 29 0d 09 09 3a 3a | 44 65 6c 65 74 65 44 43 |d )...::|DeleteDC| |00000620| 28 20 6d 57 6f 72 6c 64 | 20 29 3b 0d 09 69 66 20 |( mWorld| );..if | |00000630| 28 20 6d 42 4d 20 29 0d | 09 09 3a 3a 44 65 6c 65 |( mBM ).|..::Dele| |00000640| 74 65 4f 62 6a 65 63 74 | 28 20 6d 42 4d 20 29 3b |teObject|( mBM );| |00000650| 09 0d 09 23 65 6e 64 69 | 66 0d 7d 0d 0d 0d 0d 0d |...#endi|f.}.....| |00000660| 0d 6c 6f 6e 67 20 50 69 | 78 50 6f 72 74 3a 3a 47 |.long Pi|xPort::G| |00000670| 65 74 4f 77 6e 69 6e 67 | 44 69 73 70 6c 61 79 28 |etOwning|Display(| |00000680| 20 63 6f 6e 73 74 20 50 | 6f 69 6e 74 26 20 69 6e | const P|oint& in| |00000690| 50 74 20 29 20 7b 0d 09 | 0d 09 23 69 66 20 45 47 |Pt ) {..|..#if EG| |000006a0| 5f 4d 41 43 0d 09 4f 53 | 53 74 61 74 75 73 09 09 |_MAC..OS|Status..| |000006b0| 09 65 72 72 3b 0d 09 44 | 69 73 70 6c 61 79 49 44 |.err;..D|isplayID| |000006c0| 54 79 70 65 09 09 69 64 | 20 3d 20 30 3b 0d 0d 0d |Type..id| = 0;...| |000006d0| 09 47 44 48 61 6e 64 6c | 65 20 74 68 65 47 44 65 |.GDHandl|e theGDe| |000006e0| 76 69 63 65 3b 0d 0d 09 | 2f 2a 0d 09 2a 2a 20 57 |vice;...|/*..** W| |000006f0| 61 6c 6b 20 74 68 65 20 | 6c 69 73 74 20 6f 66 20 |alk the |list of | |00000700| 64 69 73 70 6c 61 79 20 | 64 65 76 69 63 65 73 20 |display |devices | |00000710| 69 6e 20 74 68 65 20 73 | 79 73 74 65 6d 2e 20 20 |in the s|ystem. | |00000720| 44 72 61 77 53 70 72 6f | 63 6b 65 74 20 69 73 0d |DrawSpro|cket is.| |00000730| 09 2a 2a 20 63 65 6e 74 | 65 72 65 64 20 61 72 6f |.** cent|ered aro| |00000740| 75 6e 64 20 74 68 65 20 | 44 69 73 70 6c 61 79 49 |und the |DisplayI| |00000750| 44 54 79 70 65 2c 20 77 | 68 69 63 68 20 69 73 20 |DType, w|hich is | |00000760| 75 73 65 64 20 62 79 20 | 74 68 65 20 44 69 73 70 |used by |the Disp| |00000770| 6c 61 79 0d 09 2a 2a 20 | 4d 61 6e 61 67 65 72 2e |lay..** |Manager.| |00000780| 20 20 54 68 65 20 47 44 | 65 76 69 63 65 20 72 65 | The GD|evice re| |00000790| 63 6f 72 64 73 20 61 72 | 65 20 67 6f 69 6e 67 20 |cords ar|e going | |000007a0| 74 6f 20 62 65 20 69 6e | 20 66 6c 75 78 20 77 69 |to be in| flux wi| |000007b0| 74 68 20 66 75 74 75 72 | 65 0d 09 2a 2a 20 76 65 |th futur|e..** ve| |000007c0| 72 73 69 6f 6e 73 20 6f | 66 20 74 68 65 20 73 79 |rsions o|f the sy| |000007d0| 73 74 65 6d 20 73 6f 66 | 74 77 61 72 65 2c 20 73 |stem sof|tware, s| |000007e0| 6f 20 69 74 20 69 73 20 | 62 65 73 74 20 74 6f 20 |o it is |best to | |000007f0| 6d 61 6b 65 20 74 68 65 | 20 63 68 61 6e 67 65 0d |make the| change.| |00000800| 09 2a 2a 20 6e 6f 77 20 | 61 6e 64 20 6d 61 6b 65 |.** now |and make| |00000810| 20 79 6f 75 72 20 73 6f | 66 74 77 61 72 65 20 44 | your so|ftware D| |00000820| 69 73 70 6c 61 79 4d 61 | 6e 61 67 65 72 2d 63 65 |isplayMa|nager-ce| |00000830| 6e 74 72 69 63 2e 0d 09 | 2a 2f 0d 09 74 68 65 47 |ntric...|*/..theG| |00000840| 44 65 76 69 63 65 20 3d | 20 44 4d 47 65 74 46 69 |Device =| DMGetFi| |00000850| 72 73 74 53 63 72 65 65 | 6e 44 65 76 69 63 65 28 |rstScree|nDevice(| |00000860| 20 66 61 6c 73 65 20 29 | 3b 0d 09 77 68 69 6c 65 | false )|;..while| |00000870| 28 20 74 68 65 47 44 65 | 76 69 63 65 20 26 26 20 |( theGDe|vice && | |00000880| 21 20 69 64 20 29 20 7b | 0d 09 09 0d 09 09 69 66 |! id ) {|......if| |00000890| 20 28 20 3a 3a 50 74 49 | 6e 52 65 63 74 28 20 69 | ( ::PtI|nRect( i| |000008a0| 6e 50 74 2c 20 26 28 2a | 2a 74 68 65 47 44 65 76 |nPt, &(*|*theGDev| |000008b0| 69 63 65 29 2e 67 64 52 | 65 63 74 20 29 20 29 20 |ice).gdR|ect ) ) | |000008c0| 7b 0d 09 09 0d 09 09 09 | 2f 2a 20 67 65 74 20 74 |{.......|/* get t| |000008d0| 68 65 20 64 69 73 70 6c | 61 79 20 49 44 20 2a 2f |he displ|ay ID */| |000008e0| 0d 09 09 09 65 72 72 20 | 3d 20 44 4d 47 65 74 44 |....err |= DMGetD| |000008f0| 69 73 70 6c 61 79 49 44 | 42 79 47 44 65 76 69 63 |isplayID|ByGDevic| |00000900| 65 28 20 74 68 65 47 44 | 65 76 69 63 65 2c 20 26 |e( theGD|evice, &| |00000910| 69 64 2c 20 66 61 6c 73 | 65 20 29 3b 0d 09 09 09 |id, fals|e );....| |00000920| 69 66 20 28 20 65 72 72 | 20 29 0d 09 09 09 09 69 |if ( err| ).....i| |00000930| 64 20 3d 20 30 3b 0d 09 | 09 7d 0d 09 09 0d 09 09 |d = 0;..|.}......| |00000940| 2f 2a 20 6e 65 78 74 20 | 64 65 76 69 63 65 20 2a |/* next |device *| |00000950| 2f 0d 09 09 74 68 65 47 | 44 65 76 69 63 65 20 3d |/...theG|Device =| |00000960| 20 44 4d 47 65 74 4e 65 | 78 74 53 63 72 65 65 6e | DMGetNe|xtScreen| |00000970| 44 65 76 69 63 65 28 20 | 74 68 65 47 44 65 76 69 |Device( |theGDevi| |00000980| 63 65 2c 20 66 61 6c 73 | 65 20 29 3b 0d 09 7d 09 |ce, fals|e );..}.| |00000990| 0d 2f 2a 0d 09 65 72 72 | 20 3d 20 3a 3a 44 53 70 |./*..err| = ::DSp| |000009a0| 46 69 6e 64 43 6f 6e 74 | 65 78 74 46 72 6f 6d 50 |FindCont|extFromP| |000009b0| 6f 69 6e 74 28 20 69 6e | 50 74 2c 20 26 72 65 66 |oint( in|Pt, &ref| |000009c0| 20 29 3b 09 0d 09 69 66 | 20 28 20 21 20 65 72 72 | );...if| ( ! err| |000009d0| 20 29 0d 09 09 65 72 72 | 20 3d 20 3a 3a 44 53 70 | )...err| = ::DSp| |000009e0| 43 6f 6e 74 65 78 74 5f | 47 65 74 44 69 73 70 6c |Context_|GetDispl| |000009f0| 61 79 49 44 28 20 72 65 | 66 2c 20 26 69 64 20 29 |ayID( re|f, &id )| |00000a00| 3b 0d 2a 2f 0d 09 72 65 | 74 75 72 6e 20 28 20 65 |;.*/..re|turn ( e| |00000a10| 72 72 20 29 20 3f 20 30 | 20 3a 20 69 64 3b 0d 09 |rr ) ? 0| : id;..| |00000a20| 23 65 6e 64 69 66 0d 09 | 0d 09 23 69 66 20 45 47 |#endif..|..#if EG| |00000a30| 5f 57 49 4e 0d 09 23 70 | 72 61 67 6d 61 20 75 6e |_WIN..#p|ragma un| |00000a40| 75 73 65 64 20 28 20 69 | 6e 50 74 20 29 0d 09 72 |used ( i|nPt )..r| |00000a50| 65 74 75 72 6e 20 30 3b | 0d 09 23 65 6e 64 69 66 |eturn 0;|..#endif| |00000a60| 0d 7d 0d 0d 0d 0d 0d 0d | 0d 0d 0d 0d 0d 0d 0d 0d |.}......|........| |00000a70| 76 6f 69 64 20 50 69 78 | 50 6f 72 74 3a 3a 55 6e |void Pix|Port::Un| |00000a80| 69 6f 6e 44 69 72 74 79 | 52 65 63 74 28 20 63 6f |ionDirty|Rect( co| |00000a90| 6e 73 74 20 52 65 63 74 | 2a 20 69 6e 44 69 72 74 |nst Rect|* inDirt| |00000aa0| 79 52 65 63 74 20 29 20 | 7b 0d 09 0d 09 23 69 66 |yRect ) |{....#if| |00000ab0| 20 45 47 5f 4d 41 43 0d | 09 23 69 66 20 55 53 45 | EG_MAC.|.#if USE| |00000ac0| 5f 44 52 41 57 5f 53 50 | 52 4f 43 4b 45 54 53 0d |_DRAW_SP|ROCKETS.| |00000ad0| 09 69 66 20 28 20 49 73 | 46 75 6c 6c 73 63 72 65 |.if ( Is|Fullscre| |00000ae0| 65 6e 28 29 20 29 0d 09 | 09 3a 3a 44 53 70 43 6f |en() )..|.::DSpCo| |00000af0| 6e 74 65 78 74 5f 49 6e | 76 61 6c 42 61 63 6b 42 |ntext_In|valBackB| |00000b00| 75 66 66 65 72 52 65 63 | 74 28 20 6d 43 6f 6e 74 |ufferRec|t( mCont| |00000b10| 65 78 74 52 65 66 2c 20 | 69 6e 44 69 72 74 79 52 |extRef, |inDirtyR| |00000b20| 65 63 74 20 29 3b 09 0d | 09 23 65 6c 73 65 0d 09 |ect );..|.#else..| |00000b30| 23 70 72 61 67 6d 61 20 | 75 6e 75 73 65 64 20 28 |#pragma |unused (| |00000b40| 20 69 6e 44 69 72 74 79 | 52 65 63 74 20 29 0d 09 | inDirty|Rect )..| |00000b50| 23 65 6e 64 69 66 0d 09 | 23 65 6e 64 69 66 0d 09 |#endif..|#endif..| |00000b60| 0d 09 23 69 66 20 45 47 | 5f 57 49 4e 20 26 26 20 |..#if EG|_WIN && | |00000b70| 55 53 45 5f 44 49 52 45 | 43 54 58 0d 09 69 66 20 |USE_DIRE|CTX..if | |00000b80| 28 20 49 73 46 75 6c 6c | 73 63 72 65 65 6e 28 29 |( IsFull|screen()| |00000b90| 20 29 20 7b 0d 09 09 6c | 6f 6e 67 20 77 2c 20 68 | ) {...l|ong w, h| |00000ba0| 3b 0d 09 09 48 44 43 20 | 68 64 63 3b 0d 09 09 77 |;...HDC |hdc;...w| |00000bb0| 20 3d 20 69 6e 44 69 72 | 74 79 52 65 63 74 20 2d | = inDir|tyRect -| |00000bc0| 3e 20 72 69 67 68 74 20 | 2d 20 69 6e 44 69 72 74 |> right |- inDirt| |00000bd0| 79 52 65 63 74 20 2d 3e | 20 6c 65 66 74 3b 0d 09 |yRect ->| left;..| |00000be0| 09 68 20 3d 20 69 6e 44 | 69 72 74 79 52 65 63 74 |.h = inD|irtyRect| |00000bf0| 20 2d 3e 20 62 6f 74 74 | 6f 6d 20 2d 20 69 6e 44 | -> bott|om - inD| |00000c00| 69 72 74 79 52 65 63 74 | 20 2d 3e 20 74 6f 70 3b |irtyRect| -> top;| |00000c10| 0d 09 09 69 66 20 28 20 | 6d 43 6f 6e 74 65 78 74 |...if ( |mContext| |00000c20| 52 65 66 20 2d 3e 20 47 | 65 74 44 43 28 20 26 68 |Ref -> G|etDC( &h| |00000c30| 64 63 20 29 20 3d 3d 20 | 44 44 5f 4f 4b 20 29 20 |dc ) == |DD_OK ) | |00000c40| 7b 0d 09 09 09 3a 3a 42 | 69 74 42 6c 74 28 20 68 |{....::B|itBlt( h| |00000c50| 64 63 2c 20 69 6e 44 69 | 72 74 79 52 65 63 74 20 |dc, inDi|rtyRect | |00000c60| 2d 3e 20 6c 65 66 74 2c | 20 69 6e 44 69 72 74 79 |-> left,| inDirty| |00000c70| 52 65 63 74 20 2d 3e 20 | 74 6f 70 2c 20 77 2c 20 |Rect -> |top, w, | |00000c80| 68 2c 20 6d 57 6f 72 6c | 64 2c 20 69 6e 44 69 72 |h, mWorl|d, inDir| |00000c90| 74 79 52 65 63 74 20 2d | 3e 20 6c 65 66 74 2c 20 |tyRect -|> left, | |00000ca0| 69 6e 44 69 72 74 79 52 | 65 63 74 20 2d 3e 20 74 |inDirtyR|ect -> t| |00000cb0| 6f 70 2c 20 53 52 43 43 | 4f 50 59 20 29 3b 0d 09 |op, SRCC|OPY );..| |00000cc0| 09 09 6d 43 6f 6e 74 65 | 78 74 52 65 66 20 2d 3e |..mConte|xtRef ->| |00000cd0| 20 52 65 6c 65 61 73 65 | 44 43 28 20 68 64 63 20 | Release|DC( hdc | |00000ce0| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 09 23 65 6e 64 69 |);...}..|}..#endi| |00000cf0| 66 0d 7d 0d 0d 0d 0d 0d | 0d 0d 0d 62 6f 6f 6c 20 |f.}.....|...bool | |00000d00| 50 69 78 50 6f 72 74 3a | 3a 49 6e 69 74 46 75 6c |PixPort:|:InitFul| |00000d10| 6c 73 63 72 65 65 6e 28 | 20 69 6e 74 20 69 6e 44 |lscreen(| int inD| |00000d20| 69 73 70 4e 75 6d 2c 20 | 50 6f 69 6e 74 26 20 6f |ispNum, |Point& o| |00000d30| 75 74 53 69 7a 65 2c 20 | 57 69 6e 64 6f 77 50 74 |utSize, |WindowPt| |00000d40| 72 20 69 6e 57 69 6e 2c | 20 69 6e 74 20 69 6e 42 |r inWin,| int inB| |00000d50| 69 74 44 65 70 74 68 20 | 29 20 7b 0d 09 62 6f 6f |itDepth |) {..boo| |00000d60| 6c 20 6f 6b 20 3d 20 66 | 61 6c 73 65 3b 0d 09 0d |l ok = f|alse;...| |00000d70| 09 69 66 20 28 20 69 6e | 42 69 74 44 65 70 74 68 |.if ( in|BitDepth| |00000d80| 20 21 3d 20 38 20 7c 7c | 20 69 6e 42 69 74 44 65 | != 8 ||| inBitDe| |00000d90| 70 74 68 20 21 3d 20 31 | 36 20 7c 7c 20 69 6e 42 |pth != 1|6 || inB| |00000da0| 69 74 44 65 70 74 68 20 | 21 3d 20 33 32 20 29 0d |itDepth |!= 32 ).| |00000db0| 09 09 69 6e 42 69 74 44 | 65 70 74 68 20 3d 20 73 |..inBitD|epth = s| |00000dc0| 4f 53 44 65 70 74 68 3b | 0d 09 09 0d 09 2f 2f 20 |OSDepth;|.....// | |00000dd0| 49 66 20 77 65 27 72 65 | 20 61 6c 72 65 61 64 79 |If we're| already| |00000de0| 20 61 74 20 66 75 6c 6c | 73 63 72 65 65 6e 0d 09 | at full|screen..| |00000df0| 69 66 20 28 20 49 73 46 | 75 6c 6c 73 63 72 65 65 |if ( IsF|ullscree| |00000e00| 6e 28 29 20 29 20 7b 0d | 09 09 69 66 20 28 20 6d |n() ) {.|..if ( m| |00000e10| 42 79 74 65 73 50 65 72 | 50 69 78 20 2a 20 38 20 |BytesPer|Pix * 8 | |00000e20| 3d 3d 20 69 6e 42 69 74 | 44 65 70 74 68 20 29 0d |== inBit|Depth ).| |00000e30| 09 09 09 72 65 74 75 72 | 6e 20 74 72 75 65 3b 0d |...retur|n true;.| |00000e40| 09 09 65 6c 73 65 0d 09 | 09 09 44 65 61 63 74 69 |..else..|..Deacti| |00000e50| 76 61 74 65 28 29 3b 0d | 09 7d 0d 09 0d 09 0d 09 |vate();.|.}......| |00000e60| 23 69 66 20 45 47 5f 4d | 41 43 0d 09 0d 09 23 70 |#if EG_M|AC....#p| |00000e70| 72 61 67 6d 61 20 75 6e | 75 73 65 64 28 20 69 6e |ragma un|used( in| |00000e80| 57 69 6e 20 29 0d 09 0d | 09 23 69 66 20 55 53 45 |Win )...|.#if USE| |00000e90| 5f 44 52 41 57 5f 53 50 | 52 4f 43 4b 45 54 53 0d |_DRAW_SP|ROCKETS.| |00000ea0| 09 44 53 70 43 6f 6e 74 | 65 78 74 52 65 66 65 72 |.DSpCont|extRefer| |00000eb0| 65 6e 63 65 09 09 72 65 | 66 3b 0d 09 4f 53 53 74 |ence..re|f;..OSSt| |00000ec0| 61 74 75 73 09 09 09 09 | 65 72 72 3b 0d 09 44 53 |atus....|err;..DS| |00000ed0| 70 43 6f 6e 74 65 78 74 | 41 74 74 72 69 62 75 74 |pContext|Attribut| |00000ee0| 65 73 09 63 6f 6e 74 65 | 78 74 3b 0d 09 6c 6f 6e |es.conte|xt;..lon| |00000ef0| 67 09 09 09 09 09 62 65 | 73 74 57 69 64 74 68 20 |g.....be|stWidth | |00000f00| 3d 20 30 78 37 46 46 46 | 46 46 46 46 3b 0d 09 62 |= 0x7FFF|FFFF;..b| |00000f10| 6f 6f 6c 20 09 09 09 09 | 09 69 73 49 6e 69 74 74 |ool ....|.isInitt| |00000f20| 65 64 20 3d 20 66 61 6c | 73 65 3b 0d 0d 09 69 66 |ed = fal|se;...if| |00000f30| 20 28 20 73 43 61 6e 46 | 75 6c 6c 73 63 72 65 65 | ( sCanF|ullscree| |00000f40| 6e 20 29 20 7b 0d 09 09 | 65 72 72 20 3d 20 3a 3a |n ) {...|err = ::| |00000f50| 44 53 70 47 65 74 46 69 | 72 73 74 43 6f 6e 74 65 |DSpGetFi|rstConte| |00000f60| 78 74 28 20 69 6e 44 69 | 73 70 4e 75 6d 2c 20 26 |xt( inDi|spNum, &| |00000f70| 72 65 66 20 29 3b 0d 09 | 09 0d 09 09 2f 2f 20 4c |ref );..|....// L| |00000f80| 6f 6f 6b 20 66 6f 72 20 | 73 6d 61 6c 6c 65 73 74 |ook for |smallest| |00000f90| 20 73 69 7a 65 20 77 2f | 20 66 6f 72 20 67 69 76 | size w/| for giv| |00000fa0| 65 6e 20 64 65 70 74 68 | 0d 09 09 77 68 69 6c 65 |en depth|...while| |00000fb0| 20 28 20 21 20 65 72 72 | 20 29 20 7b 0d 09 09 09 | ( ! err| ) {....| |00000fc0| 65 72 72 20 3d 20 44 53 | 70 43 6f 6e 74 65 78 74 |err = DS|pContext| |00000fd0| 5f 47 65 74 41 74 74 72 | 69 62 75 74 65 73 28 20 |_GetAttr|ibutes( | |00000fe0| 72 65 66 2c 20 26 63 6f | 6e 74 65 78 74 20 29 3b |ref, &co|ntext );| |00000ff0| 0d 09 09 09 69 66 20 28 | 20 21 20 65 72 72 20 29 |....if (| ! err )| |00001000| 20 7b 0d 09 09 09 09 69 | 66 20 28 20 63 6f 6e 74 | {.....i|f ( cont| |00001010| 65 78 74 2e 64 69 73 70 | 6c 61 79 57 69 64 74 68 |ext.disp|layWidth| |00001020| 20 3c 3d 20 62 65 73 74 | 57 69 64 74 68 20 26 26 | <= best|Width &&| |00001030| 20 63 6f 6e 74 65 78 74 | 2e 64 69 73 70 6c 61 79 | context|.display| |00001040| 57 69 64 74 68 20 3e 3d | 20 36 34 30 20 29 20 7b |Width >=| 640 ) {| |00001050| 0d 09 09 09 09 09 69 66 | 20 28 20 63 6f 6e 74 65 |......if| ( conte| |00001060| 78 74 2e 64 69 73 70 6c | 61 79 42 65 73 74 44 65 |xt.displ|ayBestDe| |00001070| 70 74 68 20 3d 3d 20 69 | 6e 42 69 74 44 65 70 74 |pth == i|nBitDept| |00001080| 68 20 29 20 7b 0d 09 09 | 09 09 09 09 6d 43 6f 6e |h ) {...|....mCon| |00001090| 74 65 78 74 52 65 66 20 | 3d 20 72 65 66 3b 0d 09 |textRef |= ref;..| |000010a0| 09 09 09 09 09 69 73 49 | 6e 69 74 74 65 64 20 3d |.....isI|nitted =| |000010b0| 20 74 72 75 65 3b 0d 09 | 09 09 09 09 09 62 65 73 | true;..|.....bes| |000010c0| 74 57 69 64 74 68 20 3d | 20 63 6f 6e 74 65 78 74 |tWidth =| context| |000010d0| 2e 64 69 73 70 6c 61 79 | 57 69 64 74 68 3b 0d 09 |.display|Width;..| |000010e0| 09 09 09 09 7d 0d 09 09 | 09 09 7d 0d 09 09 09 7d |....}...|..}....}| |000010f0| 0d 09 09 09 0d 09 09 09 | 2f 2f 20 54 72 79 20 74 |........|// Try t| |00001100| 68 65 20 6e 65 78 74 20 | 63 6f 6e 74 65 78 74 20 |he next |context | |00001110| 66 6f 72 20 74 68 69 73 | 20 64 69 73 70 6c 61 79 |for this| display| |00001120| 0d 09 09 09 65 72 72 20 | 3d 20 3a 3a 44 53 70 47 |....err |= ::DSpG| |00001130| 65 74 4e 65 78 74 43 6f | 6e 74 65 78 74 28 20 72 |etNextCo|ntext( r| |00001140| 65 66 2c 20 26 72 65 66 | 20 29 3b 0d 09 09 7d 0d |ef, &ref| );...}.| |00001150| 09 09 0d 09 09 69 66 20 | 28 20 21 20 69 73 49 6e |.....if |( ! isIn| |00001160| 69 74 74 65 64 20 29 20 | 7b 0d 09 09 09 6d 43 6f |itted ) |{....mCo| |00001170| 6e 74 65 78 74 52 65 66 | 20 3d 20 30 3b 0d 09 09 |ntextRef| = 0;...| |00001180| 09 72 65 74 75 72 6e 20 | 66 61 6c 73 65 3b 0d 09 |.return |false;..| |00001190| 09 7d 0d 09 09 09 0d 09 | 09 3a 3a 44 53 70 43 6f |.}......|.::DSpCo| |000011a0| 6e 74 65 78 74 5f 47 65 | 74 41 74 74 72 69 62 75 |ntext_Ge|tAttribu| |000011b0| 74 65 73 28 20 6d 43 6f | 6e 74 65 78 74 52 65 66 |tes( mCo|ntextRef| |000011c0| 2c 20 26 6d 43 6f 6e 74 | 65 78 74 20 29 3b 0d 09 |, &mCont|ext );..| |000011d0| 09 6f 75 74 53 69 7a 65 | 2e 68 20 3d 20 6d 43 6f |.outSize|.h = mCo| |000011e0| 6e 74 65 78 74 2e 64 69 | 73 70 6c 61 79 57 69 64 |ntext.di|splayWid| |000011f0| 74 68 3b 0d 09 09 6f 75 | 74 53 69 7a 65 2e 76 20 |th;...ou|tSize.v | |00001200| 3d 20 6d 43 6f 6e 74 65 | 78 74 2e 64 69 73 70 6c |= mConte|xt.displ| |00001210| 61 79 48 65 69 67 68 74 | 3b 0d 09 09 0d 09 09 2f |ayHeight|;....../| |00001220| 2a 0d 09 09 2a 2a 20 48 | 65 72 65 20 69 73 20 77 |*...** H|ere is w| |00001230| 68 65 72 65 20 49 20 6e | 65 65 64 20 74 6f 20 4f |here I n|eed to O| |00001240| 52 20 69 6e 20 74 68 65 | 20 76 61 6c 75 65 20 74 |R in the| value t| |00001250| 6f 20 75 73 65 20 70 61 | 67 65 20 66 6c 69 70 70 |o use pa|ge flipp| |00001260| 69 6e 67 2e 20 20 49 66 | 0d 09 09 2a 2a 20 49 20 |ing. If|...** I | |00001270| 68 61 64 20 75 73 65 64 | 20 74 68 65 20 76 61 6c |had used| the val| |00001280| 75 65 20 77 68 65 6e 20 | 63 61 6c 6c 69 6e 67 20 |ue when |calling | |00001290| 44 53 70 46 69 6e 64 42 | 65 73 74 43 6f 6e 74 65 |DSpFindB|estConte| |000012a0| 78 74 28 29 20 74 68 65 | 6e 20 69 74 20 77 6f 75 |xt() the|n it wou| |000012b0| 6c 64 0d 09 09 2a 2a 20 | 68 61 76 65 20 6f 6e 6c |ld...** |have onl| |000012c0| 79 20 63 6f 6e 73 69 64 | 65 72 65 64 20 64 69 73 |y consid|ered dis| |000012d0| 70 6c 61 79 73 20 74 68 | 61 74 20 68 61 76 65 20 |plays th|at have | |000012e0| 70 61 67 65 20 66 6c 69 | 70 70 69 6e 67 20 68 61 |page fli|pping ha| |000012f0| 72 64 77 61 72 65 2c 20 | 62 75 74 0d 09 09 2a 2a |rdware, |but...**| |00001300| 20 49 20 77 61 6e 74 20 | 74 6f 20 72 75 6e 20 77 | I want |to run w| |00001310| 69 74 68 20 73 6f 66 74 | 77 61 72 65 20 62 75 66 |ith soft|ware buf| |00001320| 66 65 72 69 6e 67 20 74 | 6f 6f 2e 0d 09 09 2a 2f |fering t|oo....*/| |00001330| 0d 09 09 6d 43 6f 6e 74 | 65 78 74 2e 63 6f 6e 74 |...mCont|ext.cont| |00001340| 65 78 74 4f 70 74 69 6f | 6e 73 20 09 09 09 3d 20 |extOptio|ns ...= | |00001350| 6b 44 53 70 43 6f 6e 74 | 65 78 74 4f 70 74 69 6f |kDSpCont|extOptio| |00001360| 6e 5f 50 61 67 65 46 6c | 69 70 3b 0d 09 09 6d 43 |n_PageFl|ip;...mC| |00001370| 6f 6e 74 65 78 74 2e 66 | 72 65 71 75 65 6e 63 79 |ontext.f|requency| |00001380| 09 09 09 09 09 3d 20 30 | 3b 0d 09 09 6d 43 6f 6e |.....= 0|;...mCon| |00001390| 74 65 78 74 2e 72 65 73 | 65 72 76 65 64 31 09 09 |text.res|erved1..| |000013a0| 09 09 09 3d 20 30 3b 0d | 09 09 6d 43 6f 6e 74 65 |...= 0;.|..mConte| |000013b0| 78 74 2e 72 65 73 65 72 | 76 65 64 32 09 09 09 09 |xt.reser|ved2....| |000013c0| 09 3d 20 30 3b 0d 09 09 | 6d 43 6f 6e 74 65 78 74 |.= 0;...|mContext| |000013d0| 2e 67 61 6d 65 4d 75 73 | 74 43 6f 6e 66 69 72 6d |.gameMus|tConfirm| |000013e0| 53 77 69 74 63 68 09 09 | 3d 20 66 61 6c 73 65 3b |Switch..|= false;| |000013f0| 0d 09 09 6d 43 6f 6e 74 | 65 78 74 2e 72 65 73 65 |...mCont|ext.rese| |00001400| 72 76 65 64 33 5b 30 5d | 09 3d 20 30 3b 0d 09 09 |rved3[0]|.= 0;...| |00001410| 6d 43 6f 6e 74 65 78 74 | 2e 72 65 73 65 72 76 65 |mContext|.reserve| |00001420| 64 33 5b 31 5d 09 3d 20 | 30 3b 0d 09 09 6d 43 6f |d3[1].= |0;...mCo| |00001430| 6e 74 65 78 74 2e 72 65 | 73 65 72 76 65 64 33 5b |ntext.re|served3[| |00001440| 32 5d 09 3d 20 30 3b 0d | 09 09 6d 43 6f 6e 74 65 |2].= 0;.|..mConte| |00001450| 78 74 2e 72 65 73 65 72 | 76 65 64 33 5b 33 5d 09 |xt.reser|ved3[3].| |00001460| 3d 20 30 3b 0d 09 09 6d | 43 6f 6e 74 65 78 74 2e |= 0;...m|Context.| |00001470| 63 6f 6c 6f 72 54 61 62 | 6c 65 09 09 3d 20 30 3b |colorTab|le..= 0;| |00001480| 0d 09 09 6d 43 6f 6e 74 | 65 78 74 2e 70 61 67 65 |...mCont|ext.page| |00001490| 43 6f 75 6e 74 09 09 3d | 20 30 3b 0d 09 09 6d 43 |Count..=| 0;...mC| |000014a0| 6f 6e 74 65 78 74 2e 63 | 6f 6c 6f 72 4e 65 65 64 |ontext.c|olorNeed| |000014b0| 73 09 09 3d 20 6b 44 53 | 70 43 6f 6c 6f 72 4e 65 |s..= kDS|pColorNe| |000014c0| 65 64 73 5f 52 65 71 75 | 69 72 65 3b 0d 09 09 09 |eds_Requ|ire;....| |000014d0| 09 09 09 0d 09 09 2f 2f | 20 54 72 79 20 74 6f 20 |......//| Try to | |000014e0| 72 65 73 65 72 76 65 20 | 74 68 65 20 64 65 76 69 |reserve |the devi| |000014f0| 63 65 0d 09 09 65 72 72 | 20 3d 20 3a 3a 44 53 70 |ce...err| = ::DSp| |00001500| 43 6f 6e 74 65 78 74 5f | 52 65 73 65 72 76 65 28 |Context_|Reserve(| |00001510| 20 6d 43 6f 6e 74 65 78 | 74 52 65 66 2c 20 26 6d | mContex|tRef, &m| |00001520| 43 6f 6e 74 65 78 74 20 | 29 3b 0d 09 09 69 66 20 |Context |);...if | |00001530| 28 20 65 72 72 20 29 20 | 7b 0d 09 09 09 6d 43 6f |( err ) |{....mCo| |00001540| 6e 74 65 78 74 52 65 66 | 20 3d 20 30 3b 0d 09 09 |ntextRef| = 0;...| |00001550| 09 72 65 74 75 72 6e 20 | 66 61 6c 73 65 3b 0d 09 |.return |false;..| |00001560| 09 7d 0d 09 09 09 0d 09 | 09 2f 2f 20 49 66 20 6e |.}......|.// If n| |00001570| 6f 20 65 72 72 6f 72 73 | 2c 20 27 61 63 74 69 76 |o errors|, 'activ| |00001580| 61 74 65 27 20 74 68 65 | 20 64 65 76 69 63 65 20 |ate' the| device | |00001590| 69 6e 74 6f 20 66 75 6c | 6c 73 63 72 65 65 6e 0d |into ful|lscreen.| |000015a0| 09 09 3a 3a 48 69 64 65 | 43 75 72 73 6f 72 28 29 |..::Hide|Cursor()| |000015b0| 3b 0d 0d 09 09 3a 3a 44 | 53 70 43 6f 6e 74 65 78 |;....::D|SpContex| |000015c0| 74 5f 46 61 64 65 47 61 | 6d 6d 61 4f 75 74 28 20 |t_FadeGa|mmaOut( | |000015d0| 6d 43 6f 6e 74 65 78 74 | 52 65 66 2c 20 4e 55 4c |mContext|Ref, NUL| |000015e0| 4c 20 29 3b 0d 0d 09 09 | 65 72 72 20 3d 20 3a 3a |L );....|err = ::| |000015f0| 44 53 70 43 6f 6e 74 65 | 78 74 5f 53 65 74 53 74 |DSpConte|xt_SetSt| |00001600| 61 74 65 28 20 6d 43 6f | 6e 74 65 78 74 52 65 66 |ate( mCo|ntextRef| |00001610| 2c 20 6b 44 53 70 43 6f | 6e 74 65 78 74 53 74 61 |, kDSpCo|ntextSta| |00001620| 74 65 5f 41 63 74 69 76 | 65 20 29 3b 0d 09 09 0d |te_Activ|e );....| |00001630| 09 09 69 66 20 28 20 65 | 72 72 20 29 0d 09 09 09 |..if ( e|rr )....| |00001640| 3a 3a 44 53 70 43 6f 6e | 74 65 78 74 5f 52 65 6c |::DSpCon|text_Rel| |00001650| 65 61 73 65 28 20 6d 43 | 6f 6e 74 65 78 74 52 65 |ease( mC|ontextRe| |00001660| 66 20 29 3b 0d 09 09 65 | 6c 73 65 20 7b 0d 09 09 |f );...e|lse {...| |00001670| 0d 09 09 09 42 65 67 69 | 6e 46 72 61 6d 65 28 29 |....Begi|nFrame()| |00001680| 3b 0d 09 09 09 0d 09 09 | 09 2f 2f 20 4c 6f 61 64 |;.......|.// Load| |00001690| 20 74 68 65 20 6b 65 79 | 20 69 6e 66 6f 20 61 62 | the key| info ab| |000016a0| 6f 75 74 20 74 68 65 20 | 66 75 6c 6c 73 63 72 65 |out the |fullscre| |000016b0| 65 6e 20 6d 6f 64 65 09 | 09 09 0d 09 09 09 69 66 |en mode.|......if| |000016c0| 20 28 20 6d 42 4d 20 29 | 20 7b 0d 09 09 09 0d 09 | ( mBM )| {......| |000016d0| 09 09 09 2f 2f 20 49 66 | 20 77 65 20 68 61 76 65 |...// If| we have| |000016e0| 20 61 6e 20 6f 66 66 73 | 63 72 65 65 6e 20 77 6f | an offs|creen wo| |000016f0| 72 6c 64 20 61 6c 6c 6f | 63 61 74 65 64 2c 20 63 |rld allo|cated, c| |00001700| 68 75 63 6b 20 69 74 0d | 09 09 09 09 69 66 20 28 |huck it.|....if (| |00001710| 20 6d 57 6f 72 6c 64 20 | 29 20 7b 0d 09 09 09 09 | mWorld |) {.....| |00001720| 09 3a 3a 55 6e 6c 6f 63 | 6b 50 69 78 65 6c 73 28 |.::Unloc|kPixels(| |00001730| 20 6d 42 4d 20 29 3b 0d | 09 09 09 09 09 3a 3a 44 | mBM );.|.....::D| |00001740| 69 73 70 6f 73 65 47 57 | 6f 72 6c 64 28 20 6d 57 |isposeGW|orld( mW| |00001750| 6f 72 6c 64 20 29 3b 0d | 09 09 09 09 09 6d 57 6f |orld );.|.....mWo| |00001760| 72 6c 64 20 3d 20 4e 55 | 4c 4c 3b 0d 09 09 09 09 |rld = NU|LL;.....| |00001770| 7d 0d 0d 09 09 09 09 6d | 42 79 74 65 73 50 65 72 |}......m|BytesPer| |00001780| 52 6f 77 09 3d 20 28 2a | 2a 6d 42 4d 29 2e 72 6f |Row.= (*|*mBM).ro| |00001790| 77 42 79 74 65 73 20 26 | 20 30 78 46 46 46 3b 0d |wBytes &| 0xFFF;.| |000017a0| 09 09 09 09 6d 42 79 74 | 65 73 50 65 72 50 69 78 |....mByt|esPerPix| |000017b0| 09 3d 20 28 2a 2a 6d 42 | 4d 29 2e 70 69 78 65 6c |.= (**mB|M).pixel| |000017c0| 53 69 7a 65 20 2f 20 38 | 3b 0d 09 09 09 09 6d 58 |Size / 8|;.....mX| |000017d0| 09 09 09 09 3d 20 28 2a | 2a 6d 42 4d 29 2e 62 6f |....= (*|*mBM).bo| |000017e0| 75 6e 64 73 2e 72 69 67 | 68 74 20 2d 20 28 2a 2a |unds.rig|ht - (**| |000017f0| 6d 42 4d 29 2e 62 6f 75 | 6e 64 73 2e 6c 65 66 74 |mBM).bou|nds.left| |00001800| 3b 0d 09 09 09 09 6d 59 | 09 09 09 09 3d 20 28 2a |;.....mY|....= (*| |00001810| 2a 6d 42 4d 29 2e 62 6f | 75 6e 64 73 2e 62 6f 74 |*mBM).bo|unds.bot| |00001820| 74 6f 6d 20 2d 20 28 2a | 2a 6d 42 4d 29 2e 62 6f |tom - (*|*mBM).bo| |00001830| 75 6e 64 73 2e 74 6f 70 | 20 2d 20 31 3b 0d 09 09 |unds.top| - 1;...| |00001840| 09 09 6f 6b 20 3d 20 74 | 72 75 65 3b 0d 09 09 09 |..ok = t|rue;....| |00001850| 7d 0d 09 09 7d 0d 09 09 | 3a 3a 44 53 70 43 6f 6e |}...}...|::DSpCon| |00001860| 74 65 78 74 5f 46 61 64 | 65 47 61 6d 6d 61 28 20 |text_Fad|eGamma( | |00001870| 6d 43 6f 6e 74 65 78 74 | 52 65 66 2c 20 31 30 30 |mContext|Ref, 100| |00001880| 2c 20 4e 55 4c 4c 20 29 | 3b 0d 09 7d 0d 09 23 65 |, NULL )|;..}..#e| |00001890| 6c 73 65 0d 09 23 70 72 | 61 67 6d 61 20 75 6e 75 |lse..#pr|agma unu| |000018a0| 73 65 64 28 20 69 6e 44 | 69 73 70 4e 75 6d 2c 20 |sed( inD|ispNum, | |000018b0| 6f 75 74 53 69 7a 65 20 | 29 0d 09 23 65 6e 64 69 |outSize |)..#endi| |000018c0| 66 0d 09 23 65 6e 64 69 | 66 0d 09 0d 09 23 69 66 |f..#endi|f....#if| |000018d0| 20 45 47 5f 57 49 4e 0d | 09 0d 09 23 70 72 61 67 | EG_WIN.|...#prag| |000018e0| 6d 61 20 75 6e 75 73 65 | 64 28 20 69 6e 44 69 73 |ma unuse|d( inDis| |000018f0| 70 4e 75 6d 20 29 0d 09 | 0d 09 23 69 66 20 55 53 |pNum )..|..#if US| |00001900| 45 5f 44 49 52 45 43 54 | 58 0d 09 69 66 20 28 20 |E_DIRECT|X..if ( | |00001910| 73 43 61 6e 46 75 6c 6c | 73 63 72 65 65 6e 20 29 |sCanFull|screen )| |00001920| 20 7b 0d 09 09 48 52 45 | 53 55 4c 54 20 65 72 72 | {...HRE|SULT err| |00001930| 20 3d 20 3a 3a 44 69 72 | 65 63 74 44 72 61 77 43 | = ::Dir|ectDrawC| |00001940| 72 65 61 74 65 28 20 4e | 55 4c 4c 2c 20 26 6d 44 |reate( N|ULL, &mD| |00001950| 44 4f 62 6a 2c 20 4e 55 | 4c 4c 20 29 3b 0d 09 09 |DObj, NU|LL );...| |00001960| 69 66 20 28 20 65 72 72 | 20 3d 3d 20 44 44 5f 4f |if ( err| == DD_O| |00001970| 4b 20 29 20 7b 0d 09 09 | 09 4c 50 44 49 52 45 43 |K ) {...|.LPDIREC| |00001980| 54 44 52 41 57 53 55 52 | 46 41 43 45 20 63 6f 6e |TDRAWSUR|FACE con| |00001990| 74 65 78 74 3b 0d 09 09 | 09 0d 09 09 09 65 72 72 |text;...|.....err| |000019a0| 20 3d 20 6d 44 44 4f 62 | 6a 20 2d 3e 20 53 65 74 | = mDDOb|j -> Set| |000019b0| 43 6f 6f 70 65 72 61 74 | 69 76 65 4c 65 76 65 6c |Cooperat|iveLevel| |000019c0| 28 20 69 6e 57 69 6e 2c | 20 44 44 53 43 4c 5f 45 |( inWin,| DDSCL_E| |000019d0| 58 43 4c 55 53 49 56 45 | 20 7c 20 44 44 53 43 4c |XCLUSIVE| | DDSCL| |000019e0| 5f 46 55 4c 4c 53 43 52 | 45 45 4e 29 3b 0d 09 09 |_FULLSCR|EEN);...| |000019f0| 09 69 66 20 28 20 65 72 | 72 20 3d 3d 20 44 44 5f |.if ( er|r == DD_| |00001a00| 4f 4b 20 29 20 7b 0d 09 | 09 09 09 65 72 72 20 3d |OK ) {..|...err =| |00001a10| 20 6d 44 44 4f 62 6a 20 | 2d 3e 20 53 65 74 44 69 | mDDObj |-> SetDi| |00001a20| 73 70 6c 61 79 4d 6f 64 | 65 28 20 36 34 30 2c 20 |splayMod|e( 640, | |00001a30| 34 38 30 2c 20 69 6e 42 | 69 74 44 65 70 74 68 20 |480, inB|itDepth | |00001a40| 29 3b 0d 09 09 09 09 69 | 66 20 28 20 65 72 72 20 |);.....i|f ( err | |00001a50| 3d 3d 20 44 44 5f 4f 4b | 20 29 20 7b 0d 09 09 09 |== DD_OK| ) {....| |00001a60| 09 09 44 44 53 55 52 46 | 41 43 45 44 45 53 43 20 |..DDSURF|ACEDESC | |00001a70| 64 64 73 64 3b 0d 09 09 | 09 09 09 64 64 73 64 2e |ddsd;...|...ddsd.| |00001a80| 64 77 53 69 7a 65 20 3d | 20 73 69 7a 65 6f 66 28 |dwSize =| sizeof(| |00001a90| 64 64 73 64 29 3b 0d 09 | 09 09 09 09 64 64 73 64 |ddsd);..|....ddsd| |00001aa0| 2e 64 77 46 6c 61 67 73 | 20 3d 20 44 44 53 44 5f |.dwFlags| = DDSD_| |00001ab0| 43 41 50 53 3b 0d 09 09 | 09 09 09 64 64 73 64 2e |CAPS;...|...ddsd.| |00001ac0| 64 64 73 43 61 70 73 2e | 64 77 43 61 70 73 20 3d |ddsCaps.|dwCaps =| |00001ad0| 20 44 44 53 43 41 50 53 | 5f 50 52 49 4d 41 52 59 | DDSCAPS|_PRIMARY| |00001ae0| 53 55 52 46 41 43 45 3b | 0d 09 09 09 09 09 65 72 |SURFACE;|......er| |00001af0| 72 20 3d 20 6d 44 44 4f | 62 6a 20 2d 3e 20 43 72 |r = mDDO|bj -> Cr| |00001b00| 65 61 74 65 53 75 72 66 | 61 63 65 28 20 26 64 64 |eateSurf|ace( &dd| |00001b10| 73 64 2c 20 26 63 6f 6e | 74 65 78 74 2c 20 4e 55 |sd, &con|text, NU| |00001b20| 4c 4c 29 3b 0d 09 09 09 | 09 7d 0d 09 09 09 7d 0d |LL);....|.}....}.| |00001b30| 09 09 09 0d 09 09 09 69 | 66 20 28 20 65 72 72 20 |.......i|f ( err | |00001b40| 3d 3d 20 44 44 5f 4f 4b | 20 29 20 7b 0d 09 09 09 |== DD_OK| ) {....| |00001b50| 09 49 6e 69 74 28 20 36 | 34 30 2c 20 34 38 30 2c |.Init( 6|40, 480,| |00001b60| 20 69 6e 42 69 74 44 65 | 70 74 68 20 29 3b 0d 09 | inBitDe|pth );..| |00001b70| 09 09 09 6d 43 6f 6e 74 | 65 78 74 52 65 66 20 3d |...mCont|extRef =| |00001b80| 20 63 6f 6e 74 65 78 74 | 3b 0d 09 09 09 09 6f 75 | context|;.....ou| |00001b90| 74 53 69 7a 65 2e 68 20 | 3d 20 36 34 30 3b 0d 09 |tSize.h |= 640;..| |00001ba0| 09 09 09 6f 75 74 53 69 | 7a 65 2e 76 20 3d 20 34 |...outSi|ze.v = 4| |00001bb0| 38 30 3b 0d 09 09 09 09 | 3a 3a 53 65 74 46 6f 72 |80;.....|::SetFor| |00001bc0| 65 67 72 6f 75 6e 64 57 | 69 6e 64 6f 77 28 20 69 |egroundW|indow( i| |00001bd0| 6e 57 69 6e 20 29 3b 0d | 09 09 09 09 3a 3a 53 65 |nWin );.|....::Se| |00001be0| 74 43 61 70 74 75 72 65 | 28 20 69 6e 57 69 6e 20 |tCapture|( inWin | |00001bf0| 29 3b 0d 09 09 09 09 3a | 3a 53 68 6f 77 43 75 72 |);.....:|:ShowCur| |00001c00| 73 6f 72 28 20 66 61 6c | 73 65 20 29 3b 0d 09 09 |sor( fal|se );...| |00001c10| 09 09 6f 6b 20 3d 20 74 | 72 75 65 3b 20 7d 0d 09 |..ok = t|rue; }..| |00001c20| 09 09 65 6c 73 65 20 7b | 0d 09 09 09 09 20 6d 44 |..else {|..... mD| |00001c30| 44 4f 62 6a 20 2d 3e 20 | 52 65 6c 65 61 73 65 28 |DObj -> |Release(| |00001c40| 29 3b 0d 09 09 09 09 20 | 6d 44 44 4f 62 6a 20 3d |);..... |mDDObj =| |00001c50| 20 4e 55 4c 4c 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d | NULL;..|..}...}.| |00001c60| 09 7d 0d 09 23 65 6c 73 | 65 0d 09 23 70 72 61 67 |.}..#els|e..#prag| |00001c70| 6d 61 20 75 6e 75 73 65 | 64 28 20 6f 75 74 53 69 |ma unuse|d( outSi| |00001c80| 7a 65 2c 20 69 6e 57 69 | 6e 20 29 0d 09 23 65 6e |ze, inWi|n )..#en| |00001c90| 64 69 66 0d 09 0d 09 23 | 65 6e 64 69 66 0d 09 0d |dif....#|endif...| |00001ca0| 09 0d 09 69 66 20 28 20 | 21 20 6f 6b 20 29 0d 09 |...if ( |! ok )..| |00001cb0| 09 6d 43 6f 6e 74 65 78 | 74 52 65 66 20 3d 20 30 |.mContex|tRef = 0| |00001cc0| 3b 0d 09 09 0d 09 72 65 | 74 75 72 6e 20 6d 43 6f |;.....re|turn mCo| |00001cd0| 6e 74 65 78 74 52 65 66 | 3b 0d 7d 0d 0d 0d 0d 0d |ntextRef|;.}.....| |00001ce0| 0d 76 6f 69 64 20 50 69 | 78 50 6f 72 74 3a 3a 49 |.void Pi|xPort::I| |00001cf0| 6e 69 74 28 20 69 6e 74 | 20 69 6e 57 69 64 74 68 |nit( int| inWidth| |00001d00| 2c 20 69 6e 74 20 69 6e | 48 65 69 67 68 74 2c 20 |, int in|Height, | |00001d10| 69 6e 74 20 69 6e 44 65 | 70 74 68 20 29 20 7b 0d |int inDe|pth ) {.| |00001d20| 09 09 0d 09 69 66 20 28 | 20 69 6e 57 69 64 74 68 |....if (| inWidth| |00001d30| 20 3c 20 30 20 29 20 69 | 6e 57 69 64 74 68 20 3d | < 0 ) i|nWidth =| |00001d40| 20 30 3b 0d 09 69 66 20 | 28 20 69 6e 48 65 69 67 | 0;..if |( inHeig| |00001d50| 68 74 20 3c 20 30 20 29 | 20 69 6e 48 65 69 67 68 |ht < 0 )| inHeigh| |00001d60| 74 20 3d 20 30 3b 0d 0d | 09 2f 2f 20 43 61 74 63 |t = 0;..|.// Catc| |00001d70| 68 20 61 6e 79 20 69 6e | 76 61 6c 69 64 20 64 65 |h any in|valid de| |00001d80| 70 74 68 20 6c 65 76 65 | 6c 73 2e 0d 09 69 66 20 |pth leve|ls...if | |00001d90| 28 20 69 6e 44 65 70 74 | 68 20 21 3d 20 33 32 20 |( inDept|h != 32 | |00001da0| 26 26 20 69 6e 44 65 70 | 74 68 20 21 3d 20 31 36 |&& inDep|th != 16| |00001db0| 20 26 26 20 69 6e 44 65 | 70 74 68 20 21 3d 20 38 | && inDe|pth != 8| |00001dc0| 20 29 0d 09 09 69 6e 44 | 65 70 74 68 20 3d 20 73 | )...inD|epth = s| |00001dd0| 4f 53 44 65 70 74 68 3b | 0d 09 0d 09 2f 2f 20 49 |OSDepth;|....// I| |00001de0| 66 20 77 65 27 76 65 20 | 62 65 65 6e 20 61 74 20 |f we've |been at | |00001df0| 66 75 6c 6c 20 73 63 72 | 65 65 6e 2c 20 74 61 6b |full scr|een, tak| |00001e00| 65 20 75 73 20 6f 75 74 | 0d 09 69 66 20 28 20 49 |e us out|..if ( I| |00001e10| 73 46 75 6c 6c 73 63 72 | 65 65 6e 28 29 20 29 0d |sFullscr|een() ).| |00001e20| 09 09 44 65 61 63 74 69 | 76 61 74 65 28 29 3b 0d |..Deacti|vate();.| |00001e30| 09 65 6c 73 65 20 69 66 | 20 28 20 6d 57 6f 72 6c |.else if| ( mWorl| |00001e40| 64 20 26 26 20 6d 42 79 | 74 65 73 50 65 72 50 69 |d && mBy|tesPerPi| |00001e50| 78 20 2a 20 38 20 3d 3d | 20 69 6e 44 65 70 74 68 |x * 8 ==| inDepth| |00001e60| 20 26 26 20 69 6e 57 69 | 64 74 68 20 3d 3d 20 6d | && inWi|dth == m| |00001e70| 58 20 26 26 20 69 6e 48 | 65 69 67 68 74 20 3d 3d |X && inH|eight ==| |00001e80| 20 6d 59 20 29 0d 09 09 | 72 65 74 75 72 6e 3b 0d | mY )...|return;.| |00001e90| 09 0d 09 6d 58 09 09 09 | 3d 20 34 20 2a 20 28 28 |...mX...|= 4 * ((| |00001ea0| 20 69 6e 57 69 64 74 68 | 20 2b 20 33 20 29 20 2f | inWidth| + 3 ) /| |00001eb0| 20 34 20 29 3b 0d 09 6d | 59 09 09 09 3d 20 69 6e | 4 );..m|Y...= in| |00001ec0| 48 65 69 67 68 74 3b 0d | 09 0d 09 09 0d 09 23 69 |Height;.|......#i| |00001ed0| 66 20 45 47 5f 4d 41 43 | 0d 09 0d 09 2f 2f 20 53 |f EG_MAC|....// S| |00001ee0| 61 76 65 20 63 75 72 72 | 65 6e 74 20 64 72 61 77 |ave curr|ent draw| |00001ef0| 20 65 6e 76 69 72 0d 09 | 47 44 48 61 6e 64 6c 65 | envir..|GDHandle| |00001f00| 09 09 73 61 76 65 44 65 | 76 3b 0d 20 09 47 72 61 |..saveDe|v;. .Gra| |00001f10| 66 50 74 72 09 09 09 73 | 61 76 65 50 6f 72 74 3b |fPtr...s|avePort;| |00001f20| 0d 09 3a 3a 47 65 74 47 | 57 6f 72 6c 64 28 20 28 |..::GetG|World( (| |00001f30| 47 57 6f 72 6c 64 50 74 | 72 2a 29 28 26 73 61 76 |GWorldPt|r*)(&sav| |00001f40| 65 50 6f 72 74 29 2c 20 | 26 73 61 76 65 44 65 76 |ePort), |&saveDev| |00001f50| 20 29 3b 0d 09 0d 09 69 | 66 20 28 20 6d 57 6f 72 | );....i|f ( mWor| |00001f60| 6c 64 20 29 20 7b 0d 09 | 09 3a 3a 55 6e 6c 6f 63 |ld ) {..|.::Unloc| |00001f70| 6b 50 69 78 65 6c 73 28 | 20 6d 42 4d 20 29 3b 0d |kPixels(| mBM );.| |00001f80| 09 09 3a 3a 44 69 73 70 | 6f 73 65 47 57 6f 72 6c |..::Disp|oseGWorl| |00001f90| 64 28 20 6d 57 6f 72 6c | 64 20 29 3b 0d 09 7d 0d |d( mWorl|d );..}.| |00001fa0| 09 52 65 63 74 20 72 3b | 0d 09 3a 3a 53 65 74 52 |.Rect r;|..::SetR| |00001fb0| 65 63 74 28 20 26 72 2c | 20 30 2c 20 30 2c 20 6d |ect( &r,| 0, 0, m| |00001fc0| 58 2c 20 6d 59 2b 31 20 | 29 3b 0d 09 3a 3a 4e 65 |X, mY+1 |);..::Ne| |00001fd0| 77 47 57 6f 72 6c 64 28 | 20 26 6d 57 6f 72 6c 64 |wGWorld(| &mWorld| |00001fe0| 2c 20 69 6e 44 65 70 74 | 68 2c 20 26 72 2c 20 4e |, inDept|h, &r, N| |00001ff0| 55 4c 4c 2c 20 4e 55 4c | 4c 2c 20 75 73 65 54 65 |ULL, NUL|L, useTe| |00002000| 6d 70 4d 65 6d 20 29 3b | 0d 09 6d 42 4d 20 3d 20 |mpMem );|..mBM = | |00002010| 3a 3a 47 65 74 47 57 6f | 72 6c 64 50 69 78 4d 61 |::GetGWo|rldPixMa| |00002020| 70 28 20 6d 57 6f 72 6c | 64 20 29 3b 0d 09 2f 2f |p( mWorl|d );..//| |00002030| 3a 3a 4c 6f 63 6b 50 69 | 78 65 6c 73 28 20 6d 42 |::LockPi|xels( mB| |00002040| 4d 20 29 3b 0d 09 6d 42 | 79 74 65 73 50 65 72 52 |M );..mB|ytesPerR| |00002050| 6f 77 09 3d 20 28 2a 2a | 6d 42 4d 29 2e 72 6f 77 |ow.= (**|mBM).row| |00002060| 42 79 74 65 73 20 26 20 | 30 78 46 46 46 3b 0d 09 |Bytes & |0xFFF;..| |00002070| 6d 42 79 74 65 73 50 65 | 72 50 69 78 09 3d 20 28 |mBytesPe|rPix.= (| |00002080| 2a 2a 6d 42 4d 29 2e 70 | 69 78 65 6c 53 69 7a 65 |**mBM).p|ixelSize| |00002090| 20 2f 20 38 3b 0d 09 0d | 09 23 69 66 20 47 46 4f | / 8;...|.#if GFO| |000020a0| 52 43 45 0d 09 2f 2f 20 | 57 41 52 4e 49 4e 47 3a |RCE..// |WARNING:| |000020b0| 20 48 61 63 6b 2f 45 78 | 70 65 72 69 6d 65 6e 74 | Hack/Ex|periment| |000020c0| 61 6c 20 63 6f 64 65 20 | 6f 6e 6c 79 21 21 21 0d |al code |only!!!.| |000020d0| 09 43 54 61 62 48 61 6e | 64 6c 65 20 63 74 61 62 |.CTabHan|dle ctab| |000020e0| 20 3d 20 3a 3a 47 65 74 | 43 54 61 62 6c 65 28 20 | = ::Get|CTable( | |000020f0| 35 35 35 20 29 3b 0d 09 | 43 6f 6c 6f 72 53 70 65 |555 );..|ColorSpe| |00002100| 63 20 2a 73 70 65 63 73 | 3b 0d 09 6c 6f 6e 67 20 |c *specs|;..long | |00002110| 69 3b 0d 09 73 70 65 63 | 73 20 3d 20 28 2a 2a 63 |i;..spec|s = (**c| |00002120| 74 61 62 29 2e 63 74 54 | 61 62 6c 65 3b 0d 09 66 |tab).ctT|able;..f| |00002130| 6f 72 20 28 20 69 20 3d | 20 30 3b 20 69 20 3c 20 |or ( i =| 0; i < | |00002140| 32 35 36 3b 20 69 2b 2b | 20 29 20 7b 0d 09 09 66 |256; i++| ) {...f| |00002150| 6c 6f 61 74 20 76 20 3d | 20 28 20 28 66 6c 6f 61 |loat v =| ( (floa| |00002160| 74 29 20 69 20 29 20 2f | 20 32 35 35 2e 30 3b 0d |t) i ) /| 255.0;.| |00002170| 09 09 76 20 3d 20 70 6f | 77 28 20 76 2c 20 31 2e |..v = po|w( v, 1.| |00002180| 32 20 29 3b 0d 09 09 73 | 70 65 63 73 5b 20 69 20 |2 );...s|pecs[ i | |00002190| 5d 2e 72 67 62 2e 72 65 | 64 20 3d 20 76 20 2a 20 |].rgb.re|d = v * | |000021a0| 36 35 35 33 35 3b 0d 09 | 09 73 70 65 63 73 5b 20 |65535;..|.specs[ | |000021b0| 69 20 5d 2e 72 67 62 2e | 67 72 65 65 6e 20 3d 20 |i ].rgb.|green = | |000021c0| 76 20 2a 20 33 35 35 33 | 35 3b 0d 09 09 73 70 65 |v * 3553|5;...spe| |000021d0| 63 73 5b 20 69 20 5d 2e | 72 67 62 2e 62 6c 75 65 |cs[ i ].|rgb.blue| |000021e0| 20 3d 20 76 20 2a 20 33 | 35 35 33 35 3b 0d 09 09 | = v * 3|5535;...| |000021f0| 73 70 65 63 73 5b 20 69 | 20 5d 2e 76 61 6c 75 65 |specs[ i| ].value| |00002200| 20 3d 20 69 3b 0d 09 7d | 0d 09 28 2a 2a 63 74 61 | = i;..}|..(**cta| |00002210| 62 29 2e 63 74 53 65 65 | 64 20 3d 20 47 65 74 43 |b).ctSee|d = GetC| |00002220| 54 53 65 65 64 28 29 3b | 0d 09 28 2a 2a 6d 42 4d |TSeed();|..(**mBM| |00002230| 29 2e 70 6d 54 61 62 6c | 65 20 3d 20 63 74 61 62 |).pmTabl|e = ctab| |00002240| 3b 0d 09 0d 09 2f 2f 20 | 52 65 73 74 6f 72 65 20 |;....// |Restore | |00002250| 63 75 72 72 65 6e 74 20 | 64 72 61 77 69 6e 67 20 |current |drawing | |00002260| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 0d 09 3a 3a 53 |environm|ent..::S| |00002270| 65 74 47 57 6f 72 6c 64 | 28 20 28 47 57 6f 72 6c |etGWorld|( (GWorl| |00002280| 64 50 74 72 29 28 73 61 | 76 65 50 6f 72 74 29 2c |dPtr)(sa|vePort),| |00002290| 20 73 61 76 65 44 65 76 | 20 29 3b 09 0d 09 23 65 | saveDev| );...#e| |000022a0| 6e 64 69 66 0d 0d 09 23 | 65 6c 69 66 20 45 47 5f |ndif...#|elif EG_| |000022b0| 57 49 4e 09 0d 0d 09 2f | 2f 20 49 6e 69 74 69 61 |WIN..../|/ Initia| |000022c0| 6c 69 7a 65 20 61 20 62 | 6d 61 70 20 69 6e 66 6f |lize a b|map info| |000022d0| 20 73 74 72 75 63 74 0d | 09 6d 49 6e 66 6f 2e 62 | struct.|.mInfo.b| |000022e0| 6d 69 48 65 61 64 65 72 | 2e 62 69 53 69 7a 65 09 |miHeader|.biSize.| |000022f0| 09 09 3d 20 73 69 7a 65 | 6f 66 28 20 42 49 54 4d |..= size|of( BITM| |00002300| 41 50 49 4e 46 4f 48 45 | 41 44 45 52 20 29 3b 0d |APINFOHE|ADER );.| |00002310| 09 6d 49 6e 66 6f 2e 62 | 6d 69 48 65 61 64 65 72 |.mInfo.b|miHeader| |00002320| 2e 62 69 57 69 64 74 68 | 09 09 09 3d 20 6d 58 20 |.biWidth|...= mX | |00002330| 2b 20 34 3b 0d 09 6d 49 | 6e 66 6f 2e 62 6d 69 48 |+ 4;..mI|nfo.bmiH| |00002340| 65 61 64 65 72 2e 62 69 | 48 65 69 67 68 74 09 09 |eader.bi|Height..| |00002350| 3d 20 6d 59 20 2b 20 32 | 3b 0d 09 6d 49 6e 66 6f |= mY + 2|;..mInfo| |00002360| 2e 62 6d 69 48 65 61 64 | 65 72 2e 62 69 50 6c 61 |.bmiHead|er.biPla| |00002370| 6e 65 73 09 09 3d 20 31 | 3b 0d 09 6d 49 6e 66 6f |nes..= 1|;..mInfo| |00002380| 2e 62 6d 69 48 65 61 64 | 65 72 2e 62 69 42 69 74 |.bmiHead|er.biBit| |00002390| 43 6f 75 6e 74 09 09 3d | 20 69 6e 44 65 70 74 68 |Count..=| inDepth| |000023a0| 3b 0d 09 6d 49 6e 66 6f | 2e 62 6d 69 48 65 61 64 |;..mInfo|.bmiHead| |000023b0| 65 72 2e 62 69 43 6f 6d | 70 72 65 73 73 69 6f 6e |er.biCom|pression| |000023c0| 09 3d 20 42 49 5f 52 47 | 42 3b 0d 09 6d 49 6e 66 |.= BI_RG|B;..mInf| |000023d0| 6f 2e 62 6d 69 48 65 61 | 64 65 72 2e 62 69 53 69 |o.bmiHea|der.biSi| |000023e0| 7a 65 49 6d 61 67 65 09 | 09 3d 20 30 3b 0d 09 6d |zeImage.|.= 0;..m| |000023f0| 49 6e 66 6f 2e 62 6d 69 | 48 65 61 64 65 72 2e 62 |Info.bmi|Header.b| |00002400| 69 58 50 65 6c 73 50 65 | 72 4d 65 74 65 72 09 3d |iXPelsPe|rMeter.=| |00002410| 20 30 3b 0d 09 6d 49 6e | 66 6f 2e 62 6d 69 48 65 | 0;..mIn|fo.bmiHe| |00002420| 61 64 65 72 2e 62 69 59 | 50 65 6c 73 50 65 72 4d |ader.biY|PelsPerM| |00002430| 65 74 65 72 20 3d 20 30 | 3b 0d 09 6d 49 6e 66 6f |eter = 0|;..mInfo| |00002440| 2e 62 6d 69 48 65 61 64 | 65 72 2e 62 69 43 6c 72 |.bmiHead|er.biClr| |00002450| 55 73 65 64 09 09 3d 20 | 30 3b 0d 09 6d 49 6e 66 |Used..= |0;..mInf| |00002460| 6f 2e 62 6d 69 48 65 61 | 64 65 72 2e 62 69 43 6c |o.bmiHea|der.biCl| |00002470| 72 49 6d 70 6f 72 74 61 | 6e 74 09 3d 20 30 3b 0d |rImporta|nt.= 0;.| |00002480| 0d 0d 09 2f 2f 20 54 65 | 6c 6c 20 77 69 6e 64 6f |...// Te|ll windo| |00002490| 77 73 20 74 6f 20 6d 61 | 6b 65 20 61 20 62 69 74 |ws to ma|ke a bit| |000024a0| 6d 61 70 20 61 6e 64 20 | 67 69 76 65 20 75 73 20 |map and |give us | |000024b0| 61 63 65 73 73 20 74 6f | 20 69 74 73 20 70 69 78 |acess to| its pix| |000024c0| 65 6c 20 64 61 74 61 0d | 09 6d 42 4d 20 3d 20 3a |el data.|.mBM = :| |000024d0| 3a 43 72 65 61 74 65 44 | 49 42 53 65 63 74 69 6f |:CreateD|IBSectio| |000024e0| 6e 28 20 6d 57 6f 72 6c | 64 2c 20 26 6d 49 6e 66 |n( mWorl|d, &mInf| |000024f0| 6f 2c 20 44 49 42 5f 52 | 47 42 5f 43 4f 4c 4f 52 |o, DIB_R|GB_COLOR| |00002500| 53 2c 20 26 6d 42 69 74 | 73 2c 20 4e 55 4c 4c 2c |S, &mBit|s, NULL,| |00002510| 20 30 20 29 3b 0d 09 48 | 47 44 49 4f 42 4a 20 6f | 0 );..H|GDIOBJ o| |00002520| 6c 64 42 4d 20 3d 20 3a | 3a 53 65 6c 65 63 74 4f |ldBM = :|:SelectO| |00002530| 62 6a 65 63 74 28 20 6d | 57 6f 72 6c 64 2c 20 6d |bject( m|World, m| |00002540| 42 4d 20 29 3b 0d 09 69 | 66 20 28 20 6f 6c 64 42 |BM );..i|f ( oldB| |00002550| 4d 20 29 20 0d 09 09 3a | 3a 44 65 6c 65 74 65 4f |M ) ...:|:DeleteO| |00002560| 62 6a 65 63 74 28 20 6f | 6c 64 42 4d 20 29 3b 09 |bject( o|ldBM );.| |00002570| 0d 09 0d 09 42 49 54 4d | 41 50 20 62 3b 0d 09 3a |....BITM|AP b;..:| |00002580| 3a 47 65 74 4f 62 6a 65 | 63 74 28 20 6d 42 4d 2c |:GetObje|ct( mBM,| |00002590| 20 73 69 7a 65 6f 66 28 | 20 42 49 54 4d 41 50 20 | sizeof(| BITMAP | |000025a0| 29 2c 20 26 62 20 29 3b | 0d 09 6d 42 79 74 65 73 |), &b );|..mBytes| |000025b0| 50 65 72 52 6f 77 09 3d | 20 62 2e 62 6d 57 69 64 |PerRow.=| b.bmWid| |000025c0| 74 68 42 79 74 65 73 3b | 0d 09 6d 42 79 74 65 73 |thBytes;|..mBytes| |000025d0| 50 65 72 50 69 78 09 3d | 20 62 2e 62 6d 42 69 74 |PerPix.=| b.bmBit| |000025e0| 73 50 69 78 65 6c 20 2f | 20 38 3b 0d 0d 2f 2a 0d |sPixel /| 8;../*.| |000025f0| 0d 09 6d 49 6e 66 6f 2e | 62 6d 69 48 65 61 64 65 |..mInfo.|bmiHeade| |00002600| 72 2e 62 69 53 69 7a 65 | 09 09 09 3d 20 73 69 7a |r.biSize|...= siz| |00002610| 65 6f 66 28 20 42 49 54 | 4d 41 50 49 4e 46 4f 48 |eof( BIT|MAPINFOH| |00002620| 45 41 44 45 52 20 29 3b | 0d 09 6d 49 6e 66 6f 2e |EADER );|..mInfo.| |00002630| 62 6d 69 48 65 61 64 65 | 72 2e 62 69 57 69 64 74 |bmiHeade|r.biWidt| |00002640| 68 09 09 09 3d 20 6d 58 | 3b 0d 09 6d 49 6e 66 6f |h...= mX|;..mInfo| |00002650| 2e 62 6d 69 48 65 61 64 | 65 72 2e 62 69 48 65 69 |.bmiHead|er.biHei| |00002660| 67 68 74 09 09 3d 20 6d | 59 3b 0d 09 6d 49 6e 66 |ght..= m|Y;..mInf| |00002670| 6f 2e 62 6d 69 48 65 61 | 64 65 72 2e 62 69 50 6c |o.bmiHea|der.biPl| |00002680| 61 6e 65 73 09 09 3d 20 | 31 3b 0d 09 6d 49 6e 66 |anes..= |1;..mInf| |00002690| 6f 2e 62 6d 69 48 65 61 | 64 65 72 2e 62 69 42 69 |o.bmiHea|der.biBi| |000026a0| 74 43 6f 75 6e 74 09 09 | 3d 20 69 6e 44 65 70 74 |tCount..|= inDept| |000026b0| 68 3b 0d 09 6d 49 6e 66 | 6f 2e 62 6d 69 48 65 61 |h;..mInf|o.bmiHea| |000026c0| 64 65 72 2e 62 69 43 6f | 6d 70 72 65 73 73 69 6f |der.biCo|mpressio| |000026d0| 6e 09 3d 20 42 49 5f 52 | 47 42 3b 0d 09 6d 49 6e |n.= BI_R|GB;..mIn| |000026e0| 66 6f 2e 62 6d 69 48 65 | 61 64 65 72 2e 62 69 53 |fo.bmiHe|ader.biS| |000026f0| 69 7a 65 49 6d 61 67 65 | 09 09 3d 20 30 3b 0d 09 |izeImage|..= 0;..| |00002700| 6d 49 6e 66 6f 2e 62 6d | 69 48 65 61 64 65 72 2e |mInfo.bm|iHeader.| |00002710| 62 69 58 50 65 6c 73 50 | 65 72 4d 65 74 65 72 09 |biXPelsP|erMeter.| |00002720| 3d 20 33 39 20 2a 20 39 | 36 3b 0d 09 6d 49 6e 66 |= 39 * 9|6;..mInf| |00002730| 6f 2e 62 6d 69 48 65 61 | 64 65 72 2e 62 69 59 50 |o.bmiHea|der.biYP| |00002740| 65 6c 73 50 65 72 4d 65 | 74 65 72 20 3d 20 33 39 |elsPerMe|ter = 39| |00002750| 20 2a 20 39 36 3b 0d 09 | 6d 49 6e 66 6f 2e 62 6d | * 96;..|mInfo.bm| |00002760| 69 48 65 61 64 65 72 2e | 62 69 43 6c 72 55 73 65 |iHeader.|biClrUse| |00002770| 64 09 09 3d 20 30 3b 0d | 09 6d 49 6e 66 6f 2e 62 |d..= 0;.|.mInfo.b| |00002780| 6d 69 48 65 61 64 65 72 | 2e 62 69 43 6c 72 49 6d |miHeader|.biClrIm| |00002790| 70 6f 72 74 61 6e 74 09 | 3d 20 30 3b 0d 09 2a 28 |portant.|= 0;..*(| |000027a0| 28 6c 6f 6e 67 2a 29 20 | 26 6d 49 6e 66 6f 2e 62 |(long*) |&mInfo.b| |000027b0| 6d 69 43 6f 6c 6f 72 73 | 29 20 3d 20 30 3b 0d 09 |miColors|) = 0;..| |000027c0| 0d 09 6d 42 79 74 65 73 | 50 65 72 50 69 78 09 3d |..mBytes|PerPix.=| |000027d0| 20 69 6e 44 65 70 74 68 | 20 2f 20 38 3b 0d 09 6d | inDepth| / 8;..m| |000027e0| 42 79 74 65 73 50 65 72 | 52 6f 77 09 3d 20 6d 42 |BytesPer|Row.= mB| |000027f0| 79 74 65 73 50 65 72 50 | 69 78 20 2a 20 6d 58 3b |ytesPerP|ix * mX;| |00002800| 0d 0d 09 6d 42 75 66 2e | 44 69 6d 28 20 28 6d 59 |...mBuf.|Dim( (mY| |00002810| 2b 33 29 20 2a 20 6d 42 | 79 74 65 73 50 65 72 52 |+3) * mB|ytesPerR| |00002820| 6f 77 20 29 3b 0d 09 6d | 42 69 74 73 20 3d 20 6d |ow );..m|Bits = m| |00002830| 42 75 66 2e 67 65 74 43 | 53 74 72 28 29 3b 0d 09 |Buf.getC|Str();..| |00002840| 2a 2f 0d 09 0d 09 23 65 | 6e 64 69 66 0d 7d 0d 0d |*/....#e|ndif.}..| |00002850| 0d 76 6f 69 64 20 50 69 | 78 50 6f 72 74 3a 3a 44 |.void Pi|xPort::D| |00002860| 65 61 63 74 69 76 61 74 | 65 28 29 20 7b 0d 09 0d |eactivat|e() {...| |00002870| 09 69 66 20 28 20 21 20 | 49 73 46 75 6c 6c 73 63 |.if ( ! |IsFullsc| |00002880| 72 65 65 6e 28 29 20 29 | 20 0d 09 09 72 65 74 75 |reen() )| ...retu| |00002890| 72 6e 3b 0d 09 09 0d 09 | 23 69 66 20 45 47 5f 4d |rn;.....|#if EG_M| |000028a0| 41 43 20 26 26 20 55 53 | 45 5f 44 52 41 57 5f 53 |AC && US|E_DRAW_S| |000028b0| 50 52 4f 43 4b 45 54 53 | 0d 09 2f 2f 47 44 48 61 |PROCKETS|..//GDHa| |000028c0| 6e 64 6c 65 09 09 73 61 | 76 65 44 65 76 3b 0d 20 |ndle..sa|veDev;. | |000028d0| 09 2f 2f 47 72 61 66 50 | 74 72 09 09 09 73 61 76 |.//GrafP|tr...sav| |000028e0| 65 50 6f 72 74 3b 0d 09 | 2f 2f 3a 3a 47 65 74 47 |ePort;..|//::GetG| |000028f0| 57 6f 72 6c 64 28 20 28 | 47 57 6f 72 6c 64 50 74 |World( (|GWorldPt| |00002900| 72 2a 29 28 26 73 61 76 | 65 50 6f 72 74 29 2c 20 |r*)(&sav|ePort), | |00002910| 26 73 61 76 65 44 65 76 | 20 29 3b 0d 09 3a 3a 44 |&saveDev| );..::D| |00002920| 53 70 43 6f 6e 74 65 78 | 74 5f 46 61 64 65 47 61 |SpContex|t_FadeGa| |00002930| 6d 6d 61 28 20 6d 43 6f | 6e 74 65 78 74 52 65 66 |mma( mCo|ntextRef| |00002940| 2c 20 30 2c 20 4e 55 4c | 4c 20 29 3b 0d 09 3a 3a |, 0, NUL|L );..::| |00002950| 44 53 70 43 6f 6e 74 65 | 78 74 5f 53 65 74 53 74 |DSpConte|xt_SetSt| |00002960| 61 74 65 28 20 6d 43 6f | 6e 74 65 78 74 52 65 66 |ate( mCo|ntextRef| |00002970| 2c 20 6b 44 53 70 43 6f | 6e 74 65 78 74 53 74 61 |, kDSpCo|ntextSta| |00002980| 74 65 5f 49 6e 61 63 74 | 69 76 65 20 29 3b 0d 09 |te_Inact|ive );..| |00002990| 3a 3a 44 53 70 43 6f 6e | 74 65 78 74 5f 52 65 6c |::DSpCon|text_Rel| |000029a0| 65 61 73 65 28 20 6d 43 | 6f 6e 74 65 78 74 52 65 |ease( mC|ontextRe| |000029b0| 66 20 29 3b 0d 09 3a 3a | 44 53 70 43 6f 6e 74 65 |f );..::|DSpConte| |000029c0| 78 74 5f 46 61 64 65 47 | 61 6d 6d 61 28 20 6d 43 |xt_FadeG|amma( mC| |000029d0| 6f 6e 74 65 78 74 52 65 | 66 2c 20 31 30 30 2c 20 |ontextRe|f, 100, | |000029e0| 4e 55 4c 4c 20 29 3b 09 | 0d 09 3a 3a 49 6e 69 74 |NULL );.|..::Init| |000029f0| 43 75 72 73 6f 72 28 29 | 3b 0d 09 2f 2f 3a 3a 53 |Cursor()|;..//::S| |00002a00| 65 74 47 57 6f 72 6c 64 | 28 20 28 47 57 6f 72 6c |etGWorld|( (GWorl| |00002a10| 64 50 74 72 29 28 73 61 | 76 65 50 6f 72 74 29 2c |dPtr)(sa|vePort),| |00002a20| 20 73 61 76 65 44 65 76 | 20 29 3b 09 09 09 0d 09 | saveDev| );.....| |00002a30| 23 65 6e 64 69 66 0d 09 | 0d 09 23 69 66 20 55 53 |#endif..|..#if US| |00002a40| 45 5f 44 49 52 45 43 54 | 58 0d 09 45 6e 64 46 72 |E_DIRECT|X..EndFr| |00002a50| 61 6d 65 28 29 3b 0d 09 | 6d 43 6f 6e 74 65 78 74 |ame();..|mContext| |00002a60| 52 65 66 20 2d 3e 20 52 | 65 6c 65 61 73 65 28 29 |Ref -> R|elease()| |00002a70| 3b 0d 09 6d 44 44 4f 62 | 6a 20 2d 3e 20 52 65 6c |;..mDDOb|j -> Rel| |00002a80| 65 61 73 65 28 29 3b 0d | 09 6d 44 44 4f 62 6a 20 |ease();.|.mDDObj | |00002a90| 3d 20 4e 55 4c 4c 3b 0d | 09 3a 3a 52 65 6c 65 61 |= NULL;.|.::Relea| |00002aa0| 73 65 43 61 70 74 75 72 | 65 28 29 3b 0d 09 77 68 |seCaptur|e();..wh| |00002ab0| 69 6c 65 20 28 20 3a 3a | 53 68 6f 77 43 75 72 73 |ile ( ::|ShowCurs| |00002ac0| 6f 72 28 20 74 72 75 65 | 20 29 20 3c 20 30 20 29 |or( true| ) < 0 )| |00002ad0| 20 7b 20 7d 0d 09 23 65 | 6e 64 69 66 0d 09 0d 09 | { }..#e|ndif....| |00002ae0| 6d 43 6f 6e 74 65 78 74 | 52 65 66 20 3d 20 4e 55 |mContext|Ref = NU| |00002af0| 4c 4c 3b 0d 7d 0d 0d 0d | 0d 0d 0d 23 64 65 66 69 |LL;.}...|...#defi| |00002b00| 6e 65 20 5f 5f 63 6c 69 | 70 50 74 28 20 78 2c 20 |ne __cli|pPt( x, | |00002b10| 79 20 29 09 5c 0d 09 69 | 66 20 28 20 78 20 3c 20 |y ).\..i|f ( x < | |00002b20| 30 20 29 09 09 09 5c 0d | 09 09 78 20 3d 20 30 3b |0 )...\.|..x = 0;| |00002b30| 09 09 09 09 5c 0d 09 65 | 6c 73 65 20 69 66 20 28 |....\..e|lse if (| |00002b40| 20 78 20 3e 20 6d 58 20 | 29 09 09 5c 0d 09 09 78 | x > mX |)..\...x| |00002b50| 20 3d 20 6d 58 3b 09 09 | 09 09 5c 0d 09 69 66 20 | = mX;..|..\..if | |00002b60| 28 20 79 20 3c 20 30 20 | 29 09 09 09 5c 0d 09 09 |( y < 0 |)...\...| |00002b70| 79 20 3d 20 30 3b 09 09 | 09 09 5c 0d 09 65 6c 73 |y = 0;..|..\..els| |00002b80| 65 20 69 66 20 28 20 79 | 20 3e 20 6d 59 20 29 09 |e if ( y| > mY ).| |00002b90| 09 5c 0d 09 09 79 20 3d | 20 6d 59 3b 09 09 09 09 |.\...y =| mY;....| |00002ba0| 5c 0d 0d 0d 0d 23 64 65 | 66 69 6e 65 20 5f 5f 63 |\....#de|fine __c| |00002bb0| 6c 69 70 52 65 63 74 28 | 20 69 6e 52 65 63 74 20 |lipRect(| inRect | |00002bc0| 29 09 09 09 5c 0d 09 52 | 65 63 74 20 72 20 3d 20 |)...\..R|ect r = | |00002bd0| 69 6e 52 65 63 74 3b 09 | 09 09 09 09 5c 0d 09 5f |inRect;.|....\.._| |00002be0| 5f 63 6c 69 70 50 74 28 | 20 72 2e 6c 65 66 74 2c |_clipPt(| r.left,| |00002bf0| 20 72 2e 74 6f 70 20 29 | 09 09 09 5c 0d 09 5f 5f | r.top )|...\..__| |00002c00| 63 6c 69 70 50 74 28 20 | 72 2e 72 69 67 68 74 2c |clipPt( |r.right,| |00002c10| 20 72 2e 62 6f 74 74 6f | 6d 20 29 09 09 5c 0d 09 | r.botto|m )..\..| |00002c20| 6c 6f 6e 67 20 77 69 64 | 74 68 20 09 3d 20 72 2e |long wid|th .= r.| |00002c30| 72 69 67 68 74 20 2d 20 | 72 2e 6c 65 66 74 3b 09 |right - |r.left;.| |00002c40| 09 5c 0d 09 6c 6f 6e 67 | 20 68 65 69 67 68 74 20 |.\..long| height | |00002c50| 3d 20 72 2e 62 6f 74 74 | 6f 6d 20 2d 20 72 2e 74 |= r.bott|om - r.t| |00002c60| 6f 70 3b 0d 0d 0d 0d 0d | 0d 0d 0d 76 6f 69 64 20 |op;.....|...void | |00002c70| 50 69 78 50 6f 72 74 3a | 3a 42 65 67 69 6e 46 72 |PixPort:|:BeginFr| |00002c80| 61 6d 65 28 29 20 7b 0d | 0d 09 23 69 66 20 45 47 |ame() {.|..#if EG| |00002c90| 5f 4d 41 43 0d 09 0d 09 | 69 66 20 28 20 49 73 46 |_MAC....|if ( IsF| |00002ca0| 75 6c 6c 73 63 72 65 65 | 6e 28 29 20 29 20 7b 0d |ullscree|n() ) {.| |00002cb0| 09 0d 09 09 23 69 66 20 | 55 53 45 5f 44 52 41 57 |....#if |USE_DRAW| |00002cc0| 5f 53 50 52 4f 43 4b 45 | 54 53 0d 09 09 43 47 72 |_SPROCKE|TS...CGr| |00002cd0| 61 66 50 74 72 20 74 68 | 65 50 6f 72 74 3b 0d 09 |afPtr th|ePort;..| |00002ce0| 09 4f 53 45 72 72 20 65 | 72 72 3b 0d 09 09 65 72 |.OSErr e|rr;...er| |00002cf0| 72 20 3d 20 3a 3a 44 53 | 70 43 6f 6e 74 65 78 74 |r = ::DS|pContext| |00002d00| 5f 47 65 74 42 61 63 6b | 42 75 66 66 65 72 28 20 |_GetBack|Buffer( | |00002d10| 6d 43 6f 6e 74 65 78 74 | 52 65 66 2c 20 6b 44 53 |mContext|Ref, kDS| |00002d20| 70 42 75 66 66 65 72 4b | 69 6e 64 5f 4e 6f 72 6d |pBufferK|ind_Norm| |00002d30| 61 6c 2c 20 26 74 68 65 | 50 6f 72 74 20 29 3b 0d |al, &the|Port );.| |00002d40| 09 09 69 66 20 28 20 74 | 68 65 50 6f 72 74 20 26 |..if ( t|hePort &| |00002d50| 26 20 21 20 65 72 72 20 | 29 20 7b 0d 09 09 09 3a |& ! err |) {....:| |00002d60| 3a 53 65 74 50 6f 72 74 | 28 20 28 47 72 61 66 50 |:SetPort|( (GrafP| |00002d70| 74 72 29 20 74 68 65 50 | 6f 72 74 20 29 3b 0d 09 |tr) theP|ort );..| |00002d80| 09 09 6d 42 4d 20 3d 20 | 74 68 65 50 6f 72 74 20 |..mBM = |thePort | |00002d90| 2d 3e 20 70 6f 72 74 50 | 69 78 4d 61 70 3b 20 7d |-> portP|ixMap; }| |00002da0| 0d 09 09 65 6c 73 65 20 | 7b 0d 09 09 09 6d 42 4d |...else |{....mBM| |00002db0| 20 3d 20 4e 55 4c 4c 3b | 0d 09 09 09 44 65 61 63 | = NULL;|....Deac| |00002dc0| 74 69 76 61 74 65 28 29 | 3b 0d 09 09 7d 0d 09 09 |tivate()|;...}...| |00002dd0| 23 65 6e 64 69 66 0d 09 | 09 7d 0d 09 65 6c 73 65 |#endif..|.}..else| |00002de0| 20 69 66 20 28 20 6d 57 | 6f 72 6c 64 20 29 0d 09 | if ( mW|orld )..| |00002df0| 09 6d 42 4d 09 3d 20 3a | 3a 47 65 74 47 57 6f 72 |.mBM.= :|:GetGWor| |00002e00| 6c 64 50 69 78 4d 61 70 | 28 20 6d 57 6f 72 6c 64 |ldPixMap|( mWorld| |00002e10| 20 29 3b 0d 09 09 0d 09 | 69 66 20 28 20 6d 42 4d | );.....|if ( mBM| |00002e20| 20 29 0d 09 09 6d 42 69 | 74 73 20 3d 20 3a 3a 47 | )...mBi|ts = ::G| |00002e30| 65 74 50 69 78 42 61 73 | 65 41 64 64 72 28 20 6d |etPixBas|eAddr( m| |00002e40| 42 4d 20 29 3b 0d 09 23 | 65 6e 64 69 66 0d 09 0d |BM );..#|endif...| |00002e50| 09 2f 2a 0d 09 23 69 66 | 20 55 53 45 5f 44 49 52 |./*..#if| USE_DIR| |00002e60| 45 43 54 58 0d 09 69 66 | 20 28 20 49 73 46 75 6c |ECTX..if| ( IsFul| |00002e70| 6c 73 63 72 65 65 6e 28 | 29 20 29 20 7b 0d 09 09 |lscreen(|) ) {...| |00002e80| 69 66 20 28 20 21 20 6d | 43 6f 6e 74 65 78 74 52 |if ( ! m|ContextR| |00002e90| 65 66 20 2d 3e 20 47 65 | 74 44 43 28 20 26 6d 46 |ef -> Ge|tDC( &mF| |00002ea0| 53 5f 44 43 20 29 20 21 | 3d 20 44 44 5f 4f 4b 20 |S_DC ) !|= DD_OK | |00002eb0| 29 0d 09 09 09 6d 46 53 | 5f 44 43 20 3d 20 4e 55 |)....mFS|_DC = NU| |00002ec0| 4c 4c 3b 0d 09 7d 0d 09 | 23 65 6e 64 69 66 2a 2f |LL;..}..|#endif*/| |00002ed0| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 50 69 78 50 6f 72 |.}...voi|d PixPor| |00002ee0| 74 3a 3a 45 6e 64 46 72 | 61 6d 65 28 29 20 7b 0d |t::EndFr|ame() {.| |00002ef0| 0d 0d 09 69 66 20 28 20 | 49 73 46 75 6c 6c 73 63 |...if ( |IsFullsc| |00002f00| 72 65 65 6e 28 29 20 29 | 20 7b 0d 0d 09 09 23 69 |reen() )| {....#i| |00002f10| 66 20 55 53 45 5f 44 52 | 41 57 5f 53 50 52 4f 43 |f USE_DR|AW_SPROC| |00002f20| 4b 45 54 53 0d 09 09 3a | 3a 44 53 70 43 6f 6e 74 |KETS...:|:DSpCont| |00002f30| 65 78 74 5f 53 77 61 70 | 42 75 66 66 65 72 73 28 |ext_Swap|Buffers(| |00002f40| 20 6d 43 6f 6e 74 65 78 | 74 52 65 66 2c 20 4e 55 | mContex|tRef, NU| |00002f50| 4c 4c 2c 20 30 20 29 3b | 0d 09 09 23 65 6e 64 69 |LL, 0 );|...#endi| |00002f60| 66 0d 09 09 0d 09 09 23 | 69 66 20 55 53 45 5f 44 |f......#|if USE_D| |00002f70| 49 52 45 43 54 58 20 26 | 26 20 30 20 0d 09 09 69 |IRECTX &|& 0 ...i| |00002f80| 66 20 28 20 6d 46 53 5f | 44 43 20 29 20 7b 0d 09 |f ( mFS_|DC ) {..| |00002f90| 09 09 6d 43 6f 6e 74 65 | 78 74 52 65 66 20 2d 3e |..mConte|xtRef ->| |00002fa0| 20 52 65 6c 65 61 73 65 | 44 43 28 20 6d 46 53 5f | Release|DC( mFS_| |00002fb0| 44 43 20 29 3b 0d 09 09 | 09 6d 46 53 5f 44 43 20 |DC );...|.mFS_DC | |00002fc0| 3d 20 4e 55 4c 4c 3b 0d | 09 09 7d 0d 09 09 23 65 |= NULL;.|..}...#e| |00002fd0| 6e 64 69 66 0d 09 7d 0d | 7d 0d 0d 0d 0d 0d 0d 6c |ndif..}.|}......l| |00002fe0| 6f 6e 67 20 50 69 78 50 | 6f 72 74 3a 3a 47 65 74 |ong PixP|ort::Get| |00002ff0| 50 6f 72 74 43 6f 6c 6f | 72 28 20 6c 6f 6e 67 20 |PortColo|r( long | |00003000| 69 6e 52 2c 20 6c 6f 6e | 67 20 69 6e 47 2c 20 6c |inR, lon|g inG, l| |00003010| 6f 6e 67 20 69 6e 42 20 | 29 20 7b 0d 09 69 6e 74 |ong inB |) {..int| |00003020| 20 62 69 74 44 65 70 74 | 68 20 20 3d 6d 42 79 74 | bitDept|h =mByt| |00003030| 65 73 50 65 72 50 69 78 | 20 3c 3c 20 33 3b 0d 09 |esPerPix| << 3;..| |00003040| 0d 09 6c 6f 6e 67 20 63 | 3b 0d 09 0d 09 69 66 20 |..long c|;....if | |00003050| 28 20 69 6e 52 20 3e 20 | 30 78 46 46 46 46 20 29 |( inR > |0xFFFF )| |00003060| 09 69 6e 52 20 3d 20 30 | 78 46 46 46 46 3b 0d 09 |.inR = 0|xFFFF;..| |00003070| 69 66 20 28 20 69 6e 47 | 20 3e 20 30 78 46 46 46 |if ( inG| > 0xFFF| |00003080| 46 20 29 09 69 6e 47 20 | 3d 20 30 78 46 46 46 46 |F ).inG |= 0xFFFF| |00003090| 3b 0d 09 69 66 20 28 20 | 69 6e 42 20 3e 20 30 78 |;..if ( |inB > 0x| |000030a0| 46 46 46 46 20 29 09 69 | 6e 42 20 3d 20 30 78 46 |FFFF ).i|nB = 0xF| |000030b0| 46 46 46 3b 0d 09 69 66 | 20 28 20 69 6e 52 20 3c |FFF;..if| ( inR <| |000030c0| 20 30 20 29 09 09 69 6e | 52 20 3d 20 30 3b 0d 09 | 0 )..in|R = 0;..| |000030d0| 69 66 20 28 20 69 6e 47 | 20 3c 20 30 20 29 09 09 |if ( inG| < 0 )..| |000030e0| 69 6e 47 20 3d 20 30 3b | 0d 09 69 66 20 28 20 69 |inG = 0;|..if ( i| |000030f0| 6e 42 20 3c 20 30 20 29 | 09 09 69 6e 42 20 3d 20 |nB < 0 )|..inB = | |00003100| 30 3b 0d 09 0d 09 69 66 | 20 28 20 62 69 74 44 65 |0;....if| ( bitDe| |00003110| 70 74 68 20 3d 3d 20 33 | 32 20 29 20 0d 09 09 63 |pth == 3|2 ) ...c| |00003120| 20 3d 20 5f 5f 43 6c 72 | 33 32 28 20 69 6e 52 2c | = __Clr|32( inR,| |00003130| 20 69 6e 47 2c 20 69 6e | 42 20 29 3b 0d 09 65 6c | inG, in|B );..el| |00003140| 73 65 20 69 66 20 28 20 | 62 69 74 44 65 70 74 68 |se if ( |bitDepth| |00003150| 20 3d 3d 20 31 36 20 29 | 0d 09 09 63 20 3d 20 5f | == 16 )|...c = _| |00003160| 5f 43 6c 72 31 36 28 20 | 69 6e 52 2c 20 69 6e 47 |_Clr16( |inR, inG| |00003170| 2c 20 69 6e 42 20 29 3b | 0d 09 65 6c 73 65 0d 09 |, inB );|..else..| |00003180| 09 63 20 3d 20 5f 5f 43 | 6c 72 38 28 20 69 6e 52 |.c = __C|lr8( inR| |00003190| 2c 20 69 6e 47 2c 20 69 | 6e 42 20 29 3b 0d 0d 09 |, inG, i|nB );...| |000031a0| 72 65 74 75 72 6e 20 63 | 3b 0d 7d 0d 0d 0d 0d 0d |return c|;.}.....| |000031b0| 0d 6c 6f 6e 67 20 50 69 | 78 50 6f 72 74 3a 3a 53 |.long Pi|xPort::S| |000031c0| 65 74 42 61 63 6b 43 6f | 6c 6f 72 28 20 63 6f 6e |etBackCo|lor( con| |000031d0| 73 74 20 52 47 42 43 6f | 6c 6f 72 26 20 52 47 42 |st RGBCo|lor& RGB| |000031e0| 20 29 20 7b 0d 0d 09 6d | 42 61 63 6b 43 6f 6c 6f | ) {...m|BackColo| |000031f0| 72 20 3d 20 47 65 74 50 | 6f 72 74 43 6f 6c 6f 72 |r = GetP|ortColor| |00003200| 28 20 52 47 42 20 29 3b | 0d 09 0d 09 72 65 74 75 |( RGB );|....retu| |00003210| 72 6e 20 6d 42 61 63 6b | 43 6f 6c 6f 72 3b 0d 7d |rn mBack|Color;.}| |00003220| 0d 0d 0d 6c 6f 6e 67 20 | 50 69 78 50 6f 72 74 3a |...long |PixPort:| |00003230| 3a 53 65 74 42 61 63 6b | 43 6f 6c 6f 72 28 20 6c |:SetBack|Color( l| |00003240| 6f 6e 67 20 69 6e 52 2c | 20 6c 6f 6e 67 20 69 6e |ong inR,| long in| |00003250| 47 2c 20 6c 6f 6e 67 20 | 69 6e 42 20 29 20 7b 0d |G, long |inB ) {.| |00003260| 09 6d 42 61 63 6b 43 6f | 6c 6f 72 20 3d 20 47 65 |.mBackCo|lor = Ge| |00003270| 74 50 6f 72 74 43 6f 6c | 6f 72 28 20 69 6e 52 2c |tPortCol|or( inR,| |00003280| 20 69 6e 47 2c 20 69 6e | 42 20 29 3b 0d 0d 09 72 | inG, in|B );...r| |00003290| 65 74 75 72 6e 20 6d 42 | 61 63 6b 43 6f 6c 6f 72 |eturn mB|ackColor| |000032a0| 3b 0d 7d 0d 0d 0d 76 6f | 69 64 20 50 69 78 50 6f |;.}...vo|id PixPo| |000032b0| 72 74 3a 3a 47 61 75 73 | 73 42 6c 75 72 28 20 69 |rt::Gaus|sBlur( i| |000032c0| 6e 74 20 69 6e 42 6f 78 | 57 69 64 74 68 2c 20 63 |nt inBox|Width, c| |000032d0| 6f 6e 73 74 20 52 65 63 | 74 26 20 69 6e 52 65 63 |onst Rec|t& inRec| |000032e0| 74 2c 20 76 6f 69 64 2a | 20 69 6e 44 65 73 74 42 |t, void*| inDestB| |000032f0| 69 74 73 20 29 20 7b 09 | 0d 09 0d 09 2f 2f 20 44 |its ) {.|....// D| |00003300| 6f 6e 27 74 20 6c 65 74 | 20 75 73 20 64 72 61 77 |on't let| us draw| |00003310| 20 69 6e 20 72 61 6e 64 | 6f 6d 20 70 61 72 74 73 | in rand|om parts| |00003320| 20 6f 66 20 6d 65 6d 6f | 72 79 20 2d 2d 20 63 6c | of memo|ry -- cl| |00003330| 69 70 20 69 6e 52 65 63 | 74 0d 09 5f 5f 63 6c 69 |ip inRec|t..__cli| |00003340| 70 52 65 63 74 28 20 69 | 6e 52 65 63 74 20 29 0d |pRect( i|nRect ).| |00003350| 09 0d 09 0d 09 69 66 20 | 28 20 69 6e 42 6f 78 57 |.....if |( inBoxW| |00003360| 69 64 74 68 20 3c 3d 20 | 31 20 29 0d 09 09 72 65 |idth <= |1 )...re| |00003370| 74 75 72 6e 3b 0d 09 0d | 09 2f 2f 20 49 6e 20 57 |turn;...|.// In W| |00003380| 69 6e 33 32 2c 20 65 76 | 65 72 79 74 68 69 6e 67 |in32, ev|erything| |00003390| 27 73 20 75 70 73 69 64 | 65 20 64 6f 77 6e 0d 09 |'s upsid|e down..| |000033a0| 23 69 66 20 45 47 5f 57 | 49 4e 0d 09 72 2e 74 6f |#if EG_W|IN..r.to| |000033b0| 70 20 3d 20 6d 59 20 2d | 20 72 2e 62 6f 74 74 6f |p = mY -| r.botto| |000033c0| 6d 3b 0d 09 23 65 6e 64 | 69 66 0d 0d 09 2f 2f 20 |m;..#end|if...// | |000033d0| 33 20 62 6f 78 20 63 6f | 6e 76 6f 6c 75 74 69 6f |3 box co|nvolutio| |000033e0| 6e 73 2c 20 33 20 63 6f | 6c 6f 72 73 20 70 65 72 |ns, 3 co|lors per| |000033f0| 20 70 69 78 65 6c 2c 20 | 34 20 62 79 74 65 73 20 | pixel, |4 bytes | |00003400| 70 65 72 20 63 6f 6c 6f | 72 0d 09 6c 6f 6e 67 20 |per colo|r..long | |00003410| 09 62 6f 78 54 65 6d 70 | 53 69 7a 65 09 3d 20 33 |.boxTemp|Size.= 3| |00003420| 36 20 2a 20 69 6e 42 6f | 78 57 69 64 74 68 3b 0d |6 * inBo|xWidth;.| |00003430| 09 63 68 61 72 2a 09 74 | 65 6d 70 42 69 74 73 09 |.char*.t|empBits.| |00003440| 3d 20 4e 55 4c 4c 3b 0d | 09 75 6e 73 69 67 6e 65 |= NULL;.|.unsigne| |00003450| 64 20 6c 6f 6e 67 2a 09 | 62 6f 78 54 65 6d 70 3b |d long*.|boxTemp;| |00003460| 0d 09 6c 6f 6e 67 09 69 | 6d 67 4f 66 66 73 65 74 |..long.i|mgOffset| |00003470| 09 3d 20 6d 42 79 74 65 | 73 50 65 72 50 69 78 20 |.= mByte|sPerPix | |00003480| 2a 20 72 2e 6c 65 66 74 | 20 2b 20 72 2e 74 6f 70 |* r.left| + r.top| |00003490| 20 2a 20 6d 42 79 74 65 | 73 50 65 72 52 6f 77 3b | * mByte|sPerRow;| |000034a0| 0d 09 6c 6f 6e 67 09 62 | 79 74 65 73 4e 65 65 64 |..long.b|ytesNeed| |000034b0| 65 64 09 3d 20 6d 42 79 | 74 65 73 50 65 72 52 6f |ed.= mBy|tesPerRo| |000034c0| 77 20 2a 20 28 6d 59 20 | 2b 20 32 29 20 2b 20 62 |w * (mY |+ 2) + b| |000034d0| 6f 78 54 65 6d 70 53 69 | 7a 65 3b 0d 09 0d 09 23 |oxTempSi|ze;....#| |000034e0| 69 66 20 45 47 5f 4d 41 | 43 0d 09 69 66 20 28 20 |if EG_MA|C..if ( | |000034f0| 6d 48 6e 64 6c 53 69 7a | 65 20 3c 20 62 79 74 65 |mHndlSiz|e < byte| |00003500| 73 4e 65 65 64 65 64 20 | 29 20 7b 0d 09 09 4f 53 |sNeeded |) {...OS| |00003510| 45 72 72 20 65 72 72 3b | 0d 09 09 69 66 20 28 20 |Err err;|...if ( | |00003520| 6d 54 65 6d 70 48 6e 64 | 6c 20 29 20 7b 0d 09 09 |mTempHnd|l ) {...| |00003530| 09 3a 3a 54 65 6d 70 44 | 69 73 70 6f 73 65 48 61 |.::TempD|isposeHa| |00003540| 6e 64 6c 65 28 20 6d 54 | 65 6d 70 48 6e 64 6c 2c |ndle( mT|empHndl,| |00003550| 20 26 65 72 72 20 29 3b | 0d 09 09 09 6d 48 6e 64 | &err );|....mHnd| |00003560| 6c 53 69 7a 65 20 3d 20 | 30 3b 0d 09 09 7d 0d 09 |lSize = |0;...}..| |00003570| 09 0d 09 09 6d 54 65 6d | 70 48 6e 64 6c 20 3d 20 |....mTem|pHndl = | |00003580| 3a 3a 54 65 6d 70 4e 65 | 77 48 61 6e 64 6c 65 28 |::TempNe|wHandle(| |00003590| 20 62 79 74 65 73 4e 65 | 65 64 65 64 2c 20 26 65 | bytesNe|eded, &e| |000035a0| 72 72 20 29 3b 0d 09 09 | 69 66 20 28 20 21 20 65 |rr );...|if ( ! e| |000035b0| 72 72 20 29 20 7b 0d 09 | 09 09 74 65 6d 70 42 69 |rr ) {..|..tempBi| |000035c0| 74 73 20 3d 20 2a 6d 54 | 65 6d 70 48 6e 64 6c 3b |ts = *mT|empHndl;| |000035d0| 0d 09 09 09 6d 48 6e 64 | 6c 53 69 7a 65 20 3d 20 |....mHnd|lSize = | |000035e0| 62 79 74 65 73 4e 65 65 | 64 65 64 3b 0d 09 09 7d |bytesNee|ded;...}| |000035f0| 0d 09 7d 0d 09 23 65 6e | 64 69 66 0d 09 0d 09 2f |..}..#en|dif..../| |00003600| 2f 20 52 65 73 6f 72 74 | 20 74 6f 20 61 70 70 27 |/ Resort| to app'| |00003610| 73 20 68 65 61 70 20 66 | 6f 72 20 74 65 6d 70 20 |s heap f|or temp | |00003620| 6d 65 6d 20 69 66 20 66 | 61 69 6c 65 64 20 74 65 |mem if f|ailed te| |00003630| 6d 70 20 6d 65 6d 20 61 | 74 74 65 6d 70 74 20 6f |mp mem a|ttempt o| |00003640| 72 20 69 6e 20 77 69 6e | 33 32 0d 09 69 66 20 28 |r in win|32..if (| |00003650| 20 21 20 74 65 6d 70 42 | 69 74 73 20 29 20 7b 0d | ! tempB|its ) {.| |00003660| 09 09 6d 54 65 6d 70 42 | 75 66 2e 44 69 6d 28 20 |..mTempB|uf.Dim( | |00003670| 62 79 74 65 73 4e 65 65 | 64 65 64 20 29 3b 0d 09 |bytesNee|ded );..| |00003680| 09 74 65 6d 70 42 69 74 | 73 20 3d 20 6d 54 65 6d |.tempBit|s = mTem| |00003690| 70 42 75 66 2e 67 65 74 | 43 53 74 72 28 29 3b 0d |pBuf.get|CStr();.| |000036a0| 09 7d 0d 0d 09 2f 2f 20 | 48 61 76 65 20 74 68 65 |.}...// |Have the| |000036b0| 20 62 6f 78 20 74 65 6d | 70 20 61 6e 64 20 74 68 | box tem|p and th| |000036c0| 65 20 70 69 78 65 6c 20 | 74 65 6d 70 20 72 67 6e |e pixel |temp rgn| |000036d0| 73 20 75 73 65 20 74 68 | 65 20 73 61 6d 65 20 68 |s use th|e same h| |000036e0| 61 6e 64 6c 65 0d 09 62 | 6f 78 54 65 6d 70 20 3d |andle..b|oxTemp =| |000036f0| 20 28 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 2a | (unsign|ed long*| |00003700| 29 20 74 65 6d 70 42 69 | 74 73 3b 0d 09 74 65 6d |) tempBi|ts;..tem| |00003710| 70 42 69 74 73 20 2b 3d | 20 62 6f 78 54 65 6d 70 |pBits +=| boxTemp| |00003720| 53 69 7a 65 3b 0d 09 0d | 09 69 66 20 28 20 21 20 |Size;...|.if ( ! | |00003730| 69 6e 44 65 73 74 42 69 | 74 73 20 29 0d 09 09 69 |inDestBi|ts )...i| |00003740| 6e 44 65 73 74 42 69 74 | 73 20 3d 20 6d 42 69 74 |nDestBit|s = mBit| |00003750| 73 3b 0d 09 09 0d 09 2f | 2f 20 44 6f 20 61 20 62 |s;...../|/ Do a b| |00003760| 6f 78 20 62 6c 75 72 20 | 6f 6e 20 74 68 65 20 78 |ox blur |on the x| |00003770| 20 61 78 69 73 2c 20 74 | 72 61 6e 73 70 6f 73 69 | axis, t|ransposi| |00003780| 6e 67 20 74 68 65 20 73 | 6f 75 72 63 65 20 72 67 |ng the s|ource rg| |00003790| 6e 20 74 6f 20 74 68 65 | 20 64 65 73 74 20 72 67 |n to the| dest rg| |000037a0| 6e 0d 09 2f 2f 20 54 68 | 65 6e 20 6f 20 61 20 62 |n..// Th|en o a b| |000037b0| 6f 78 20 62 6c 75 72 20 | 6f 6e 20 74 68 65 20 74 |ox blur |on the t| |000037c0| 72 61 6e 73 70 6f 73 65 | 64 20 69 6d 61 67 65 2c |ranspose|d image,| |000037d0| 20 65 66 66 65 63 74 69 | 76 65 6c 79 20 62 6c 75 | effecti|vely blu| |000037e0| 72 72 69 6e 67 20 74 68 | 65 20 79 20 63 6f 72 64 |rring th|e y cord| |000037f0| 73 2c 20 74 72 61 6e 73 | 70 6f 73 69 6e 67 20 69 |s, trans|posing i| |00003800| 74 20 74 6f 20 74 68 65 | 20 64 65 73 74 0d 09 69 |t to the| dest..i| |00003810| 66 20 28 20 6d 42 79 74 | 65 73 50 65 72 50 69 78 |f ( mByt|esPerPix| |00003820| 20 3d 3d 20 32 20 29 20 | 20 7b 09 0d 09 09 42 6f | == 2 ) | {....Bo| |00003830| 78 42 6c 75 72 31 36 28 | 20 28 20 6d 42 69 74 73 |xBlur16(| ( mBits| |00003840| 20 2b 20 69 6d 67 4f 66 | 66 73 65 74 29 2c 20 74 | + imgOf|fset), t| |00003850| 65 6d 70 42 69 74 73 2c | 20 69 6e 42 6f 78 57 69 |empBits,| inBoxWi| |00003860| 64 74 68 2c 20 77 69 64 | 74 68 2c 20 68 65 69 67 |dth, wid|th, heig| |00003870| 68 74 2c 20 6d 42 79 74 | 65 73 50 65 72 52 6f 77 |ht, mByt|esPerRow| |00003880| 2c 20 6d 42 79 74 65 73 | 50 65 72 50 69 78 2a 68 |, mBytes|PerPix*h| |00003890| 65 69 67 68 74 2c 20 62 | 6f 78 54 65 6d 70 2c 20 |eight, b|oxTemp, | |000038a0| 6d 42 61 63 6b 43 6f 6c | 6f 72 20 29 3b 0d 09 09 |mBackCol|or );...| |000038b0| 42 6f 78 42 6c 75 72 31 | 36 28 20 74 65 6d 70 42 |BoxBlur1|6( tempB| |000038c0| 69 74 73 2c 20 28 28 63 | 68 61 72 2a 29 20 69 6e |its, ((c|har*) in| |000038d0| 44 65 73 74 42 69 74 73 | 20 2b 20 69 6d 67 4f 66 |DestBits| + imgOf| |000038e0| 66 73 65 74 29 2c 20 69 | 6e 42 6f 78 57 69 64 74 |fset), i|nBoxWidt| |000038f0| 68 2c 20 68 65 69 67 68 | 74 2c 20 77 69 64 74 68 |h, heigh|t, width| |00003900| 2c 20 6d 42 79 74 65 73 | 50 65 72 50 69 78 2a 68 |, mBytes|PerPix*h| |00003910| 65 69 67 68 74 2c 20 6d | 42 79 74 65 73 50 65 72 |eight, m|BytesPer| |00003920| 52 6f 77 2c 20 62 6f 78 | 54 65 6d 70 2c 20 6d 42 |Row, box|Temp, mB| |00003930| 61 63 6b 43 6f 6c 6f 72 | 20 29 3b 20 20 7d 0d 09 |ackColor| ); }..| |00003940| 65 6c 73 65 20 69 66 20 | 28 20 6d 42 79 74 65 73 |else if |( mBytes| |00003950| 50 65 72 50 69 78 20 3d | 3d 20 34 20 29 20 7b 0d |PerPix =|= 4 ) {.| |00003960| 09 09 42 6f 78 42 6c 75 | 72 33 32 28 20 28 20 6d |..BoxBlu|r32( ( m| |00003970| 42 69 74 73 20 2b 20 69 | 6d 67 4f 66 66 73 65 74 |Bits + i|mgOffset| |00003980| 29 2c 20 74 65 6d 70 42 | 69 74 73 2c 20 69 6e 42 |), tempB|its, inB| |00003990| 6f 78 57 69 64 74 68 2c | 20 77 69 64 74 68 2c 20 |oxWidth,| width, | |000039a0| 68 65 69 67 68 74 2c 20 | 6d 42 79 74 65 73 50 65 |height, |mBytesPe| |000039b0| 72 52 6f 77 2c 20 6d 42 | 79 74 65 73 50 65 72 50 |rRow, mB|ytesPerP| |000039c0| 69 78 2a 68 65 69 67 68 | 74 2c 20 62 6f 78 54 65 |ix*heigh|t, boxTe| |000039d0| 6d 70 2c 20 6d 42 61 63 | 6b 43 6f 6c 6f 72 20 29 |mp, mBac|kColor )| |000039e0| 3b 0d 09 09 42 6f 78 42 | 6c 75 72 33 32 28 20 74 |;...BoxB|lur32( t| |000039f0| 65 6d 70 42 69 74 73 2c | 20 28 28 63 68 61 72 2a |empBits,| ((char*| |00003a00| 29 20 69 6e 44 65 73 74 | 42 69 74 73 20 2b 20 69 |) inDest|Bits + i| |00003a10| 6d 67 4f 66 66 73 65 74 | 29 2c 20 69 6e 42 6f 78 |mgOffset|), inBox| |00003a20| 57 69 64 74 68 2c 20 68 | 65 69 67 68 74 2c 20 77 |Width, h|eight, w| |00003a30| 69 64 74 68 2c 20 6d 42 | 79 74 65 73 50 65 72 50 |idth, mB|ytesPerP| |00003a40| 69 78 2a 68 65 69 67 68 | 74 2c 20 6d 42 79 74 65 |ix*heigh|t, mByte| |00003a50| 73 50 65 72 52 6f 77 2c | 20 62 6f 78 54 65 6d 70 |sPerRow,| boxTemp| |00003a60| 2c 20 6d 42 61 63 6b 43 | 6f 6c 6f 72 20 29 3b 20 |, mBackC|olor ); | |00003a70| 0d 09 7d 0d 7d 0d 0d 0d | 0d 76 6f 69 64 20 50 69 |..}.}...|.void Pi| |00003a80| 78 50 6f 72 74 3a 3a 43 | 72 6f 73 73 42 6c 75 72 |xPort::C|rossBlur| |00003a90| 28 20 63 6f 6e 73 74 20 | 52 65 63 74 26 20 69 6e |( const |Rect& in| |00003aa0| 52 65 63 74 20 29 20 7b | 09 0d 09 0d 09 2f 2f 20 |Rect ) {|.....// | |00003ab0| 44 6f 6e 27 74 20 6c 65 | 74 20 75 73 20 64 72 61 |Don't le|t us dra| |00003ac0| 77 20 69 6e 20 72 61 6e | 64 6f 6d 20 70 61 72 74 |w in ran|dom part| |00003ad0| 73 20 6f 66 20 6d 65 6d | 6f 72 79 20 2d 2d 20 63 |s of mem|ory -- c| |00003ae0| 6c 69 70 20 69 6e 52 65 | 63 74 0d 09 5f 5f 63 6c |lip inRe|ct..__cl| |00003af0| 69 70 52 65 63 74 28 20 | 69 6e 52 65 63 74 20 29 |ipRect( |inRect )| |00003b00| 0d 09 0d 09 0d 09 2f 2f | 20 49 6e 20 57 69 6e 33 |......//| In Win3| |00003b10| 32 2c 20 65 76 65 72 79 | 74 68 69 6e 67 27 73 20 |2, every|thing's | |00003b20| 75 70 73 69 64 65 20 64 | 6f 77 6e 0d 09 23 69 66 |upside d|own..#if| |00003b30| 20 45 47 5f 57 49 4e 0d | 09 72 2e 74 6f 70 20 3d | EG_WIN.|.r.top =| |00003b40| 20 6d 59 20 2d 20 72 2e | 62 6f 74 74 6f 6d 3b 0d | mY - r.|bottom;.| |00003b50| 09 23 65 6e 64 69 66 0d | 0d 09 2f 2f 20 33 20 62 |.#endif.|..// 3 b| |00003b60| 6f 78 20 63 6f 6e 76 6f | 6c 75 74 69 6f 6e 73 2c |ox convo|lutions,| |00003b70| 20 33 20 63 6f 6c 6f 72 | 73 20 70 65 72 20 70 69 | 3 color|s per pi| |00003b80| 78 65 6c 2c 20 34 20 62 | 79 74 65 73 20 70 65 72 |xel, 4 b|ytes per| |00003b90| 20 63 6f 6c 6f 72 0d 09 | 6c 6f 6e 67 09 69 6d 67 | color..|long.img| |00003ba0| 4f 66 66 73 65 74 09 3d | 20 6d 42 79 74 65 73 50 |Offset.=| mBytesP| |00003bb0| 65 72 50 69 78 20 2a 20 | 72 2e 6c 65 66 74 20 2b |erPix * |r.left +| |00003bc0| 20 72 2e 74 6f 70 20 2a | 20 6d 42 79 74 65 73 50 | r.top *| mBytesP| |00003bd0| 65 72 52 6f 77 3b 0d 09 | 0d 09 6d 54 65 6d 70 42 |erRow;..|..mTempB| |00003be0| 75 66 2e 44 69 6d 28 20 | 6d 58 20 2a 20 33 20 29 |uf.Dim( |mX * 3 )| |00003bf0| 3b 0d 09 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |;..unsig|ned char| |00003c00| 2a 20 74 65 6d 70 42 69 | 74 73 20 3d 20 28 75 6e |* tempBi|ts = (un| |00003c10| 73 69 67 6e 65 64 20 63 | 68 61 72 2a 29 20 6d 54 |signed c|har*) mT| |00003c20| 65 6d 70 42 75 66 2e 67 | 65 74 43 53 74 72 28 29 |empBuf.g|etCStr()| |00003c30| 3b 0d 0d 09 09 0d 09 69 | 66 20 28 20 6d 42 79 74 |;......i|f ( mByt| |00003c40| 65 73 50 65 72 50 69 78 | 20 3d 3d 20 32 20 29 20 |esPerPix| == 2 ) | |00003c50| 0d 09 09 43 72 6f 73 73 | 42 6c 75 72 31 36 28 20 |...Cross|Blur16( | |00003c60| 28 20 6d 42 69 74 73 20 | 2b 20 69 6d 67 4f 66 66 |( mBits |+ imgOff| |00003c70| 73 65 74 29 2c 20 77 69 | 64 74 68 2c 20 68 65 69 |set), wi|dth, hei| |00003c80| 67 68 74 2c 20 6d 42 79 | 74 65 73 50 65 72 52 6f |ght, mBy|tesPerRo| |00003c90| 77 2c 20 74 65 6d 70 42 | 69 74 73 20 29 3b 20 0d |w, tempB|its ); .| |00003ca0| 09 65 6c 73 65 20 69 66 | 20 28 20 6d 42 79 74 65 |.else if| ( mByte| |00003cb0| 73 50 65 72 50 69 78 20 | 3d 3d 20 34 20 29 0d 09 |sPerPix |== 4 )..| |00003cc0| 09 43 72 6f 73 73 42 6c | 75 72 33 32 28 20 28 20 |.CrossBl|ur32( ( | |00003cd0| 6d 42 69 74 73 20 2b 20 | 69 6d 67 4f 66 66 73 65 |mBits + |imgOffse| |00003ce0| 74 29 2c 20 77 69 64 74 | 68 2c 20 68 65 69 67 68 |t), widt|h, heigh| |00003cf0| 74 2c 20 6d 42 79 74 65 | 73 50 65 72 52 6f 77 2c |t, mByte|sPerRow,| |00003d00| 20 74 65 6d 70 42 69 74 | 73 20 29 3b 0d 09 0d 7d | tempBit|s );...}| |00003d10| 0d 0d 0d 0d 0d 0d 0d 76 | 6f 69 64 20 50 69 78 50 |.......v|oid PixP| |00003d20| 6f 72 74 3a 3a 43 6f 70 | 79 42 69 74 73 28 20 57 |ort::Cop|yBits( W| |00003d30| 69 6e 64 6f 77 50 74 72 | 20 69 6e 44 65 73 74 2c |indowPtr| inDest,| |00003d40| 20 63 6f 6e 73 74 20 52 | 65 63 74 2a 20 69 6e 53 | const R|ect* inS| |00003d50| 72 63 65 2c 20 63 6f 6e | 73 74 20 52 65 63 74 2a |rce, con|st Rect*| |00003d60| 20 69 6e 44 65 73 74 52 | 65 63 74 20 29 20 7b 0d | inDestR|ect ) {.| |00003d70| 09 0d 09 23 69 66 20 45 | 47 5f 4d 41 43 0d 09 3a |...#if E|G_MAC..:| |00003d80| 3a 43 6f 70 79 42 69 74 | 73 28 20 28 42 69 74 4d |:CopyBit|s( (BitM| |00003d90| 61 70 2a 29 20 2a 6d 42 | 4d 2c 20 26 69 6e 44 65 |ap*) *mB|M, &inDe| |00003da0| 73 74 2d 3e 70 6f 72 74 | 42 69 74 73 2c 20 69 6e |st->port|Bits, in| |00003db0| 53 72 63 65 2c 20 69 6e | 44 65 73 74 52 65 63 74 |Srce, in|DestRect| |00003dc0| 2c 20 73 72 63 43 6f 70 | 79 2c 20 4e 55 4c 4c 20 |, srcCop|y, NULL | |00003dd0| 29 3b 0d 09 23 65 6c 69 | 66 20 45 47 5f 57 49 4e |);..#eli|f EG_WIN| |00003de0| 0d 09 48 44 43 20 68 64 | 63 20 3d 20 3a 3a 47 65 |..HDC hd|c = ::Ge| |00003df0| 74 44 43 28 20 69 6e 44 | 65 73 74 20 29 3b 0d 09 |tDC( inD|est );..| |00003e00| 3a 3a 42 69 74 42 6c 74 | 28 20 68 64 63 2c 20 69 |::BitBlt|( hdc, i| |00003e10| 6e 44 65 73 74 52 65 63 | 74 20 2d 3e 20 6c 65 66 |nDestRec|t -> lef| |00003e20| 74 2c 20 69 6e 44 65 73 | 74 52 65 63 74 20 2d 3e |t, inDes|tRect ->| |00003e30| 20 74 6f 70 2c 20 69 6e | 44 65 73 74 52 65 63 74 | top, in|DestRect| |00003e40| 20 2d 3e 20 72 69 67 68 | 74 20 2d 20 69 6e 44 65 | -> righ|t - inDe| |00003e50| 73 74 52 65 63 74 20 2d | 3e 20 6c 65 66 74 2c 20 |stRect -|> left, | |00003e60| 69 6e 44 65 73 74 52 65 | 63 74 20 2d 3e 20 62 6f |inDestRe|ct -> bo| |00003e70| 74 74 6f 6d 20 2d 20 69 | 6e 44 65 73 74 52 65 63 |ttom - i|nDestRec| |00003e80| 74 20 2d 3e 20 74 6f 70 | 2c 20 6d 57 6f 72 6c 64 |t -> top|, mWorld| |00003e90| 2c 20 69 6e 53 72 63 65 | 20 2d 3e 20 6c 65 66 74 |, inSrce| -> left| |00003ea0| 2c 20 69 6e 53 72 63 65 | 20 2d 3e 20 74 6f 70 2c |, inSrce| -> top,| |00003eb0| 20 53 52 43 43 4f 50 59 | 20 29 3b 0d 09 3a 3a 52 | SRCCOPY| );..::R| |00003ec0| 65 6c 65 61 73 65 44 43 | 28 20 69 6e 44 65 73 74 |eleaseDC|( inDest| |00003ed0| 2c 20 68 64 63 20 29 3b | 0d 09 23 65 6e 64 69 66 |, hdc );|..#endif| |00003ee0| 0d 7d 0d 0d 0d 0d 0d 0d | 76 6f 69 64 20 50 69 78 |.}......|void Pix| |00003ef0| 50 6f 72 74 3a 3a 4c 69 | 6e 65 28 20 69 6e 74 20 |Port::Li|ne( int | |00003f00| 73 78 2c 20 69 6e 74 20 | 73 79 2c 20 69 6e 74 20 |sx, int |sy, int | |00003f10| 65 78 2c 20 69 6e 74 20 | 65 79 2c 20 6c 6f 6e 67 |ex, int |ey, long| |00003f20| 20 69 6e 43 6f 6c 6f 72 | 20 29 20 7b 0d 09 0d 09 | inColor| ) {....| |00003f30| 69 66 20 28 20 6d 42 79 | 74 65 73 50 65 72 50 69 |if ( mBy|tesPerPi| |00003f40| 78 20 3d 3d 20 32 20 29 | 20 0d 09 09 4c 69 6e 65 |x == 2 )| ...Line| |00003f50| 31 36 28 20 73 78 2c 20 | 73 79 2c 20 65 78 2c 20 |16( sx, |sy, ex, | |00003f60| 65 79 2c 20 69 6e 43 6f | 6c 6f 72 20 29 3b 0d 09 |ey, inCo|lor );..| |00003f70| 65 6c 73 65 20 69 66 20 | 28 20 6d 42 79 74 65 73 |else if |( mBytes| |00003f80| 50 65 72 50 69 78 20 3d | 3d 20 31 20 29 0d 09 09 |PerPix =|= 1 )...| |00003f90| 4c 69 6e 65 38 20 28 20 | 73 78 2c 20 73 79 2c 20 |Line8 ( |sx, sy, | |00003fa0| 65 78 2c 20 65 79 2c 20 | 69 6e 43 6f 6c 6f 72 20 |ex, ey, |inColor | |00003fb0| 29 3b 0d 09 65 6c 73 65 | 20 69 66 20 28 20 6d 42 |);..else| if ( mB| |00003fc0| 79 74 65 73 50 65 72 50 | 69 78 20 3d 3d 20 34 20 |ytesPerP|ix == 4 | |00003fd0| 29 20 0d 09 09 4c 69 6e | 65 33 32 28 20 73 78 2c |) ...Lin|e32( sx,| |00003fe0| 20 73 79 2c 20 65 78 2c | 20 65 79 2c 20 69 6e 43 | sy, ex,| ey, inC| |00003ff0| 6f 6c 6f 72 20 29 3b 0d | 7d 0d 0d 0d 0d 0d 76 6f |olor );.|}.....vo| |00004000| 69 64 20 50 69 78 50 6f | 72 74 3a 3a 4c 69 6e 65 |id PixPo|rt::Line| |00004010| 28 20 69 6e 74 20 73 78 | 2c 20 69 6e 74 20 73 79 |( int sx|, int sy| |00004020| 2c 20 69 6e 74 20 65 78 | 2c 20 69 6e 74 20 65 79 |, int ex|, int ey| |00004030| 2c 20 63 6f 6e 73 74 20 | 52 47 42 43 6f 6c 6f 72 |, const |RGBColor| |00004040| 26 20 69 6e 53 2c 20 63 | 6f 6e 73 74 20 52 47 42 |& inS, c|onst RGB| |00004050| 43 6f 6c 6f 72 26 20 69 | 6e 45 20 29 20 7b 0d 09 |Color& i|nE ) {..| |00004060| 6c 6f 6e 67 20 52 2c 20 | 47 2c 20 42 2c 20 64 52 |long R, |G, B, dR| |00004070| 2c 20 64 47 2c 20 64 42 | 2c 20 61 62 73 64 52 2c |, dG, dB|, absdR,| |00004080| 20 61 62 73 64 47 2c 20 | 61 62 73 64 42 3b 0d 09 | absdG, |absdB;..| |00004090| 0d 09 52 20 3d 20 69 6e | 53 2e 72 65 64 3b 0d 09 |..R = in|S.red;..| |000040a0| 47 20 3d 20 69 6e 53 2e | 67 72 65 65 6e 3b 0d 09 |G = inS.|green;..| |000040b0| 42 20 3d 20 69 6e 53 2e | 62 6c 75 65 3b 0d 09 64 |B = inS.|blue;..d| |000040c0| 52 20 3d 20 69 6e 45 2e | 72 65 64 20 2d 20 52 3b |R = inE.|red - R;| |000040d0| 0d 09 64 47 20 3d 20 69 | 6e 45 2e 67 72 65 65 6e |..dG = i|nE.green| |000040e0| 20 2d 20 47 3b 0d 09 64 | 42 20 3d 20 69 6e 45 2e | - G;..d|B = inE.| |000040f0| 62 6c 75 65 20 2d 20 42 | 3b 0d 09 61 62 73 64 52 |blue - B|;..absdR| |00004100| 20 3d 20 64 52 20 26 20 | 30 78 37 46 46 46 46 46 | = dR & |0x7FFFFF| |00004110| 46 46 3b 09 09 2f 2f 20 | 41 62 73 20 76 61 6c 75 |FF;..// |Abs valu| |00004120| 65 0d 09 61 62 73 64 47 | 20 3d 20 64 47 20 26 20 |e..absdG| = dG & | |00004130| 30 78 37 46 46 46 46 46 | 46 46 3b 0d 09 61 62 73 |0x7FFFFF|FF;..abs| |00004140| 64 42 20 3d 20 64 42 20 | 26 20 30 78 37 46 46 46 |dB = dB |& 0x7FFF| |00004150| 46 46 46 46 3b 0d 09 0d | 09 2f 2f 20 49 66 20 74 |FFFF;...|.// If t| |00004160| 68 65 20 65 6e 64 70 6f | 69 6e 74 73 20 68 61 76 |he endpo|ints hav| |00004170| 65 20 74 68 65 20 73 61 | 6d 65 20 63 6f 6c 6f 72 |e the sa|me color| |00004180| 2c 20 72 75 6e 20 74 68 | 65 20 66 61 73 74 65 72 |, run th|e faster| |00004190| 20 6c 69 6e 65 20 70 72 | 6f 63 73 20 28 74 68 61 | line pr|ocs (tha| |000041a0| 74 20 6a 75 73 74 20 75 | 73 65 20 6f 6e 65 20 63 |t just u|se one c| |000041b0| 6f 6c 6f 72 29 0d 09 69 | 66 20 28 20 61 62 73 64 |olor)..i|f ( absd| |000041c0| 52 20 3c 20 35 32 30 20 | 26 26 20 61 62 73 64 47 |R < 520 |&& absdG| |000041d0| 20 3c 20 35 32 30 20 26 | 26 20 61 62 73 64 42 20 | < 520 &|& absdB | |000041e0| 3c 20 35 32 30 20 29 20 | 7b 0d 09 09 6c 6f 6e 67 |< 520 ) |{...long| |000041f0| 20 63 6f 6c 6f 72 3b 0d | 0d 09 09 69 66 20 28 20 | color;.|...if ( | |00004200| 6d 42 79 74 65 73 50 65 | 72 50 69 78 20 3d 3d 20 |mBytesPe|rPix == | |00004210| 32 20 29 20 7b 0d 09 09 | 09 63 6f 6c 6f 72 20 3d |2 ) {...|.color =| |00004220| 20 5f 5f 43 6c 72 31 36 | 28 20 52 2c 20 47 2c 20 | __Clr16|( R, G, | |00004230| 42 20 29 3b 0d 09 09 09 | 4c 69 6e 65 31 36 28 20 |B );....|Line16( | |00004240| 73 78 2c 20 73 79 2c 20 | 65 78 2c 20 65 79 2c 20 |sx, sy, |ex, ey, | |00004250| 63 6f 6c 6f 72 20 29 3b | 20 7d 0d 09 09 65 6c 73 |color );| }...els| |00004260| 65 20 69 66 20 28 20 6d | 42 79 74 65 73 50 65 72 |e if ( m|BytesPer| |00004270| 50 69 78 20 3d 3d 20 34 | 20 29 20 7b 0d 09 09 09 |Pix == 4| ) {....| |00004280| 63 6f 6c 6f 72 20 3d 20 | 5f 5f 43 6c 72 33 32 28 |color = |__Clr32(| |00004290| 20 52 2c 20 47 2c 20 42 | 20 29 3b 0d 09 09 09 4c | R, G, B| );....L| |000042a0| 69 6e 65 33 32 28 20 73 | 78 2c 20 73 79 2c 20 65 |ine32( s|x, sy, e| |000042b0| 78 2c 20 65 79 2c 20 63 | 6f 6c 6f 72 20 29 3b 20 |x, ey, c|olor ); | |000042c0| 7d 0d 09 09 65 6c 73 65 | 20 69 66 20 28 20 6d 42 |}...else| if ( mB| |000042d0| 79 74 65 73 50 65 72 50 | 69 78 20 3d 3d 20 31 20 |ytesPerP|ix == 1 | |000042e0| 29 20 7b 0d 09 09 09 63 | 6f 6c 6f 72 20 3d 20 5f |) {....c|olor = _| |000042f0| 5f 43 6c 72 38 28 20 52 | 2c 20 47 2c 20 42 20 29 |_Clr8( R|, G, B )| |00004300| 3b 0d 09 09 09 4c 69 6e | 65 38 20 28 20 73 78 2c |;....Lin|e8 ( sx,| |00004310| 20 73 79 2c 20 65 78 2c | 20 65 79 2c 20 63 6f 6c | sy, ex,| ey, col| |00004320| 6f 72 20 29 3b 0d 09 09 | 7d 20 7d 0d 09 65 6c 73 |or );...|} }..els| |00004330| 65 20 7b 0d 09 09 69 66 | 20 28 20 6d 42 79 74 65 |e {...if| ( mByte| |00004340| 73 50 65 72 50 69 78 20 | 3d 3d 20 32 20 29 20 0d |sPerPix |== 2 ) .| |00004350| 09 09 09 4c 69 6e 65 31 | 36 28 20 73 78 2c 20 73 |...Line1|6( sx, s| |00004360| 79 2c 20 65 78 2c 20 65 | 79 2c 20 69 6e 53 2c 20 |y, ex, e|y, inS, | |00004370| 64 52 2c 20 64 47 2c 20 | 64 42 20 29 3b 0d 09 09 |dR, dG, |dB );...| |00004380| 65 6c 73 65 20 69 66 20 | 28 20 6d 42 79 74 65 73 |else if |( mBytes| |00004390| 50 65 72 50 69 78 20 3d | 3d 20 34 20 29 20 0d 09 |PerPix =|= 4 ) ..| |000043a0| 09 09 4c 69 6e 65 33 32 | 28 20 73 78 2c 20 73 79 |..Line32|( sx, sy| |000043b0| 2c 20 65 78 2c 20 65 79 | 2c 20 69 6e 53 2c 20 64 |, ex, ey|, inS, d| |000043c0| 52 2c 20 64 47 2c 20 64 | 42 20 29 3b 0d 09 09 65 |R, dG, d|B );...e| |000043d0| 6c 73 65 20 69 66 20 28 | 20 6d 42 79 74 65 73 50 |lse if (| mBytesP| |000043e0| 65 72 50 69 78 20 3d 3d | 20 31 20 29 0d 09 09 09 |erPix ==| 1 )....| |000043f0| 4c 69 6e 65 38 20 28 20 | 73 78 2c 20 73 79 2c 20 |Line8 ( |sx, sy, | |00004400| 65 78 2c 20 65 79 2c 20 | 69 6e 53 2c 20 64 52 2c |ex, ey, |inS, dR,| |00004410| 20 64 47 2c 20 64 42 20 | 29 3b 0d 09 7d 0d 7d 0d | dG, dB |);..}.}.| |00004420| 0d 0d 0d 76 6f 69 64 20 | 50 69 78 50 6f 72 74 3a |...void |PixPort:| |00004430| 3a 53 65 74 4c 69 6e 65 | 57 69 64 74 68 28 20 6c |:SetLine|Width( l| |00004440| 6f 6e 67 20 69 6e 4c 69 | 6e 65 57 69 64 74 68 20 |ong inLi|neWidth | |00004450| 29 20 7b 0d 09 69 66 20 | 28 20 69 6e 4c 69 6e 65 |) {..if |( inLine| |00004460| 57 69 64 74 68 20 3c 3d | 20 30 20 29 0d 09 09 6d |Width <=| 0 )...m| |00004470| 4c 69 6e 65 57 69 64 74 | 68 20 3d 20 31 3b 0d 09 |LineWidt|h = 1;..| |00004480| 65 6c 73 65 20 69 66 20 | 28 20 69 6e 4c 69 6e 65 |else if |( inLine| |00004490| 57 69 64 74 68 20 3e 20 | 4d 41 58 5f 4c 49 4e 45 |Width > |MAX_LINE| |000044a0| 5f 57 49 44 54 48 20 29 | 0d 09 09 6d 4c 69 6e 65 |_WIDTH )|...mLine| |000044b0| 57 69 64 74 68 20 3d 20 | 4d 41 58 5f 4c 49 4e 45 |Width = |MAX_LINE| |000044c0| 5f 57 49 44 54 48 3b 0d | 09 65 6c 73 65 0d 09 09 |_WIDTH;.|.else...| |000044d0| 6d 4c 69 6e 65 57 69 64 | 74 68 20 3d 20 69 6e 4c |mLineWid|th = inL| |000044e0| 69 6e 65 57 69 64 74 68 | 3b 0d 7d 0d 0d 76 6f 69 |ineWidth|;.}..voi| |000044f0| 64 20 50 69 78 50 6f 72 | 74 3a 3a 45 72 61 73 65 |d PixPor|t::Erase| |00004500| 52 65 63 74 28 20 63 6f | 6e 73 74 20 52 65 63 74 |Rect( co|nst Rect| |00004510| 2a 20 69 6e 52 65 63 74 | 20 29 20 7b 0d 09 0d 09 |* inRect| ) {....| |00004520| 69 66 20 28 20 6d 42 79 | 74 65 73 50 65 72 50 69 |if ( mBy|tesPerPi| |00004530| 78 20 3d 3d 20 32 20 29 | 0d 09 09 45 72 61 73 65 |x == 2 )|...Erase| |00004540| 52 65 63 74 31 36 28 20 | 69 6e 52 65 63 74 20 29 |Rect16( |inRect )| |00004550| 3b 0d 09 65 6c 73 65 20 | 69 66 20 28 20 6d 42 79 |;..else |if ( mBy| |00004560| 74 65 73 50 65 72 50 69 | 78 20 3d 3d 20 31 20 29 |tesPerPi|x == 1 )| |00004570| 0d 09 09 45 72 61 73 65 | 52 65 63 74 38 20 28 20 |...Erase|Rect8 ( | |00004580| 69 6e 52 65 63 74 20 29 | 3b 0d 09 65 6c 73 65 20 |inRect )|;..else | |00004590| 69 66 20 28 20 6d 42 79 | 74 65 73 50 65 72 50 69 |if ( mBy|tesPerPi| |000045a0| 78 20 3d 3d 20 34 20 29 | 0d 09 09 45 72 61 73 65 |x == 4 )|...Erase| |000045b0| 52 65 63 74 33 32 28 20 | 69 6e 52 65 63 74 20 29 |Rect32( |inRect )| |000045c0| 3b 0d 7d 0d 0d 0d 0d 0d | 23 64 65 66 69 6e 65 20 |;.}.....|#define | |000045d0| 50 5f 53 5a 09 31 0d 23 | 69 6e 63 6c 75 64 65 20 |P_SZ.1.#|include | |000045e0| 22 44 72 61 77 58 58 2e | 63 70 70 22 0d 0d 0d 23 |"DrawXX.|cpp"...#| |000045f0| 75 6e 64 65 66 20 50 5f | 53 5a 0d 23 64 65 66 69 |undef P_|SZ.#defi| |00004600| 6e 65 20 50 5f 53 5a 09 | 32 0d 23 69 6e 63 6c 75 |ne P_SZ.|2.#inclu| |00004610| 64 65 20 22 44 72 61 77 | 58 58 2e 63 70 70 22 0d |de "Draw|XX.cpp".| |00004620| 0d 0d 23 75 6e 64 65 66 | 20 50 5f 53 5a 0d 23 64 |..#undef| P_SZ.#d| |00004630| 65 66 69 6e 65 20 50 5f | 53 5a 09 34 0d 23 69 6e |efine P_|SZ.4.#in| |00004640| 63 6c 75 64 65 20 22 44 | 72 61 77 58 58 2e 63 70 |clude "D|rawXX.cp| |00004650| 70 22 0d 0d 2f 2a 0d 23 | 64 65 66 69 6e 65 20 48 |p"../*.#|define H| |00004660| 41 4c 46 43 4f 52 44 09 | 30 78 30 30 37 46 20 20 |ALFCORD.|0x007F | |00004670| 2f 2a 20 31 36 20 62 69 | 74 73 20 70 65 72 20 63 |/* 16 bi|ts per c| |00004680| 6f 72 64 2c 20 38 20 62 | 69 74 73 20 66 6f 72 20 |ord, 8 b|its for | |00004690| 66 69 78 65 64 20 64 65 | 63 69 6d 61 6c 20 2d 3e |fixed de|cimal ->| |000046a0| 20 6d 65 61 6e 73 20 2b | 2f 2d 20 31 32 37 0d 0d | means +|/- 127..| |000046b0| 0d 23 64 65 66 69 6e 65 | 20 5f 5f 6c 6f 61 64 47 |.#define| __loadG| |000046c0| 72 61 64 09 67 20 3d 20 | 2a 28 28 75 6e 73 69 67 |rad.g = |*((unsig| |000046d0| 6e 65 64 20 6c 6f 6e 67 | 2a 29 20 69 6e 47 72 61 |ned long|*) inGra| |000046e0| 64 29 3b 09 09 09 09 09 | 09 09 09 09 09 09 5c 0d |d);.....|......\.| |000046f0| 09 09 09 09 09 78 73 72 | 63 20 3d 20 67 20 3e 3e |.....xsr|c = g >>| |00004700| 20 32 34 3b 09 09 09 09 | 09 09 09 09 09 09 09 09 | 24;....|........| |00004710| 09 09 09 5c 0d 09 09 09 | 09 09 79 73 72 63 20 3d |...\....|..ysrc =| |00004720| 20 28 67 20 3e 3e 20 38 | 29 20 26 20 30 78 46 46 | (g >> 8|) & 0xFF| |00004730| 3b 09 0d 0d 23 64 65 66 | 69 6e 65 20 5f 5f 63 61 |;...#def|ine __ca| |00004740| 6c 63 50 09 09 76 20 3d | 20 67 20 26 20 30 78 46 |lcP..v =| g & 0xF| |00004750| 46 3b 09 09 09 2f 2a 20 | 78 20 2d 20 78 73 72 63 |F;.../* |x - xsrc| |00004760| 20 09 09 09 09 09 09 09 | 09 09 5c 0d 09 09 09 09 | .......|..\.....| |00004770| 09 75 20 3d 20 28 67 20 | 3e 3e 20 31 36 29 20 26 |.u = (g |>> 16) &| |00004780| 20 30 78 46 46 3b 09 2f | 2a 20 79 20 2d 20 79 73 | 0xFF;./|* y - ys| |00004790| 72 63 20 09 09 09 09 09 | 09 09 09 09 5c 0d 09 09 |rc .....|....\...| |000047a0| 09 09 09 75 31 20 3d 20 | 30 78 31 30 30 20 2d 20 |...u1 = |0x100 - | |000047b0| 75 3b 09 09 09 2f 2a 20 | 31 20 2d 20 75 20 09 09 |u;.../* |1 - u ..| |000047c0| 09 09 09 09 09 09 09 09 | 5c 0d 09 09 09 09 09 70 |........|\......p| |000047d0| 20 20 3d 20 76 20 2a 20 | 28 20 50 33 20 2a 20 75 | = v * |( P3 * u| |000047e0| 31 20 2b 20 50 34 20 2a | 20 75 20 29 20 2b 20 28 |1 + P4 *| u ) + (| |000047f0| 20 30 78 31 30 30 20 2d | 20 76 20 29 20 2a 20 28 | 0x100 -| v ) * (| |00004800| 20 50 31 20 2a 20 75 31 | 20 2b 20 50 32 20 2a 20 | P1 * u1| + P2 * | |00004810| 75 20 29 3b 09 0d 0d 0d | 23 64 65 66 69 6e 65 20 |u );....|#define | |00004820| 5f 5f 6c 6f 61 64 50 58 | 09 50 31 20 09 3d 20 2a |__loadPX|.P1 .= *| |00004830| 28 28 75 6e 73 69 67 6e | 65 64 20 73 68 6f 72 74 |((unsign|ed short| |00004840| 2a 29 20 73 72 63 65 4d | 61 70 29 3b 09 09 09 09 |*) srceM|ap);....| |00004850| 09 09 09 09 09 09 5c 0d | 09 09 09 09 09 50 32 20 |......\.|.....P2 | |00004860| 20 3d 20 50 31 20 26 20 | 30 78 46 46 3b 09 09 09 | = P1 & |0xFF;...| |00004870| 09 09 09 09 09 09 09 09 | 09 09 09 5c 0d 09 09 09 |........|...\....| |00004880| 09 09 50 31 20 20 3d 20 | 50 31 20 3e 3e 20 38 3b |..P1 = |P1 >> 8;| |00004890| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 5c |........|.......\| |000048a0| 0d 09 09 09 09 09 50 33 | 09 3d 20 2a 28 28 75 6e |......P3|.= *((un| |000048b0| 73 69 67 6e 65 64 20 73 | 68 6f 72 74 2a 29 20 28 |signed s|hort*) (| |000048c0| 73 72 63 65 4d 61 70 20 | 2b 20 6d 42 79 74 65 73 |srceMap |+ mBytes| |000048d0| 50 65 72 52 6f 77 29 29 | 3b 09 09 09 09 09 5c 0d |PerRow))|;.....\.| |000048e0| 09 09 09 09 09 50 34 20 | 20 3d 20 50 33 20 26 20 |.....P4 | = P3 & | |000048f0| 30 78 46 46 3b 09 09 09 | 09 09 09 09 09 09 09 09 |0xFF;...|........| |00004900| 09 09 09 5c 0d 09 09 09 | 09 09 50 33 20 20 3d 20 |...\....|..P3 = | |00004910| 50 33 20 3e 3e 20 38 3b | 09 09 09 09 09 09 09 09 |P3 >> 8;|........| |00004920| 09 09 09 09 09 09 09 5c | 0d 2f 2a 0d 76 6f 69 64 |.......\|./*.void| |00004930| 20 50 69 78 50 6f 72 74 | 3a 3a 46 61 64 65 28 20 | PixPort|::Fade( | |00004940| 50 69 78 50 6f 72 74 26 | 20 69 6f 44 65 73 74 2c |PixPort&| ioDest,| |00004950| 20 76 6f 69 64 2a 20 69 | 6e 47 72 61 64 20 29 20 | void* i|nGrad ) | |00004960| 7b 0d 09 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |{..unsig|ned long| |00004970| 20 67 2c 20 70 2c 20 78 | 2c 20 79 2c 20 78 73 72 | g, p, x|, y, xsr| |00004980| 63 2c 20 79 73 72 63 2c | 20 75 2c 20 76 2c 20 75 |c, ysrc,| u, v, u| |00004990| 31 2c 20 50 31 2c 20 50 | 32 2c 20 50 33 2c 20 50 |1, P1, P|2, P3, P| |000049a0| 34 2c 20 66 69 6e 61 6c | 50 3b 09 0d 09 63 68 61 |4, final|P;...cha| |000049b0| 72 2a 20 64 65 73 74 2c | 20 2a 73 72 63 65 42 61 |r* dest,| *srceBa| |000049c0| 73 65 2c 20 2a 73 72 63 | 65 4d 61 70 2c 20 2a 70 |se, *src|eMap, *p| |000049d0| 72 65 76 4d 61 70 3b 0d | 09 6c 6f 6e 67 20 64 65 |revMap;.|.long de| |000049e0| 73 74 52 6f 77 42 79 74 | 65 73 20 3d 20 69 6f 44 |stRowByt|es = ioD| |000049f0| 65 73 74 2e 6d 42 79 74 | 65 73 50 65 72 52 6f 77 |est.mByt|esPerRow| |00004a00| 3b 0d 0d 09 69 66 20 28 | 20 6d 42 79 74 65 73 50 |;...if (| mBytesP| |00004a10| 65 72 50 69 78 20 21 3d | 20 31 20 29 0d 09 09 72 |erPix !=| 1 )...r| |00004a20| 65 74 75 72 6e 3b 0d 09 | 09 0d 09 6c 6f 6e 67 20 |eturn;..|...long | |00004a30| 62 6c 61 68 3b 0d 09 6c | 6f 6e 67 2a 20 62 70 74 |blah;..l|ong* bpt| |00004a40| 72 20 3d 20 26 62 6c 61 | 68 3b 0d 09 0d 09 2f 2f |r = &bla|h;....//| |00004a50| 20 46 6f 72 20 65 76 65 | 72 79 20 70 69 78 65 6c | For eve|ry pixel| |00004a60| 20 69 6e 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 | in the |destinat| |00004a70| 69 6f 6e 2c 20 66 69 6e | 64 20 69 74 27 73 20 73 |ion, fin|d it's s| |00004a80| 6f 75 72 63 65 20 76 69 | 61 20 74 68 65 20 67 72 |ource vi|a the gr| |00004a90| 61 64 69 65 6e 74 0d 09 | 66 6f 72 20 28 20 79 20 |adient..|for ( y | |00004aa0| 3d 20 30 3b 20 79 20 3c | 20 6d 59 3b 20 79 2b 2b |= 0; y <| mY; y++| |00004ab0| 20 29 20 7b 0d 09 0d 09 | 09 2f 2f 20 53 65 74 75 | ) {....|.// Setu| |00004ac0| 70 20 74 68 65 20 64 65 | 73 74 20 72 6f 77 20 62 |p the de|st row b| |00004ad0| 61 73 65 20 61 64 64 72 | 65 73 73 0d 09 09 64 65 |ase addr|ess...de| |00004ae0| 73 74 20 3d 20 69 6f 44 | 65 73 74 2e 6d 42 69 74 |st = ioD|est.mBit| |00004af0| 73 20 2b 20 64 65 73 74 | 52 6f 77 42 79 74 65 73 |s + dest|RowBytes| |00004b00| 20 2a 20 79 3b 0d 09 09 | 0d 09 09 2f 2f 20 53 65 | * y;...|...// Se| |00004b10| 74 75 70 20 74 68 65 20 | 73 6f 75 72 63 65 20 72 |tup the |source r| |00004b20| 6f 77 20 62 61 73 65 20 | 61 64 64 72 65 73 73 2c |ow base |address,| |00004b30| 20 61 6c 73 6f 20 6f 66 | 66 73 65 74 20 74 6f 20 | also of|fset to | |00004b40| 61 6c 6c 6f 77 20 66 6f | 72 20 6e 65 67 61 74 69 |allow fo|r negati| |00004b50| 76 65 20 67 72 61 64 20 | 63 6f 6d 70 6f 6e 65 6e |ve grad |componen| |00004b60| 74 73 0d 09 09 73 72 63 | 65 42 61 73 65 20 3d 20 |ts...src|eBase = | |00004b70| 6d 42 69 74 73 20 2b 20 | 28 20 79 20 2d 20 48 41 |mBits + |( y - HA| |00004b80| 4c 46 43 4f 52 44 20 29 | 20 2a 20 6d 42 79 74 65 |LFCORD )| * mByte| |00004b90| 73 50 65 72 52 6f 77 20 | 2d 20 48 41 4c 46 43 4f |sPerRow |- HALFCO| |00004ba0| 52 44 3b 0d 09 09 0d 09 | 09 66 6f 72 20 28 20 78 |RD;.....|.for ( x| |00004bb0| 20 3d 20 30 3b 20 78 20 | 3c 20 6d 58 3b 20 78 20 | = 0; x |< mX; x | |00004bc0| 2b 3d 20 34 20 29 20 7b | 0d 09 09 09 2f 2f 20 45 |+= 4 ) {|....// E| |00004bd0| 78 74 72 61 63 74 20 74 | 68 65 20 67 72 61 64 69 |xtract t|he gradi| |00004be0| 65 6e 74 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 0d |ent info|rmation.| |00004bf0| 09 09 09 5f 5f 6c 6f 61 | 64 47 72 61 64 0d 09 09 |...__loa|dGrad...| |00004c00| 09 0d 09 09 09 2f 2f 20 | 50 31 20 2d 20 50 32 0d |.....// |P1 - P2.| |00004c10| 09 09 09 2f 2f 20 7c 20 | 20 20 20 20 7c 0d 09 09 |...// | | |...| |00004c20| 09 2f 2f 20 50 33 20 2d | 20 50 34 0d 09 09 09 73 |.// P3 -| P4....s| |00004c30| 72 63 65 4d 61 70 20 3d | 20 73 72 63 65 42 61 73 |rceMap =| srceBas| |00004c40| 65 20 2b 20 78 73 72 63 | 20 2b 20 79 73 72 63 20 |e + xsrc| + ysrc | |00004c50| 2a 20 6d 42 79 74 65 73 | 50 65 72 52 6f 77 3b 0d |* mBytes|PerRow;.| |00004c60| 09 09 09 5f 5f 6c 6f 61 | 64 50 58 0d 09 0d 09 09 |...__loa|dPX.....| |00004c70| 09 5f 5f 63 61 6c 63 50 | 0d 09 09 09 66 69 6e 61 |.__calcP|....fina| |00004c80| 6c 50 20 3d 20 28 70 20 | 26 20 30 78 46 46 46 46 |lP = (p |& 0xFFFF| |00004c90| 30 30 30 30 29 20 3c 3c | 20 38 3b 0d 09 09 09 0d |0000) <<| 8;.....| |00004ca0| 09 09 09 0d 09 09 09 2f | 2f 20 2a 2a 2a 2a 20 78 |......./|/ **** x| |00004cb0| 20 2b 20 31 0d 09 09 09 | 70 72 65 76 4d 61 70 20 | + 1....|prevMap | |00004cc0| 3d 20 73 72 63 65 4d 61 | 70 3b 0d 09 09 09 5f 5f |= srceMa|p;....__| |00004cd0| 6c 6f 61 64 47 72 61 64 | 0d 09 09 09 73 72 63 65 |loadGrad|....srce| |00004ce0| 4d 61 70 20 3d 20 73 72 | 63 65 42 61 73 65 20 2b |Map = sr|ceBase +| |00004cf0| 20 78 73 72 63 20 2b 20 | 79 73 72 63 20 2a 20 6d | xsrc + |ysrc * m| |00004d00| 42 79 74 65 73 50 65 72 | 52 6f 77 20 2b 20 31 3b |BytesPer|Row + 1;| |00004d10| 0d 0d 09 09 09 2f 2f 20 | 49 66 20 77 65 20 64 6f |.....// |If we do| |00004d20| 6e 27 74 20 61 6c 72 65 | 61 64 79 20 68 61 76 65 |n't alre|ady have| |00004d30| 20 74 68 65 20 66 6f 75 | 72 20 66 65 6e 63 65 20 | the fou|r fence | |00004d40| 70 69 78 65 6c 73 2c 20 | 6c 6f 61 64 20 74 68 65 |pixels, |load the| |00004d50| 6d 20 66 72 6f 6d 20 52 | 41 4d 0d 09 09 09 69 66 |m from R|AM....if| |00004d60| 20 28 20 73 72 63 65 4d | 61 70 20 21 3d 20 70 72 | ( srceM|ap != pr| |00004d70| 65 76 4d 61 70 20 29 20 | 7b 0d 09 09 09 09 5f 5f |evMap ) |{.....__| |00004d80| 6c 6f 61 64 50 58 0d 09 | 09 09 7d 0d 09 09 09 5f |loadPX..|..}...._| |00004d90| 5f 63 61 6c 63 50 0d 09 | 09 09 66 69 6e 61 6c 50 |_calcP..|..finalP| |00004da0| 20 7c 3d 20 28 70 20 26 | 20 30 78 30 30 46 46 30 | |= (p &| 0x00FF0| |00004db0| 30 30 30 29 3b 0d 09 09 | 09 0d 09 09 09 2f 2f 20 |000);...|.....// | |00004dc0| 2a 2a 2a 2a 20 78 20 2b | 20 32 0d 09 09 09 70 72 |**** x +| 2....pr| |00004dd0| 65 76 4d 61 70 20 3d 20 | 73 72 63 65 4d 61 70 3b |evMap = |srceMap;| |00004de0| 0d 09 09 09 5f 5f 6c 6f | 61 64 47 72 61 64 0d 09 |....__lo|adGrad..| |00004df0| 09 09 73 72 63 65 4d 61 | 70 20 3d 20 73 72 63 65 |..srceMa|p = srce| |00004e00| 42 61 73 65 20 2b 20 78 | 73 72 63 20 2b 20 79 73 |Base + x|src + ys| |00004e10| 72 63 20 2a 20 6d 42 79 | 74 65 73 50 65 72 52 6f |rc * mBy|tesPerRo| |00004e20| 77 20 2b 20 32 3b 0d 0d | 09 09 09 2f 2f 20 49 66 |w + 2;..|...// If| |00004e30| 20 77 65 20 64 6f 6e 27 | 74 20 61 6c 72 65 61 64 | we don'|t alread| |00004e40| 79 20 68 61 76 65 20 74 | 68 65 20 66 6f 75 72 20 |y have t|he four | |00004e50| 66 65 6e 63 65 20 70 69 | 78 65 6c 73 2c 20 6c 6f |fence pi|xels, lo| |00004e60| 61 64 20 74 68 65 6d 20 | 66 72 6f 6d 20 52 41 4d |ad them |from RAM| |00004e70| 0d 09 09 09 69 66 20 28 | 20 73 72 63 65 4d 61 70 |....if (| srceMap| |00004e80| 20 21 3d 20 70 72 65 76 | 4d 61 70 20 29 20 7b 0d | != prev|Map ) {.| |00004e90| 09 09 09 09 5f 5f 6c 6f | 61 64 50 58 0d 09 09 09 |....__lo|adPX....| |00004ea0| 7d 0d 09 09 09 5f 5f 63 | 61 6c 63 50 0d 09 09 09 |}....__c|alcP....| |00004eb0| 66 69 6e 61 6c 50 20 7c | 3d 20 28 70 20 26 20 30 |finalP ||= (p & 0| |00004ec0| 78 46 46 46 46 30 30 30 | 30 29 20 3e 3e 20 38 3b |xFFFF000|0) >> 8;| |00004ed0| 0d 0d 0d 09 09 09 2f 2f | 20 2a 2a 2a 2a 20 78 20 |......//| **** x | |00004ee0| 2b 20 33 0d 09 09 09 70 | 72 65 76 4d 61 70 20 3d |+ 3....p|revMap =| |00004ef0| 20 73 72 63 65 4d 61 70 | 3b 0d 09 09 09 5f 5f 6c | srceMap|;....__l| |00004f00| 6f 61 64 47 72 61 64 0d | 09 09 09 73 72 63 65 4d |oadGrad.|...srceM| |00004f10| 61 70 20 3d 20 73 72 63 | 65 42 61 73 65 20 2b 20 |ap = src|eBase + | |00004f20| 78 73 72 63 20 2b 20 79 | 73 72 63 20 2a 20 6d 42 |xsrc + y|src * mB| |00004f30| 79 74 65 73 50 65 72 52 | 6f 77 20 2b 20 33 3b 0d |ytesPerR|ow + 3;.| |00004f40| 0d 09 09 09 2f 2f 20 49 | 66 20 77 65 20 64 6f 6e |....// I|f we don| |00004f50| 27 74 20 61 6c 72 65 61 | 64 79 20 68 61 76 65 20 |'t alrea|dy have | |00004f60| 74 68 65 20 66 6f 75 72 | 20 66 65 6e 63 65 20 70 |the four| fence p| |00004f70| 69 78 65 6c 73 2c 20 6c | 6f 61 64 20 74 68 65 6d |ixels, l|oad them| |00004f80| 20 66 72 6f 6d 20 52 41 | 4d 0d 09 09 09 69 66 20 | from RA|M....if | |00004f90| 28 20 73 72 63 65 4d 61 | 70 20 21 3d 20 70 72 65 |( srceMa|p != pre| |00004fa0| 76 4d 61 70 20 29 20 7b | 0d 09 09 09 09 5f 5f 6c |vMap ) {|.....__l| |00004fb0| 6f 61 64 50 58 0d 09 09 | 09 7d 0d 09 09 09 5f 5f |oadPX...|.}....__| |00004fc0| 63 61 6c 63 50 0d 09 09 | 09 66 69 6e 61 6c 50 20 |calcP...|.finalP | |00004fd0| 7c 3d 20 70 20 3e 3e 20 | 31 36 3b 0d 09 09 09 2a ||= p >> |16;....*| |00004fe0| 28 28 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 2a |((unsign|ed long*| |00004ff0| 29 20 64 65 73 74 29 20 | 3d 20 66 69 6e 61 6c 50 |) dest) |= finalP| |00005000| 3b 20 0d 0d 09 09 0d 09 | 09 09 2f 2f 20 4d 6f 76 |; ......|..// Mov| |00005010| 65 20 74 6f 20 78 2b 34 | 0d 09 09 09 69 6e 47 72 |e to x+4|....inGr| |00005020| 61 64 20 3d 20 28 28 6c | 6f 6e 67 2a 29 20 69 6e |ad = ((l|ong*) in| |00005030| 47 72 61 64 29 20 2b 20 | 34 3b 0d 09 09 09 73 72 |Grad) + |4;....sr| |00005040| 63 65 42 61 73 65 20 2b | 3d 20 34 3b 0d 09 09 09 |ceBase +|= 4;....| |00005050| 64 65 73 74 20 2b 3d 20 | 34 3b 0d 09 09 7d 0d 09 |dest += |4;...}..| |00005060| 7d 0d 7d 0d 2a 2f 0d 0d | 0d 23 64 65 66 69 6e 65 |}.}.*/..|.#define| |00005070| 20 48 41 4c 46 43 4f 52 | 44 09 30 78 30 30 31 46 | HALFCOR|D.0x001F| |00005080| 20 20 2f 2a 20 31 32 20 | 62 69 74 73 20 70 65 72 | /* 12 |bits per| |00005090| 20 63 6f 72 64 2c 20 35 | 20 62 69 74 73 20 66 6f | cord, 5| bits fo| |000050a0| 72 20 66 69 78 65 64 20 | 64 65 63 69 6d 61 6c 20 |r fixed |decimal | |000050b0| 2d 3e 20 6d 65 61 6e 73 | 20 2b 2f 2d 20 31 32 37 |-> means| +/- 127| |000050c0| 20 2a 2f 0d 0d 0d 76 6f | 69 64 20 50 69 78 50 6f | */...vo|id PixPo| |000050d0| 72 74 3a 3a 46 61 64 65 | 28 20 50 69 78 50 6f 72 |rt::Fade|( PixPor| |000050e0| 74 26 20 69 6f 44 65 73 | 74 2c 20 63 68 61 72 2a |t& ioDes|t, char*| |000050f0| 20 69 6e 47 72 61 64 20 | 29 20 7b 0d 09 75 6e 73 | inGrad |) {..uns| |00005100| 69 67 6e 65 64 20 6c 6f | 6e 67 20 70 2c 20 78 2c |igned lo|ng p, x,| |00005110| 20 79 2c 20 75 2c 20 76 | 2c 20 75 31 2c 20 76 31 | y, u, v|, u1, v1| |00005120| 2c 20 50 31 2c 20 50 32 | 2c 20 50 33 2c 20 50 34 |, P1, P2|, P3, P4| |00005130| 2c 20 62 79 74 65 73 50 | 65 72 52 6f 77 2c 20 63 |, bytesP|erRow, c| |00005140| 6f 64 65 64 44 65 6c 2c | 20 78 47 72 61 64 2c 20 |odedDel,| xGrad, | |00005150| 79 47 72 61 64 3b 0d 09 | 63 68 61 72 2a 20 64 65 |yGrad;..|char* de| |00005160| 73 74 2c 20 2a 73 72 63 | 65 42 61 73 65 2c 20 2a |st, *src|eBase, *| |00005170| 73 72 63 65 4d 61 70 2c | 20 2a 70 72 65 76 4c 6f |srceMap,| *prevLo| |00005180| 63 20 3d 20 30 3b 0d 09 | 6c 6f 6e 67 20 64 65 73 |c = 0;..|long des| |00005190| 74 52 6f 77 42 79 74 65 | 73 20 3d 20 69 6f 44 65 |tRowByte|s = ioDe| |000051a0| 73 74 2e 6d 42 79 74 65 | 73 50 65 72 52 6f 77 3b |st.mByte|sPerRow;| |000051b0| 0d 0d 09 69 66 20 28 20 | 6d 42 79 74 65 73 50 65 |...if ( |mBytesPe| |000051c0| 72 50 69 78 20 21 3d 20 | 31 20 29 0d 09 09 72 65 |rPix != |1 )...re| |000051d0| 74 75 72 6e 3b 0d 09 09 | 09 0d 09 62 79 74 65 73 |turn;...|...bytes| |000051e0| 50 65 72 52 6f 77 20 3d | 20 6d 42 79 74 65 73 50 |PerRow =| mBytesP| |000051f0| 65 72 52 6f 77 3b 0d 09 | 0d 09 2f 2f 20 46 6f 72 |erRow;..|..// For| |00005200| 20 65 76 65 72 79 20 70 | 69 78 65 6c 20 69 6e 20 | every p|ixel in | |00005210| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 2c |the dest|ination,| |00005220| 20 66 69 6e 64 20 69 74 | 27 73 20 73 6f 75 72 63 | find it|'s sourc| |00005230| 65 20 76 69 61 20 74 68 | 65 20 67 72 61 64 69 65 |e via th|e gradie| |00005240| 6e 74 0d 09 66 6f 72 20 | 28 20 79 20 3d 20 30 3b |nt..for |( y = 0;| |00005250| 20 79 20 3c 20 6d 59 3b | 20 79 2b 2b 20 29 20 7b | y < mY;| y++ ) {| |00005260| 0d 09 0d 09 09 2f 2f 20 | 53 65 74 75 70 20 74 68 |.....// |Setup th| |00005270| 65 20 64 65 73 74 20 72 | 6f 77 20 62 61 73 65 20 |e dest r|ow base | |00005280| 61 64 64 72 65 73 73 0d | 09 09 64 65 73 74 20 3d |address.|..dest =| |00005290| 20 69 6f 44 65 73 74 2e | 6d 42 69 74 73 20 2b 20 | ioDest.|mBits + | |000052a0| 64 65 73 74 52 6f 77 42 | 79 74 65 73 20 2a 20 79 |destRowB|ytes * y| |000052b0| 3b 0d 09 09 0d 09 09 2f | 2f 20 53 65 74 75 70 20 |;....../|/ Setup | |000052c0| 74 68 65 20 73 6f 75 72 | 63 65 20 72 6f 77 20 62 |the sour|ce row b| |000052d0| 61 73 65 20 61 64 64 72 | 65 73 73 2c 20 61 6c 73 |ase addr|ess, als| |000052e0| 6f 20 6f 66 66 73 65 74 | 20 74 6f 20 61 6c 6c 6f |o offset| to allo| |000052f0| 77 20 66 6f 72 20 6e 65 | 67 61 74 69 76 65 20 67 |w for ne|gative g| |00005300| 72 61 64 20 63 6f 6d 70 | 6f 6e 65 6e 74 73 0d 09 |rad comp|onents..| |00005310| 09 73 72 63 65 42 61 73 | 65 20 3d 20 6d 42 69 74 |.srceBas|e = mBit| |00005320| 73 20 2b 20 28 20 79 20 | 2d 20 48 41 4c 46 43 4f |s + ( y |- HALFCO| |00005330| 52 44 20 29 20 2a 20 6d | 42 79 74 65 73 50 65 72 |RD ) * m|BytesPer| |00005340| 52 6f 77 20 2d 20 48 41 | 4c 46 43 4f 52 44 3b 0d |Row - HA|LFCORD;.| |00005350| 09 09 0d 09 09 0d 09 09 | 66 6f 72 20 28 20 78 20 |........|for ( x | |00005360| 3d 20 30 3b 20 78 20 3c | 20 6d 58 3b 20 78 2b 2b |= 0; x <| mX; x++| |00005370| 20 29 20 7b 0d 09 09 09 | 2f 2f 20 45 78 74 72 61 | ) {....|// Extra| |00005380| 63 74 20 74 68 65 20 67 | 72 61 64 69 65 6e 74 20 |ct the g|radient | |00005390| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 0d 09 09 09 2f |informat|ion..../| |000053a0| 2f 20 46 6f 72 6d 61 74 | 20 6f 66 20 61 20 67 72 |/ Format| of a gr| |000053b0| 61 64 20 73 68 6f 72 74 | 3a 20 20 28 20 28 20 28 |ad short|: ( ( (| |000053c0| 64 64 78 20 2b 20 31 32 | 38 29 20 2a 20 31 36 20 |ddx + 12|8) * 16 | |000053d0| 29 20 3c 3c 20 32 30 20 | 29 20 7c 20 28 20 28 64 |) << 20 |) | ( (d| |000053e0| 64 79 20 2b 20 31 32 38 | 29 20 2a 20 31 36 20 29 |dy + 128|) * 16 )| |000053f0| 20 3c 3c 20 38 0d 09 09 | 09 63 6f 64 65 64 44 65 | << 8...|.codedDe| |00005400| 6c 20 3d 20 2a 28 28 75 | 6e 73 69 67 6e 65 64 20 |l = *((u|nsigned | |00005410| 6c 6f 6e 67 2a 29 20 69 | 6e 47 72 61 64 29 3b 09 |long*) i|nGrad);.| |00005420| 0d 09 09 09 69 6e 47 72 | 61 64 20 2b 3d 20 33 3b |....inGr|ad += 3;| |00005430| 0d 09 09 09 78 47 72 61 | 64 20 3d 20 63 6f 64 65 |....xGra|d = code| |00005440| 64 44 65 6c 20 3e 3e 20 | 32 30 3b 0d 09 09 09 79 |dDel >> |20;....y| |00005450| 47 72 61 64 20 3d 20 30 | 78 46 46 46 20 26 20 28 |Grad = 0|xFFF & (| |00005460| 20 63 6f 64 65 64 44 65 | 6c 20 3e 3e 20 38 20 29 | codedDe|l >> 8 )| |00005470| 3b 0d 09 09 0d 09 09 09 | 2f 2f 20 47 65 74 20 74 |;.......|// Get t| |00005480| 68 65 20 76 65 63 74 6f | 72 20 74 6f 20 74 68 65 |he vecto|r to the| |00005490| 20 73 6f 75 72 63 65 20 | 70 69 78 65 6c 0d 09 09 | source |pixel...| |000054a0| 09 73 72 63 65 4d 61 70 | 20 3d 20 73 72 63 65 42 |.srceMap| = srceB| |000054b0| 61 73 65 20 2b 20 28 20 | 78 47 72 61 64 20 3e 3e |ase + ( |xGrad >>| |000054c0| 20 36 20 29 20 2b 20 28 | 20 79 47 72 61 64 20 3e | 6 ) + (| yGrad >| |000054d0| 3e 20 36 20 29 20 2a 20 | 62 79 74 65 73 50 65 72 |> 6 ) * |bytesPer| |000054e0| 52 6f 77 3b 0d 0d 09 09 | 09 75 20 3d 20 28 20 79 |Row;....|.u = ( y| |000054f0| 47 72 61 64 20 26 20 30 | 78 33 46 20 29 3b 09 09 |Grad & 0|x3F );..| |00005500| 2f 2f 20 79 20 2d 20 79 | 73 72 63 0d 09 09 09 76 |// y - y|src....v| |00005510| 20 3d 20 28 20 78 47 72 | 61 64 20 26 20 30 78 33 | = ( xGr|ad & 0x3| |00005520| 46 20 29 3b 09 09 2f 2f | 20 78 20 2d 20 78 73 72 |F );..//| x - xsr| |00005530| 63 0d 09 09 09 73 72 63 | 65 42 61 73 65 2b 2b 3b |c....src|eBase++;| |00005540| 0d 09 09 09 0d 09 09 09 | 2f 2f 20 50 31 20 2d 20 |........|// P1 - | |00005550| 50 32 0d 09 09 09 2f 2f | 20 7c 20 20 20 20 20 7c |P2....//| | || |00005560| 0d 09 09 09 2f 2f 20 50 | 33 20 2d 20 50 34 0d 09 |....// P|3 - P4..| |00005570| 09 09 50 31 20 20 3d 20 | 28 20 28 75 6e 73 69 67 |..P1 = |( (unsig| |00005580| 6e 65 64 20 63 68 61 72 | 2a 29 20 73 72 63 65 4d |ned char|*) srceM| |00005590| 61 70 20 29 5b 30 5d 3b | 0d 09 09 09 50 32 20 20 |ap )[0];|....P2 | |000055a0| 3d 20 28 20 28 75 6e 73 | 69 67 6e 65 64 20 63 68 |= ( (uns|igned ch| |000055b0| 61 72 2a 29 20 73 72 63 | 65 4d 61 70 20 29 5b 31 |ar*) src|eMap )[1| |000055c0| 5d 3b 0d 0d 09 09 09 75 | 31 09 20 3d 20 30 78 34 |];.....u|1. = 0x4| |000055d0| 30 20 2d 20 75 3b 0d 09 | 09 09 50 31 20 20 2a 3d |0 - u;..|..P1 *=| |000055e0| 20 75 31 3b 0d 09 09 09 | 50 32 20 20 2a 3d 20 75 | u1;....|P2 *= u| |000055f0| 31 3b 0d 0d 09 09 09 50 | 33 20 20 3d 20 28 20 28 |1;.....P|3 = ( (| |00005600| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 2a 29 20 |unsigned| char*) | |00005610| 73 72 63 65 4d 61 70 20 | 29 5b 20 62 79 74 65 73 |srceMap |)[ bytes| |00005620| 50 65 72 52 6f 77 20 5d | 3b 20 20 0d 09 09 09 50 |PerRow ]|; ....P| |00005630| 34 20 20 3d 20 28 20 28 | 75 6e 73 69 67 6e 65 64 |4 = ( (|unsigned| |00005640| 20 63 68 61 72 2a 29 20 | 73 72 63 65 4d 61 70 20 | char*) |srceMap | |00005650| 29 5b 20 62 79 74 65 73 | 50 65 72 52 6f 77 20 2b |)[ bytes|PerRow +| |00005660| 20 31 20 5d 3b 0d 0d 09 | 09 09 76 31 20 09 3d 20 | 1 ];...|..v1 .= | |00005670| 30 78 34 30 20 2d 20 76 | 3b 0d 09 09 09 50 33 20 |0x40 - v|;....P3 | |00005680| 2a 3d 20 75 3b 0d 09 09 | 09 50 34 20 2a 3d 20 75 |*= u;...|.P4 *= u| |00005690| 3b 0d 09 0d 09 09 09 2f | 2f 20 42 69 6c 69 6e 65 |;....../|/ Biline| |000056a0| 61 72 20 69 6e 74 65 72 | 70 6f 6c 61 74 69 6f 6e |ar inter|polation| |000056b0| 20 74 6f 20 61 70 70 72 | 6f 78 69 6d 61 74 65 20 | to appr|oximate | |000056c0| 74 68 65 20 73 6f 75 72 | 63 65 20 70 69 78 65 6c |the sour|ce pixel| |000056d0| 20 76 61 6c 75 65 0d 09 | 09 09 70 20 20 3d 20 76 | value..|..p = v| |000056e0| 20 2a 20 28 20 50 32 20 | 2b 20 50 34 20 29 20 2b | * ( P2 |+ P4 ) +| |000056f0| 20 76 31 20 2a 20 28 20 | 50 31 20 2b 20 50 33 20 | v1 * ( |P1 + P3 | |00005700| 29 3b 0d 0d 0d 09 09 09 | 2f 2f 20 53 74 6f 72 65 |);......|// Store| |00005710| 20 74 68 65 20 63 61 6c | 63 75 6c 61 74 65 64 2f | the cal|culated/| |00005720| 64 65 73 74 20 70 69 78 | 65 6c 20 28 72 6f 75 6e |dest pix|el (roun| |00005730| 64 69 6e 67 20 74 68 65 | 20 66 72 61 63 74 69 6f |ding the| fractio| |00005740| 6e 20 70 61 72 74 20 6f | 66 20 74 68 65 20 70 69 |n part o|f the pi| |00005750| 78 20 76 61 6c 75 65 29 | 0d 09 09 09 2f 2f 20 57 |x value)|....// W| |00005760| 65 20 64 69 76 69 64 65 | 20 62 79 20 31 32 20 64 |e divide| by 12 d| |00005770| 65 63 69 6d 61 6c 20 70 | 6c 61 63 65 73 20 62 65 |ecimal p|laces be| |00005780| 63 61 75 73 65 20 70 20 | 69 73 20 75 6e 69 74 73 |cause p |is units| |00005790| 20 73 71 75 61 72 65 64 | 20 28 36 20 70 6c 61 63 | squared| (6 plac| |000057a0| 65 73 20 70 65 72 20 64 | 65 63 69 6d 61 6c 29 0d |es per d|ecimal).| |000057b0| 09 09 09 2a 28 28 75 6e | 73 69 67 6e 65 64 20 63 |...*((un|signed c| |000057c0| 68 61 72 2a 29 20 64 65 | 73 74 29 20 3d 20 28 20 |har*) de|st) = ( | |000057d0| 31 35 20 2a 20 70 20 29 | 20 3e 3e 20 31 36 3b 09 |15 * p )| >> 16;.| |000057e0| 64 65 73 74 2b 2b 3b 20 | 2f 2f 20 35 20 6d 6f 72 |dest++; |// 5 mor| |000057f0| 65 20 64 65 63 20 70 6c | 61 63 65 73 20 63 75 7a |e dec pl|aces cuz| |00005800| 20 6f 66 20 74 68 65 20 | 6d 75 6c 74 20 62 79 20 | of the |mult by | |00005810| 33 31 0d 0d 09 09 7d 0d | 09 7d 0d 7d 0d 0d 2f 2a |31....}.|.}.}../*| |00005820| 0d 76 6f 69 64 20 50 69 | 78 50 6f 72 74 3a 3a 46 |.void Pi|xPort::F| |00005830| 61 64 65 28 20 50 69 78 | 50 6f 72 74 26 20 69 6f |ade( Pix|Port& io| |00005840| 44 65 73 74 2c 20 63 68 | 61 72 2a 20 69 6e 47 72 |Dest, ch|ar* inGr| |00005850| 61 64 20 29 20 7b 0d 09 | 75 6e 73 69 67 6e 65 64 |ad ) {..|unsigned| |00005860| 20 6c 6f 6e 67 20 70 2c | 20 78 2c 20 79 2c 20 75 | long p,| x, y, u| |00005870| 2c 20 76 2c 20 75 31 2c | 20 76 31 2c 20 50 31 2c |, v, u1,| v1, P1,| |00005880| 20 50 32 2c 20 50 33 2c | 20 50 34 2c 20 62 79 74 | P2, P3,| P4, byt| |00005890| 65 73 50 65 72 52 6f 77 | 3b 0d 09 63 68 61 72 2a |esPerRow|;..char*| |000058a0| 20 64 65 73 74 2c 20 2a | 73 72 63 65 42 61 73 65 | dest, *|srceBase| |000058b0| 2c 20 2a 73 72 63 65 4d | 61 70 2c 20 2a 70 72 65 |, *srceM|ap, *pre| |000058c0| 76 4c 6f 63 20 3d 20 30 | 3b 0d 09 6c 6f 6e 67 20 |vLoc = 0|;..long | |000058d0| 64 65 73 74 52 6f 77 42 | 79 74 65 73 20 3d 20 69 |destRowB|ytes = i| |000058e0| 6f 44 65 73 74 2e 6d 42 | 79 74 65 73 50 65 72 52 |oDest.mB|ytesPerR| |000058f0| 6f 77 2c 20 78 47 72 61 | 64 2c 20 79 47 72 61 64 |ow, xGra|d, yGrad| |00005900| 3b 0d 0d 09 69 66 20 28 | 20 6d 42 79 74 65 73 50 |;...if (| mBytesP| |00005910| 65 72 50 69 78 20 21 3d | 20 31 20 29 0d 09 09 72 |erPix !=| 1 )...r| |00005920| 65 74 75 72 6e 3b 0d 09 | 09 09 0d 09 62 79 74 65 |eturn;..|....byte| |00005930| 73 50 65 72 52 6f 77 20 | 3d 20 6d 42 79 74 65 73 |sPerRow |= mBytes| |00005940| 50 65 72 52 6f 77 3b 0d | 09 0d 09 2f 2f 20 46 6f |PerRow;.|...// Fo| |00005950| 72 20 65 76 65 72 79 20 | 70 69 78 65 6c 20 69 6e |r every |pixel in| |00005960| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination| |00005970| 2c 20 66 69 6e 64 20 69 | 74 27 73 20 73 6f 75 72 |, find i|t's sour| |00005980| 63 65 20 76 69 61 20 74 | 68 65 20 67 72 61 64 69 |ce via t|he gradi| |00005990| 65 6e 74 0d 09 66 6f 72 | 20 28 20 79 20 3d 20 30 |ent..for| ( y = 0| |000059a0| 3b 20 79 20 3c 20 6d 59 | 3b 20 79 2b 2b 20 29 20 |; y < mY|; y++ ) | |000059b0| 7b 0d 09 0d 09 09 2f 2f | 20 53 65 74 75 70 20 74 |{.....//| Setup t| |000059c0| 68 65 20 64 65 73 74 20 | 72 6f 77 20 62 61 73 65 |he dest |row base| |000059d0| 20 61 64 64 72 65 73 73 | 0d 09 09 64 65 73 74 20 | address|...dest | |000059e0| 3d 20 69 6f 44 65 73 74 | 2e 6d 42 69 74 73 20 2b |= ioDest|.mBits +| |000059f0| 20 64 65 73 74 52 6f 77 | 42 79 74 65 73 20 2a 20 | destRow|Bytes * | |00005a00| 79 3b 0d 09 09 0d 09 09 | 2f 2f 20 53 65 74 75 70 |y;......|// Setup| |00005a10| 20 74 68 65 20 73 6f 75 | 72 63 65 20 72 6f 77 20 | the sou|rce row | |00005a20| 62 61 73 65 20 61 64 64 | 72 65 73 73 2c 20 61 6c |base add|ress, al| |00005a30| 73 6f 20 6f 66 66 73 65 | 74 20 74 6f 20 61 6c 6c |so offse|t to all| |00005a40| 6f 77 20 66 6f 72 20 6e | 65 67 61 74 69 76 65 20 |ow for n|egative | |00005a50| 67 72 61 64 20 63 6f 6d | 70 6f 6e 65 6e 74 73 0d |grad com|ponents.| |00005a60| 09 09 73 72 63 65 42 61 | 73 65 20 3d 20 6d 42 69 |..srceBa|se = mBi| |00005a70| 74 73 20 2b 20 28 20 79 | 20 2d 20 48 41 4c 46 43 |ts + ( y| - HALFC| |00005a80| 4f 52 44 20 29 20 2a 20 | 6d 42 79 74 65 73 50 65 |ORD ) * |mBytesPe| |00005a90| 72 52 6f 77 20 2d 20 48 | 41 4c 46 43 4f 52 44 3b |rRow - H|ALFCORD;| |00005aa0| 0d 09 09 0d 09 09 0d 09 | 09 66 6f 72 20 28 20 78 |........|.for ( x| |00005ab0| 20 3d 20 30 3b 20 78 20 | 3c 20 6d 58 3b 20 78 2b | = 0; x |< mX; x+| |00005ac0| 2b 20 29 20 7b 0d 09 09 | 09 2f 2f 20 45 78 74 72 |+ ) {...|.// Extr| |00005ad0| 61 63 74 20 74 68 65 20 | 67 72 61 64 69 65 6e 74 |act the |gradient| |00005ae0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 0d 09 09 09 | informa|tion....| |00005af0| 2f 2f 20 46 6f 72 6d 61 | 74 20 6f 66 20 61 20 67 |// Forma|t of a g| |00005b00| 72 61 64 20 73 68 6f 72 | 74 3a 20 20 28 20 28 20 |rad shor|t: ( ( | |00005b10| 28 64 64 78 20 2b 20 31 | 32 38 29 20 2a 20 31 36 |(ddx + 1|28) * 16| |00005b20| 20 29 20 3c 3c 20 32 30 | 20 29 20 7c 20 28 20 28 | ) << 20| ) | ( (| |00005b30| 64 64 79 20 2b 20 31 32 | 38 29 20 2a 20 31 36 20 |ddy + 12|8) * 16 | |00005b40| 29 20 3c 3c 20 38 0d 09 | 09 09 78 47 72 61 64 20 |) << 8..|..xGrad | |00005b50| 3d 20 2a 28 20 28 63 68 | 61 72 2a 29 20 69 6e 47 |= *( (ch|ar*) inG| |00005b60| 72 61 64 20 29 3b 09 69 | 6e 47 72 61 64 2b 2b 3b |rad );.i|nGrad++;| |00005b70| 0d 09 09 09 79 47 72 61 | 64 20 3d 20 2a 28 20 28 |....yGra|d = *( (| |00005b80| 63 68 61 72 2a 29 20 69 | 6e 47 72 61 64 20 29 3b |char*) i|nGrad );| |00005b90| 09 69 6e 47 72 61 64 2b | 2b 3b 0d 09 09 0d 09 09 |.inGrad+|+;......| |00005ba0| 09 2f 2f 20 47 65 74 20 | 74 68 65 20 76 65 63 74 |.// Get |the vect| |00005bb0| 6f 72 20 74 6f 20 74 68 | 65 20 73 6f 75 72 63 65 |or to th|e source| |00005bc0| 20 70 69 78 65 6c 0d 09 | 09 09 73 72 63 65 4d 61 | pixel..|..srceMa| |00005bd0| 70 20 3d 20 73 72 63 65 | 42 61 73 65 20 2b 20 28 |p = srce|Base + (| |00005be0| 20 78 47 72 61 64 20 3e | 3e 20 32 20 29 20 2b 20 | xGrad >|> 2 ) + | |00005bf0| 28 20 79 47 72 61 64 20 | 3e 3e 20 32 20 29 20 2a |( yGrad |>> 2 ) *| |00005c00| 20 62 79 74 65 73 50 65 | 72 52 6f 77 3b 0d 0d 09 | bytesPe|rRow;...| |00005c10| 09 09 75 20 3d 20 28 20 | 79 47 72 61 64 20 26 20 |..u = ( |yGrad & | |00005c20| 30 78 33 20 29 3b 09 09 | 2f 2f 20 79 20 2d 20 79 |0x3 );..|// y - y| |00005c30| 73 72 63 0d 09 09 09 76 | 20 3d 20 28 20 78 47 72 |src....v| = ( xGr| |00005c40| 61 64 20 26 20 30 78 33 | 20 29 3b 09 09 2f 2f 20 |ad & 0x3| );..// | |00005c50| 78 20 2d 20 78 73 72 63 | 0d 09 09 09 73 72 63 65 |x - xsrc|....srce| |00005c60| 42 61 73 65 2b 2b 3b 0d | 09 09 09 0d 09 09 09 2f |Base++;.|......./| |00005c70| 2f 20 50 31 20 2d 20 50 | 32 0d 09 09 09 2f 2f 20 |/ P1 - P|2....// | |00005c80| 7c 20 20 20 20 20 7c 0d | 09 09 09 2f 2f 20 50 33 || |.|...// P3| |00005c90| 20 2d 20 50 34 0d 09 09 | 09 50 31 20 20 3d 20 28 | - P4...|.P1 = (| |00005ca0| 20 28 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 2a | (unsign|ed char*| |00005cb0| 29 20 73 72 63 65 4d 61 | 70 20 29 5b 30 5d 3b 0d |) srceMa|p )[0];.| |00005cc0| 09 09 09 50 32 20 20 3d | 20 28 20 28 75 6e 73 69 |...P2 =| ( (unsi| |00005cd0| 67 6e 65 64 20 63 68 61 | 72 2a 29 20 73 72 63 65 |gned cha|r*) srce| |00005ce0| 4d 61 70 20 29 5b 31 5d | 3b 0d 0d 09 09 09 75 31 |Map )[1]|;.....u1| |00005cf0| 09 20 3d 20 30 78 34 20 | 2d 20 75 3b 0d 09 09 09 |. = 0x4 |- u;....| |00005d00| 50 31 20 20 2a 3d 20 75 | 31 3b 0d 09 09 09 50 32 |P1 *= u|1;....P2| |00005d10| 20 20 2a 3d 20 75 31 3b | 0d 0d 09 09 09 50 33 20 | *= u1;|.....P3 | |00005d20| 20 3d 20 28 20 28 75 6e | 73 69 67 6e 65 64 20 63 | = ( (un|signed c| |00005d30| 68 61 72 2a 29 20 73 72 | 63 65 4d 61 70 20 29 5b |har*) sr|ceMap )[| |00005d40| 20 62 79 74 65 73 50 65 | 72 52 6f 77 20 5d 3b 20 | bytesPe|rRow ]; | |00005d50| 20 0d 09 09 09 50 34 20 | 20 3d 20 28 20 28 75 6e | ....P4 | = ( (un| |00005d60| 73 69 67 6e 65 64 20 63 | 68 61 72 2a 29 20 73 72 |signed c|har*) sr| |00005d70| 63 65 4d 61 70 20 29 5b | 20 62 79 74 65 73 50 65 |ceMap )[| bytesPe| |00005d80| 72 52 6f 77 20 2b 20 31 | 20 5d 3b 0d 0d 09 09 09 |rRow + 1| ];.....| |00005d90| 76 31 20 09 3d 20 30 78 | 34 20 2d 20 76 3b 0d 09 |v1 .= 0x|4 - v;..| |00005da0| 09 09 50 33 20 2a 3d 20 | 75 3b 0d 09 09 09 50 34 |..P3 *= |u;....P4| |00005db0| 20 2a 3d 20 75 3b 0d 09 | 0d 09 09 09 2f 2f 20 42 | *= u;..|....// B| |00005dc0| 69 6c 69 6e 65 61 72 20 | 69 6e 74 65 72 70 6f 6c |ilinear |interpol| |00005dd0| 61 74 69 6f 6e 20 74 6f | 20 61 70 70 72 6f 78 69 |ation to| approxi| |00005de0| 6d 61 74 65 20 74 68 65 | 20 73 6f 75 72 63 65 20 |mate the| source | |00005df0| 70 69 78 65 6c 20 76 61 | 6c 75 65 0d 09 09 09 70 |pixel va|lue....p| |00005e00| 20 20 3d 20 76 20 2a 20 | 28 20 50 32 20 2b 20 50 | = v * |( P2 + P| |00005e10| 34 20 29 20 2b 20 76 31 | 20 2a 20 28 20 50 31 20 |4 ) + v1| * ( P1 | |00005e20| 2b 20 50 33 20 29 3b 0d | 0d 0d 09 09 09 2f 2f 20 |+ P3 );.|.....// | |00005e30| 53 74 6f 72 65 20 74 68 | 65 20 63 61 6c 63 75 6c |Store th|e calcul| |00005e40| 61 74 65 64 2f 64 65 73 | 74 20 70 69 78 65 6c 20 |ated/des|t pixel | |00005e50| 28 72 6f 75 6e 64 69 6e | 67 20 74 68 65 20 66 72 |(roundin|g the fr| |00005e60| 61 63 74 69 6f 6e 20 70 | 61 72 74 20 6f 66 20 74 |action p|art of t| |00005e70| 68 65 20 70 69 78 20 76 | 61 6c 75 65 29 0d 09 09 |he pix v|alue)...| |00005e80| 09 2f 2f 20 57 65 20 64 | 69 76 69 64 65 20 62 79 |.// We d|ivide by| |00005e90| 20 34 20 64 65 63 69 6d | 61 6c 20 70 6c 61 63 65 | 4 decim|al place| |00005ea0| 73 20 62 65 63 61 75 73 | 65 20 70 20 69 73 20 75 |s becaus|e p is u| |00005eb0| 6e 69 74 73 20 73 71 75 | 61 72 65 64 0d 09 09 09 |nits squ|ared....| |00005ec0| 2a 28 28 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |*((unsig|ned char| |00005ed0| 2a 29 20 64 65 73 74 29 | 20 3d 20 28 20 33 31 20 |*) dest)| = ( 31 | |00005ee0| 2a 20 70 20 29 20 3e 3e | 20 39 3b 09 64 65 73 74 |* p ) >>| 9;.dest| |00005ef0| 2b 2b 3b 20 2f 2f 20 35 | 20 6d 6f 72 65 20 64 65 |++; // 5| more de| |00005f00| 63 20 70 6c 61 63 65 73 | 20 63 75 7a 20 6f 66 20 |c places| cuz of | |00005f10| 74 68 65 20 6d 75 6c 74 | 20 62 79 20 33 31 0d 0d |the mult| by 31..| |00005f20| 09 09 7d 0d 09 7d 0d 7d | 2a 2f 0d 2f 2a 0d 76 6f |..}..}.}|*/./*.vo| |00005f30| 69 64 20 50 69 78 50 6f | 72 74 3a 3a 46 61 64 65 |id PixPo|rt::Fade| |00005f40| 28 20 50 69 78 50 6f 72 | 74 26 20 69 6f 44 65 73 |( PixPor|t& ioDes| |00005f50| 74 2c 20 63 68 61 72 2a | 20 69 6e 47 72 61 64 20 |t, char*| inGrad | |00005f60| 29 20 7b 0d 09 75 6e 73 | 69 67 6e 65 64 20 6c 6f |) {..uns|igned lo| |00005f70| 6e 67 20 67 44 65 6c 74 | 61 2c 20 70 2c 20 78 2c |ng gDelt|a, p, x,| |00005f80| 20 79 2c 20 75 2c 20 76 | 2c 20 75 31 2c 20 76 31 | y, u, v|, u1, v1| |00005f90| 2c 20 50 31 2c 20 50 32 | 2c 20 50 33 2c 20 50 34 |, P1, P2|, P3, P4| |00005fa0| 3b 0d 09 63 68 61 72 2a | 20 64 65 73 74 2c 20 2a |;..char*| dest, *| |00005fb0| 73 72 63 65 42 61 73 65 | 2c 20 2a 73 72 63 65 4d |srceBase|, *srceM| |00005fc0| 61 70 2c 20 2a 70 72 65 | 76 4c 6f 63 20 3d 20 30 |ap, *pre|vLoc = 0| |00005fd0| 3b 0d 09 6c 6f 6e 67 20 | 64 65 73 74 52 6f 77 42 |;..long |destRowB| |00005fe0| 79 74 65 73 20 3d 20 69 | 6f 44 65 73 74 2e 6d 42 |ytes = i|oDest.mB| |00005ff0| 79 74 65 73 50 65 72 52 | 6f 77 2c 20 78 47 72 61 |ytesPerR|ow, xGra| |00006000| 64 2c 20 79 47 72 61 64 | 3b 0d 0d 09 69 66 20 28 |d, yGrad|;...if (| |00006010| 20 6d 42 79 74 65 73 50 | 65 72 50 69 78 20 21 3d | mBytesP|erPix !=| |00006020| 20 31 20 29 0d 09 09 72 | 65 74 75 72 6e 3b 0d 09 | 1 )...r|eturn;..| |00006030| 09 09 0d 09 2f 2f 20 46 | 6f 72 20 65 76 65 72 79 |....// F|or every| |00006040| 20 70 69 78 65 6c 20 69 | 6e 20 74 68 65 20 64 65 | pixel i|n the de| |00006050| 73 74 69 6e 61 74 69 6f | 6e 2c 20 66 69 6e 64 20 |stinatio|n, find | |00006060| 69 74 27 73 20 73 6f 75 | 72 63 65 20 76 69 61 20 |it's sou|rce via | |00006070| 74 68 65 20 67 72 61 64 | 69 65 6e 74 0d 09 66 6f |the grad|ient..fo| |00006080| 72 20 28 20 79 20 3d 20 | 30 3b 20 79 20 3c 20 6d |r ( y = |0; y < m| |00006090| 59 3b 20 79 2b 2b 20 29 | 20 7b 0d 09 0d 09 09 2f |Y; y++ )| {...../| |000060a0| 2f 20 53 65 74 75 70 20 | 74 68 65 20 64 65 73 74 |/ Setup |the dest| |000060b0| 20 72 6f 77 20 62 61 73 | 65 20 61 64 64 72 65 73 | row bas|e addres| |000060c0| 73 0d 09 09 64 65 73 74 | 20 3d 20 69 6f 44 65 73 |s...dest| = ioDes| |000060d0| 74 2e 6d 42 69 74 73 20 | 2b 20 64 65 73 74 52 6f |t.mBits |+ destRo| |000060e0| 77 42 79 74 65 73 20 2a | 20 79 3b 0d 09 09 0d 09 |wBytes *| y;.....| |000060f0| 09 2f 2f 20 53 65 74 75 | 70 20 74 68 65 20 73 6f |.// Setu|p the so| |00006100| 75 72 63 65 20 72 6f 77 | 20 62 61 73 65 20 61 64 |urce row| base ad| |00006110| 64 72 65 73 73 2c 20 61 | 6c 73 6f 20 6f 66 66 73 |dress, a|lso offs| |00006120| 65 74 20 74 6f 20 61 6c | 6c 6f 77 20 66 6f 72 20 |et to al|low for | |00006130| 6e 65 67 61 74 69 76 65 | 20 67 72 61 64 20 63 6f |negative| grad co| |00006140| 6d 70 6f 6e 65 6e 74 73 | 0d 09 09 73 72 63 65 42 |mponents|...srceB| |00006150| 61 73 65 20 3d 20 6d 42 | 69 74 73 20 2b 20 79 20 |ase = mB|its + y | |00006160| 2a 20 6d 42 79 74 65 73 | 50 65 72 52 6f 77 3b 0d |* mBytes|PerRow;.| |00006170| 09 09 0d 09 09 0d 09 09 | 66 6f 72 20 28 20 78 20 |........|for ( x | |00006180| 3d 20 30 3b 20 78 20 3c | 20 6d 58 3b 20 78 2b 2b |= 0; x <| mX; x++| |00006190| 20 29 20 7b 0d 09 09 09 | 2f 2f 20 45 78 74 72 61 | ) {....|// Extra| |000061a0| 63 74 20 74 68 65 20 67 | 72 61 64 69 65 6e 74 20 |ct the g|radient | |000061b0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 0d 09 09 09 2f |informat|ion..../| |000061c0| 2f 20 46 6f 72 6d 61 74 | 20 6f 66 20 61 20 67 72 |/ Format| of a gr| |000061d0| 61 64 20 73 68 6f 72 74 | 3a 20 20 28 20 28 20 28 |ad short|: ( ( (| |000061e0| 64 64 78 20 2b 20 31 32 | 38 29 20 2a 20 31 36 20 |ddx + 12|8) * 16 | |000061f0| 29 20 3c 3c 20 32 30 20 | 29 20 7c 20 28 20 28 64 |) << 20 |) | ( (d| |00006200| 64 79 20 2b 20 31 32 38 | 29 20 2a 20 31 36 20 29 |dy + 128|) * 16 )| |00006210| 20 3c 3c 20 38 0d 09 09 | 09 67 44 65 6c 74 61 20 | << 8...|.gDelta | |00006220| 3d 20 2a 28 28 6c 6f 6e | 67 2a 29 20 69 6e 47 72 |= *((lon|g*) inGr| |00006230| 61 64 29 3b 09 0d 09 09 | 09 69 6e 47 72 61 64 20 |ad);....|.inGrad | |00006240| 2b 3d 20 33 3b 0d 09 09 | 09 78 47 72 61 64 20 3d |+= 3;...|.xGrad =| |00006250| 20 28 20 28 6c 6f 6e 67 | 29 20 28 20 67 44 65 6c | ( (long|) ( gDel| |00006260| 74 61 20 3e 3e 20 32 30 | 20 29 20 29 20 2d 20 30 |ta >> 20| ) ) - 0| |00006270| 78 37 46 46 3b 0d 09 09 | 09 79 47 72 61 64 20 3d |x7FF;...|.yGrad =| |00006280| 20 28 20 28 6c 6f 6e 67 | 29 20 28 20 28 20 67 44 | ( (long|) ( ( gD| |00006290| 65 6c 74 61 20 3e 3e 20 | 38 20 29 20 26 20 30 78 |elta >> |8 ) & 0x| |000062a0| 46 46 46 20 29 20 29 20 | 2d 20 30 78 37 46 46 3b |FFF ) ) |- 0x7FF;| |000062b0| 0d 09 09 0d 09 09 09 2f | 2f 20 47 65 74 20 74 68 |......./|/ Get th| |000062c0| 65 20 76 65 63 74 6f 72 | 20 74 6f 20 74 68 65 20 |e vector| to the | |000062d0| 73 6f 75 72 63 65 20 70 | 69 78 65 6c 0d 09 09 09 |source p|ixel....| |000062e0| 73 72 63 65 4d 61 70 20 | 3d 20 73 72 63 65 42 61 |srceMap |= srceBa| |000062f0| 73 65 20 2b 20 28 20 78 | 47 72 61 64 20 3e 3e 20 |se + ( x|Grad >> | |00006300| 32 20 29 20 2b 20 28 20 | 79 47 72 61 64 20 3e 3e |2 ) + ( |yGrad >>| |00006310| 20 32 20 29 20 2a 20 6d | 42 79 74 65 73 50 65 72 | 2 ) * m|BytesPer| |00006320| 52 6f 77 3b 0d 0d 09 09 | 09 75 20 3d 20 79 47 72 |Row;....|.u = yGr| |00006330| 61 64 20 26 20 30 78 33 | 3b 09 09 2f 2f 20 79 20 |ad & 0x3|;..// y | |00006340| 2d 20 79 73 72 63 0d 09 | 09 09 76 20 3d 20 78 47 |- ysrc..|..v = xG| |00006350| 72 61 64 20 26 20 30 78 | 33 3b 09 09 2f 2f 20 78 |rad & 0x|3;..// x| |00006360| 20 2d 20 78 73 72 63 0d | 09 09 09 73 72 63 65 42 | - xsrc.|...srceB| |00006370| 61 73 65 2b 2b 3b 0d 09 | 09 09 0d 09 09 09 2f 2f |ase++;..|......//| |00006380| 20 50 31 20 2d 20 50 32 | 0d 09 09 09 2f 2f 20 7c | P1 - P2|....// || |00006390| 20 20 20 20 20 7c 0d 09 | 09 09 2f 2f 20 50 33 20 | |..|..// P3 | |000063a0| 2d 20 50 34 0d 09 09 09 | 50 31 20 09 3d 20 2a 28 |- P4....|P1 .= *(| |000063b0| 28 75 6e 73 69 67 6e 65 | 64 20 73 68 6f 72 74 2a |(unsigne|d short*| |000063c0| 29 20 73 72 63 65 4d 61 | 70 29 3b 0d 09 09 09 50 |) srceMa|p);....P| |000063d0| 33 09 3d 20 2a 28 28 75 | 6e 73 69 67 6e 65 64 20 |3.= *((u|nsigned | |000063e0| 73 68 6f 72 74 2a 29 20 | 28 73 72 63 65 4d 61 70 |short*) |(srceMap| |000063f0| 20 2b 20 6d 42 79 74 65 | 73 50 65 72 52 6f 77 29 | + mByte|sPerRow)| +--------+-------------------------+-------------------------+--------+--------+ Only 25.0 KB of data is shown above.