home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1989-09-14 | 3.6 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: shade.c.bin
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| AMOS Picture Packer (image/amosPicturePacker)
| ext
| Supported |
1%
| dexvert
| Debian floppy split (archive/debianFloppySplit)
| ext
| Unsupported |
1%
| dexvert
| Sound Images sound sample (audio/soundImagesSoundSample)
| ext
| Unsupported |
1%
| dexvert
| DESI-III drawing (image/desiIIIDrawing)
| ext
| Unsupported |
1%
| dexvert
| MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable)
| ext
| Unsupported |
1%
| dexvert
| Alien Trilogytextures (other/alienTrilogyTextures)
| ext
| Unsupported |
1%
| dexvert
| APT cache data (other/aptCacheData)
| ext
| Unsupported |
1%
| dexvert
| CorelTRACE configuration (other/corelTRACEConfiguration)
| ext
| Unsupported |
1%
| dexvert
| Dreamcast Disc (other/dreamcastDisc)
| ext
| Unsupported |
1%
| dexvert
| EST flat binary (other/estFlatBinary)
| ext
| Unsupported |
1%
| dexvert
| Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat)
| ext
| Unsupported |
1%
| dexvert
| Sega Genesis/Megadrive/32x ROM (other/genesisROM)
| ext
| Unsupported |
1%
| dexvert
| Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive)
| ext
| Unsupported |
1%
| dexvert
| Sound Images Sound Driver (other/soundImagesSoundDriver)
| ext
| Unsupported |
1%
| dexvert
| Symantec/Norton Config (other/symantecNortonConfig)
| ext
| Unsupported |
1%
| dexvert
| Vectrex ROM (other/vectrexROM)
| ext
| Unsupported |
1%
| dexvert
| BIS raP encoded format (other/bisraPEncoded)
| ext
| Unsupported |
1%
| dexvert
| Pascal Script binary (other/pascalScriptBinary)
| ext
| Unsupported |
1%
| dexvert
| 7th Level game data archive (other/seventhLevelGameDataArchive)
| ext
| Unsupported |
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary, Sun Nov 13 04:58:26 1988, modified Tue Nov 15 10:03:12 1988, creator Think C, type ASCII, 3492 bytes "shade.c"
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 1
| default (weak)
| |
100%
| lsar
| MacBinary
| default
| |
100%
| gt2
| MAC Bilddatei
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 73 68 61 64 65 2e | 63 00 00 00 00 00 00 00 |..shade.|c.......|
|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 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 0d a4 00 | 00 00 00 9f a3 0d 42 9f |........|......B.|
|00000060| a5 f7 b0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 23 64 65 66 69 6e 65 20 | 5f 4d 43 36 38 38 38 31 |#define |_MC68881|
|00000090| 5f 0d 0d 2f 2a 0d 20 2a | 20 74 68 69 73 20 73 75 |_../*. *| this su|
|000000a0| 62 72 6f 75 74 69 6e 65 | 20 64 6f 65 73 20 61 6c |broutine| does al|
|000000b0| 6c 20 74 68 65 20 67 72 | 69 74 74 79 20 77 6f 72 |l the gr|itty wor|
|000000c0| 6b 2d 20 69 74 20 63 61 | 6c 63 75 6c 61 74 65 73 |k- it ca|lculates|
|000000d0| 20 0d 20 2a 20 77 68 61 | 74 20 73 68 61 64 65 20 | . * wha|t shade |
|000000e0| 65 61 63 68 20 70 69 78 | 65 6c 20 73 68 6f 75 6c |each pix|el shoul|
|000000f0| 64 20 62 65 2e 20 49 20 | 6c 69 6b 65 20 72 65 63 |d be. I |like rec|
|00000100| 75 72 73 69 6f 6e 2e 0d | 20 2a 2f 0d 23 69 6e 63 |ursion..| */.#inc|
|00000110| 6c 75 64 65 20 3c 6d 61 | 74 68 2e 68 3e 0d 23 69 |lude <ma|th.h>.#i|
|00000120| 6e 63 6c 75 64 65 20 22 | 72 74 64 2e 68 22 0d 23 |nclude "|rtd.h".#|
|00000130| 69 6e 63 6c 75 64 65 20 | 22 6d 61 63 72 6f 73 2e |include |"macros.|
|00000140| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 22 65 78 74 |h".#incl|ude "ext|
|00000150| 65 72 6e 2e 68 22 0d 0d | 69 6e 74 20 20 20 20 20 |ern.h"..|int |
|00000160| 73 68 61 64 65 20 28 72 | 29 0d 73 74 72 75 63 74 |shade (r|).struct|
|00000170| 20 72 61 79 20 2a 72 3b | 0d 7b 0d 20 20 20 20 69 | ray *r;|.{. i|
|00000180| 6e 74 20 20 20 20 20 69 | 2c 0d 20 20 20 20 20 20 |nt i|,. |
|00000190| 20 20 20 20 20 20 63 2c | 0d 20 20 20 20 20 20 20 | c,|. |
|000001a0| 20 20 20 20 20 72 65 66 | 72 61 63 74 20 28 29 3b | ref|ract ();|
|000001b0| 0d 20 20 20 20 73 74 72 | 75 63 74 20 72 61 79 20 |. str|uct ray |
|000001c0| 20 72 65 66 72 3b 0d 20 | 20 20 20 64 6f 75 62 6c | refr;. | doubl|
|000001d0| 65 20 20 6c 67 68 74 2c | 0d 20 20 20 20 20 20 20 |e lght,|. |
|000001e0| 20 20 20 20 20 78 2c 0d | 20 20 20 20 20 20 20 20 | x,.| |
|000001f0| 20 20 20 20 79 2c 0d 20 | 20 20 20 20 20 20 20 20 | y,. | |
|00000200| 20 20 20 7a 2c 0d 20 20 | 20 20 20 20 20 20 20 20 | z,. | |
|00000210| 20 20 6c 2c 0d 20 20 20 | 20 20 20 20 20 20 20 20 | l,. | |
|00000220| 20 6b 2c 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | k,. | |
|00000230| 64 6f 74 20 28 29 2c 20 | 66 69 6e 64 20 28 29 2c |dot (), |find (),|
|00000240| 20 53 68 61 64 6f 77 20 | 28 29 3b 0d 20 20 20 20 | Shadow |();. |
|00000250| 69 6e 74 20 20 20 20 20 | 73 78 2c 0d 20 20 20 20 |int |sx,. |
|00000260| 20 20 20 20 20 20 20 20 | 73 79 3b 0d 20 20 20 20 | |sy;. |
|00000270| 64 6f 75 62 6c 65 20 20 | 73 74 75 70 69 64 3b 0d |double |stupid;.|
|00000280| 20 20 20 20 73 74 72 75 | 63 74 20 76 65 63 74 6f | stru|ct vecto|
|00000290| 72 20 20 20 6e 65 77 2c | 0d 20 20 20 20 20 20 20 |r new,|. |
|000002a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6e 6f 72 | | nor|
|000002b0| 6d 3b 0d 20 20 20 20 73 | 74 72 75 63 74 20 6d 61 |m;. s|truct ma|
|000002c0| 74 20 20 74 72 61 6e 73 | 3b 0d 20 20 20 20 73 74 |t trans|;. st|
|000002d0| 72 75 63 74 20 73 70 68 | 65 72 65 20 20 20 73 73 |ruct sph|ere ss|
|000002e0| 3b 0d 20 20 20 20 69 66 | 20 28 2b 2b 6c 65 76 65 |;. if| (++leve|
|000002f0| 6c 20 3c 3d 20 4c 45 56 | 45 4c 29 20 7b 0d 09 63 |l <= LEV|EL) {..c|
|00000300| 20 3d 20 2d 31 3b 0d 09 | 6c 20 3d 20 48 55 47 45 | = -1;..|l = HUGE|
|00000310| 3b 0d 2f 2a 20 67 65 74 | 20 76 65 63 74 6f 72 20 |;./* get| vector |
|00000320| 6c 65 6e 67 74 68 20 61 | 6e 64 20 78 7a 20 63 6f |length a|nd xz co|
|00000330| 6d 70 6f 6e 65 6e 74 20 | 66 6f 72 20 6d 74 28 29 |mponent |for mt()|
|00000340| 20 2a 2f 0d 09 72 20 2d | 3e 20 64 69 72 2e 6c 20 | */..r -|> dir.l |
|00000350| 3d 20 4c 45 4e 20 28 72 | 20 2d 3e 20 64 69 72 29 |= LEN (r| -> dir)|
|00000360| 3b 0d 09 72 20 2d 3e 20 | 64 69 72 2e 78 7a 6c 20 |;..r -> |dir.xzl |
|00000370| 3d 20 58 5a 4c 20 28 72 | 20 2d 3e 20 64 69 72 29 |= XZL (r| -> dir)|
|00000380| 3b 0d 2f 2a 20 6d 61 6b | 65 20 61 20 74 72 61 6e |;./* mak|e a tran|
|00000390| 73 66 6f 72 6d 20 6d 61 | 74 72 69 78 20 74 68 61 |sform ma|trix tha|
|000003a0| 74 20 72 6f 74 61 74 65 | 73 20 73 6f 6d 65 74 68 |t rotate|s someth|
|000003b0| 69 6e 67 20 69 6e 20 73 | 70 61 63 65 20 73 6f 0d |ing in s|pace so.|
|000003c0| 20 20 20 74 68 61 74 20 | 74 68 65 20 72 61 79 20 | that |the ray |
|000003d0| 77 69 6c 6c 20 62 65 20 | 61 6c 69 67 6e 65 64 20 |will be |aligned |
|000003e0| 77 69 74 68 20 74 68 65 | 20 78 20 61 78 69 73 20 |with the| x axis |
|000003f0| 2a 2f 0d 09 6d 74 20 28 | 26 28 72 20 2d 3e 20 64 |*/..mt (|&(r -> d|
|00000400| 69 72 29 2c 20 26 74 72 | 61 6e 73 29 3b 0d 0d 2f |ir), &tr|ans);../|
|00000410| 2a 20 66 6f 72 20 73 74 | 61 72 74 65 72 73 20 77 |* for st|arters w|
|00000420| 65 20 66 69 6e 64 20 6f | 75 74 20 77 68 65 74 68 |e find o|ut wheth|
|00000430| 65 72 20 77 65 20 68 69 | 74 20 61 6e 79 74 68 69 |er we hi|t anythi|
|00000440| 6e 67 2e 20 2a 2f 0d 09 | 66 6f 72 20 28 69 20 3d |ng. */..|for (i =|
|00000450| 20 30 3b 20 69 20 3c 20 | 6e 6f 62 3b 20 69 2b 2b | 0; i < |nob; i++|
|00000460| 29 20 7b 0d 09 20 20 20 | 20 73 73 2e 72 61 64 20 |) {.. | ss.rad |
|00000470| 3d 20 62 6c 5b 69 5d 20 | 2d 3e 20 73 2e 72 61 64 |= bl[i] |-> s.rad|
|00000480| 3b 0d 09 20 20 20 20 53 | 56 20 28 73 73 2e 63 65 |;.. S|V (ss.ce|
|00000490| 6e 74 2c 20 62 6c 5b 69 | 5d 20 2d 3e 20 73 2e 63 |nt, bl[i|] -> s.c|
|000004a0| 65 6e 74 2c 20 72 20 2d | 3e 20 6f 72 67 29 3b 0d |ent, r -|> org);.|
|000004b0| 09 20 20 20 20 69 66 20 | 28 28 6b 20 3d 20 66 69 |. if |((k = fi|
|000004c0| 6e 64 20 28 26 74 72 61 | 6e 73 2c 20 26 73 73 29 |nd (&tra|ns, &ss)|
|000004d0| 29 20 3e 20 30 2e 30 20 | 26 26 20 6b 20 3c 20 6c |) > 0.0 |&& k < l|
|000004e0| 29 20 7b 0d 09 09 63 20 | 3d 20 69 3b 0d 09 09 6c |) {...c |= i;...l|
|000004f0| 20 3d 20 6b 3b 0d 09 20 | 20 20 20 7d 0d 09 7d 0d | = k;.. | }..}.|
|00000500| 0d 09 0d 09 69 66 20 28 | 63 20 3e 3d 20 30 20 26 |....if (|c >= 0 &|
|00000510| 26 20 28 6c 20 2a 20 74 | 72 61 6e 73 2e 78 2e 79 |& (l * t|rans.x.y|
|00000520| 20 2b 20 72 20 2d 3e 20 | 6f 72 67 2e 79 29 20 3e | + r -> |org.y) >|
|00000530| 20 30 2e 30 29 20 7b 0d | 09 09 09 09 2f 2a 20 57 | 0.0) {.|..../* W|
|00000540| 45 20 48 49 54 20 53 4f | 4d 45 54 48 49 4e 47 20 |E HIT SO|METHING |
|00000550| 2a 2f 0d 09 20 20 20 20 | 4d 56 20 28 6c 20 2a 20 |*/.. |MV (l * |
|00000560| 74 72 61 6e 73 2e 78 2e | 78 2c 20 6c 20 2a 20 74 |trans.x.|x, l * t|
|00000570| 72 61 6e 73 2e 78 2e 79 | 2c 20 6c 20 2a 20 74 72 |rans.x.y|, l * tr|
|00000580| 61 6e 73 2e 78 2e 7a 2c | 20 6e 65 77 29 3b 0d 09 |ans.x.z,| new);..|
|00000590| 20 20 20 20 6e 65 77 2e | 6c 3d 6c 3b 0d 2f 2a 20 | new.|l=l;./* |
|000005a0| 6d 6f 76 65 20 74 68 65 | 20 6e 65 77 20 6f 72 67 |move the| new org|
|000005b0| 69 6e 20 6f 66 20 74 68 | 65 20 72 61 79 20 74 6f |in of th|e ray to|
|000005c0| 20 74 68 65 20 69 6e 74 | 65 72 73 65 63 74 69 6f | the int|ersectio|
|000005d0| 6e 20 2a 2f 0d 09 20 20 | 20 20 41 56 20 28 72 65 |n */.. | AV (re|
|000005e0| 66 72 2e 6f 72 67 2c 20 | 6e 65 77 2c 20 72 20 2d |fr.org, |new, r -|
|000005f0| 3e 20 6f 72 67 29 3b 0d | 09 20 20 20 20 41 56 20 |> org);.|. AV |
|00000600| 28 72 20 2d 3e 20 6f 72 | 67 2c 20 6e 65 77 2c 20 |(r -> or|g, new, |
|00000610| 72 20 2d 3e 20 6f 72 67 | 29 3b 0d 09 20 20 20 20 |r -> org|);.. |
|00000620| 4d 56 20 28 72 20 2d 3e | 20 64 69 72 2e 78 2c 20 |MV (r ->| dir.x, |
|00000630| 72 20 2d 3e 20 64 69 72 | 2e 79 2c 20 72 20 2d 3e |r -> dir|.y, r ->|
|00000640| 20 64 69 72 2e 7a 2c 20 | 72 65 66 72 2e 64 69 72 | dir.z, |refr.dir|
|00000650| 29 3b 0d 2f 2a 20 67 65 | 74 20 61 20 6e 6f 72 6d |);./* ge|t a norm|
|00000660| 61 6c 20 76 65 63 74 6f | 72 20 66 6f 72 20 74 68 |al vecto|r for th|
|00000670| 65 20 69 6e 74 65 72 73 | 65 63 74 69 6f 6e 20 70 |e inters|ection p|
|00000680| 6f 69 6e 74 20 2a 2f 0d | 09 20 20 20 20 53 56 20 |oint */.|. SV |
|00000690| 28 6e 6f 72 6d 2c 20 72 | 20 2d 3e 20 6f 72 67 2c |(norm, r| -> org,|
|000006a0| 20 62 6c 5b 63 5d 20 2d | 3e 20 73 2e 63 65 6e 74 | bl[c] -|> s.cent|
|000006b0| 29 3b 0d 09 20 20 20 20 | 6e 6f 72 6d 2e 6c 3d 62 |);.. |norm.l=b|
|000006c0| 6c 5b 63 5d 20 2d 3e 73 | 2e 72 61 64 3b 0d 0d 2f |l[c] ->s|.rad;../|
|000006d0| 2a 20 61 6d 62 69 65 6e | 74 20 6c 69 67 68 74 69 |* ambien|t lighti|
|000006e0| 6e 67 20 2a 2f 0d 09 20 | 20 20 20 6c 67 68 74 20 |ng */.. | lght |
|000006f0| 3d 20 32 30 30 2e 30 20 | 2a 20 62 6c 5b 63 5d 20 |= 200.0 |* bl[c] |
|00000700| 2d 3e 20 61 6d 62 3b 0d | 0d 2f 2a 20 73 68 61 64 |-> amb;.|./* shad|
|00000710| 65 64 20 6c 69 67 68 74 | 69 6e 67 20 28 64 69 66 |ed light|ing (dif|
|00000720| 66 75 73 65 29 2e 20 73 | 75 62 72 6f 75 74 69 6e |fuse). s|ubroutin|
|00000730| 65 20 53 68 61 64 6f 77 | 20 69 73 20 69 6e 20 66 |e Shadow| is in f|
|00000740| 69 6e 64 2e 63 20 2a 2f | 0d 09 20 20 20 20 69 66 |ind.c */|.. if|
|00000750| 20 28 62 6c 5b 63 5d 20 | 2d 3e 20 64 69 66 20 21 | (bl[c] |-> dif !|
|00000760| 3d 20 30 2e 30 29 20 7b | 0d 09 09 53 56 20 28 6e |= 0.0) {|...SV (n|
|00000770| 65 77 2c 20 6c 73 2e 63 | 65 6e 74 2c 20 72 20 2d |ew, ls.c|ent, r -|
|00000780| 3e 20 6f 72 67 29 3b 0d | 09 09 6e 65 77 2e 6c 20 |> org);.|..new.l |
|00000790| 3d 20 4c 45 4e 28 6e 65 | 77 29 3b 0d 09 09 69 66 |= LEN(ne|w);...if|
|000007a0| 20 28 28 6b 20 3d 20 44 | 4f 54 20 28 6e 65 77 2c | ((k = D|OT (new,|
|000007b0| 20 6e 6f 72 6d 29 29 20 | 3e 20 30 2e 30 29 0d 09 | norm)) |> 0.0)..|
|000007c0| 09 20 20 20 20 6c 67 68 | 74 20 2b 3d 20 62 6c 5b |. lgh|t += bl[|
|000007d0| 63 5d 20 2d 3e 20 64 69 | 66 20 2a 20 53 68 61 64 |c] -> di|f * Shad|
|000007e0| 6f 77 20 28 26 28 72 20 | 2d 3e 20 6f 72 67 29 29 |ow (&(r |-> org))|
|000007f0| 20 2a 20 6b 20 2f 20 28 | 6e 65 77 2e 6c 29 20 2f | * k / (|new.l) /|
|00000800| 20 28 6e 6f 72 6d 2e 6c | 29 3b 0d 09 20 20 20 20 | (norm.l|);.. |
|00000810| 7d 0d 0d 09 43 61 6c 6c | 53 74 64 45 76 65 6e 74 |}...Call|StdEvent|
|00000820| 28 29 3b 0d 2f 2a 72 65 | 66 6c 65 63 74 69 6f 6e |();./*re|flection|
|00000830| 2e 2e 2e 20 65 61 73 79 | 20 2a 2f 0d 09 20 20 09 |... easy| */.. .|
|00000840| 20 69 66 20 28 62 6c 5b | 63 5d 20 2d 3e 20 72 66 | if (bl[|c] -> rf|
|00000850| 6c 20 21 3d 20 30 2e 30 | 29 20 7b 0d 2f 2a 20 6d |l != 0.0|) {./* m|
|00000860| 61 6b 65 20 74 68 65 20 | 6e 6f 72 6d 61 6c 20 75 |ake the |normal u|
|00000870| 6e 69 74 20 6c 65 6e 67 | 74 68 20 2a 2f 0d 09 09 |nit leng|th */...|
|00000880| 53 43 4d 4c 54 20 28 28 | 31 2e 30 20 2f 20 6e 6f |SCMLT ((|1.0 / no|
|00000890| 72 6d 2e 6c 29 2c 20 6e | 6f 72 6d 29 3b 0d 2f 2a |rm.l), n|orm);./*|
|000008a0| 20 67 65 74 20 74 68 65 | 20 6c 65 6e 67 74 68 20 | get the| length |
|000008b0| 6f 66 20 74 68 65 20 72 | 61 79 27 73 20 63 6f 6d |of the r|ay's com|
|000008c0| 70 6f 6e 65 6e 74 20 69 | 6e 20 74 68 65 20 6e 6f |ponent i|n the no|
|000008d0| 72 6d 61 6c 20 64 69 72 | 65 63 74 69 6f 6e 20 2a |rmal dir|ection *|
|000008e0| 2f 0d 09 09 73 74 75 70 | 69 64 20 3d 20 32 2e 30 |/...stup|id = 2.0|
|000008f0| 20 2a 20 44 4f 54 20 28 | 6e 6f 72 6d 2c 20 72 20 | * DOT (|norm, r |
|00000900| 2d 3e 20 64 69 72 29 3b | 0d 09 09 53 43 4d 4c 54 |-> dir);|...SCMLT|
|00000910| 20 28 73 74 75 70 69 64 | 2c 20 6e 6f 72 6d 29 3b | (stupid|, norm);|
|00000920| 0d 2f 2a 20 73 75 62 74 | 72 61 63 74 20 64 6f 75 |./* subt|ract dou|
|00000930| 62 6c 65 20 74 68 65 20 | 6e 6f 72 6d 61 6c 20 63 |ble the |normal c|
|00000940| 6f 6d 70 6f 6e 65 6e 74 | 2d 20 21 72 65 66 6c 65 |omponent|- !refle|
|00000950| 63 74 69 6f 6e 21 20 2a | 2f 0d 09 09 53 56 20 28 |ction! *|/...SV (|
|00000960| 72 20 2d 3e 20 64 69 72 | 2c 20 72 20 2d 3e 20 64 |r -> dir|, r -> d|
|00000970| 69 72 2c 20 6e 6f 72 6d | 29 3b 0d 09 09 6c 67 68 |ir, norm|);...lgh|
|00000980| 74 20 2b 3d 20 62 6c 5b | 63 5d 20 2d 3e 20 72 66 |t += bl[|c] -> rf|
|00000990| 6c 20 2a 20 28 64 6f 75 | 62 6c 65 29 20 73 68 61 |l * (dou|ble) sha|
|000009a0| 64 65 20 28 72 29 3b 0d | 09 20 20 20 20 7d 0d 0d |de (r);.|. }..|
|000009b0| 2f 2a 20 72 65 66 72 61 | 63 74 69 6f 6e 2e 20 74 |/* refra|ction. t|
|000009c0| 68 69 73 20 69 73 20 75 | 67 6c 79 2c 20 77 68 69 |his is u|gly, whi|
|000009d0| 63 68 20 69 73 20 77 68 | 79 20 49 20 63 68 6f 6f |ch is wh|y I choo|
|000009e0| 73 65 20 74 6f 20 64 65 | 61 6c 20 77 69 74 68 0d |se to de|al with.|
|000009f0| 20 20 20 69 74 20 69 6e | 20 69 74 27 73 20 6f 77 | it in| it's ow|
|00000a00| 6e 20 73 75 62 72 6f 75 | 74 69 6e 65 20 77 68 69 |n subrou|tine whi|
|00000a10| 63 68 20 63 6f 6d 65 73 | 20 61 66 74 65 72 20 74 |ch comes| after t|
|00000a20| 68 69 73 20 6f 6e 65 20 | 2a 2f 0d 09 20 20 20 20 |his one |*/.. |
|00000a30| 69 66 20 28 62 6c 5b 63 | 5d 20 2d 3e 20 72 66 72 |if (bl[c|] -> rfr|
|00000a40| 20 21 3d 20 30 2e 30 29 | 20 7b 0d 09 09 6c 67 68 | != 0.0)| {...lgh|
|00000a50| 74 20 2b 3d 20 62 6c 5b | 63 5d 20 2d 3e 20 72 66 |t += bl[|c] -> rf|
|00000a60| 72 20 2a 20 28 64 6f 75 | 62 6c 65 29 20 72 65 66 |r * (dou|ble) ref|
|00000a70| 72 61 63 74 20 28 26 72 | 65 66 72 2c 20 62 6c 5b |ract (&r|efr, bl[|
|00000a80| 63 5d 29 3b 0d 09 20 20 | 20 20 7d 0d 0d 0d 0d 09 |c]);.. | }.....|
|00000a90| 7d 0d 09 65 6c 73 65 20 | 7b 09 09 09 2f 2a 20 68 |}..else |{.../* h|
|00000aa0| 69 74 20 6e 6f 20 6f 62 | 6a 65 63 74 73 2e 2e 2e |it no ob|jects...|
|00000ab0| 20 2a 2f 0d 09 20 20 20 | 20 69 66 20 28 28 72 20 | */.. | if ((r |
|00000ac0| 2d 3e 20 64 69 72 2e 79 | 29 20 3c 20 30 2e 30 29 |-> dir.y|) < 0.0)|
|00000ad0| 20 7b 2f 2a 20 63 72 6f | 73 73 65 73 20 66 6c 6f | {/* cro|sses flo|
|00000ae0| 6f 72 20 2a 2f 0d 09 09 | 7a 20 3d 20 2d 28 72 20 |or */...|z = -(r |
|00000af0| 2d 3e 20 6f 72 67 2e 79 | 29 20 2f 20 28 72 20 2d |-> org.y|) / (r -|
|00000b00| 3e 20 64 69 72 2e 79 29 | 3b 0d 09 09 28 72 20 2d |> dir.y)|;...(r -|
|00000b10| 3e 20 6f 72 67 2e 78 29 | 20 2b 3d 20 7a 20 2a 20 |> org.x)| += z * |
|00000b20| 28 72 20 2d 3e 20 64 69 | 72 2e 78 29 3b 0d 09 09 |(r -> di|r.x);...|
|00000b30| 28 72 20 2d 3e 20 6f 72 | 67 2e 7a 29 20 2b 3d 20 |(r -> or|g.z) += |
|00000b40| 7a 20 2a 20 28 72 20 2d | 3e 20 64 69 72 2e 7a 29 |z * (r -|> dir.z)|
|00000b50| 3b 0d 09 09 28 72 20 2d | 3e 20 6f 72 67 2e 79 29 |;...(r -|> org.y)|
|00000b60| 20 3d 20 30 2e 30 3b 0d | 0d 09 09 53 56 20 28 6e | = 0.0;.|...SV (n|
|00000b70| 65 77 2c 20 6c 73 2e 63 | 65 6e 74 2c 20 72 20 2d |ew, ls.c|ent, r -|
|00000b80| 3e 20 6f 72 67 29 3b 0d | 09 09 6e 65 77 2e 6c 20 |> org);.|..new.l |
|00000b90| 3d 20 4c 45 4e 28 6e 65 | 77 29 3b 0d 09 09 73 78 |= LEN(ne|w);...sx|
|00000ba0| 20 3d 20 28 69 6e 74 29 | 20 28 72 20 2d 3e 20 6f | = (int)| (r -> o|
|00000bb0| 72 67 2e 78 20 2f 20 31 | 2e 35 29 20 25 20 78 73 |rg.x / 1|.5) % xs|
|00000bc0| 75 65 3b 0d 09 09 69 66 | 20 28 73 78 20 3c 20 30 |ue;...if| (sx < 0|
|00000bd0| 29 0d 09 09 20 20 20 20 | 73 78 20 2b 3d 20 78 73 |)... |sx += xs|
|00000be0| 75 65 3b 0d 09 09 73 79 | 20 3d 20 2d 28 69 6e 74 |ue;...sy| = -(int|
|00000bf0| 29 20 28 72 20 2d 3e 20 | 6f 72 67 2e 7a 20 2f 20 |) (r -> |org.z / |
|00000c00| 31 2e 35 29 20 25 20 79 | 73 75 65 3b 0d 09 09 69 |1.5) % y|sue;...i|
|00000c10| 66 20 28 73 79 20 3c 20 | 30 29 0d 09 09 20 20 20 |f (sy < |0)... |
|00000c20| 20 73 79 20 2b 3d 20 79 | 73 75 65 3b 0d 09 09 6c | sy += y|sue;...l|
|00000c30| 67 68 74 20 3d 20 28 73 | 61 6d 20 2a 20 73 75 7a |ght = (s|am * suz|
|00000c40| 69 65 5b 73 78 5d 5b 73 | 79 5d 20 2b 20 31 2e 30 |ie[sx][s|y] + 1.0|
|00000c50| 20 2d 20 73 61 6d 29 20 | 2a 20 28 30 2e 38 20 2a | - sam) |* (0.8 *|
|00000c60| 0d 09 09 09 53 68 61 64 | 6f 77 20 28 26 28 72 20 |....Shad|ow (&(r |
|00000c70| 2d 3e 20 6f 72 67 29 29 | 20 2a 20 28 6e 65 77 2e |-> org))| * (new.|
|00000c80| 79 29 20 2f 20 28 6e 65 | 77 2e 6c 29 20 2b 20 34 |y) / (ne|w.l) + 4|
|00000c90| 30 2e 30 29 3b 0d 0d 0d | 09 20 20 20 20 7d 0d 09 |0.0);...|. }..|
|00000ca0| 20 20 20 20 65 6c 73 65 | 20 7b 09 09 2f 2a 20 63 | else| {../* c|
|00000cb0| 68 65 63 6b 20 74 6f 20 | 73 65 65 20 69 66 20 69 |heck to |see if i|
|00000cc0| 74 20 68 69 74 20 6c 69 | 67 68 74 73 6f 75 72 63 |t hit li|ghtsourc|
|00000cd0| 65 20 2a 2f 0d 09 09 53 | 56 20 28 73 73 2e 63 65 |e */...S|V (ss.ce|
|00000ce0| 6e 74 2c 20 6c 73 2e 63 | 65 6e 74 2c 20 72 20 2d |nt, ls.c|ent, r -|
|00000cf0| 3e 20 6f 72 67 29 3b 0d | 09 09 73 73 2e 72 61 64 |> org);.|..ss.rad|
|00000d00| 20 3d 20 6c 73 2e 72 61 | 64 3b 0d 09 09 69 66 20 | = ls.ra|d;...if |
|00000d10| 28 66 69 6e 64 20 28 26 | 74 72 61 6e 73 2c 20 26 |(find (&|trans, &|
|00000d20| 28 73 73 2e 63 65 6e 74 | 29 29 20 3e 20 30 2e 30 |(ss.cent|)) > 0.0|
|00000d30| 29 0d 09 09 20 20 20 20 | 6c 67 68 74 20 3d 20 32 |)... |lght = 2|
|00000d40| 35 35 3b 0d 09 09 65 6c | 73 65 0d 09 09 20 20 20 |55;...el|se... |
|00000d50| 20 6c 67 68 74 20 3d 20 | 30 3b 0d 09 20 20 20 20 | lght = |0;.. |
|00000d60| 7d 0d 09 7d 0d 20 20 20 | 20 7d 0d 2f 2a 20 74 6f |}..}. | }./* to|
|00000d70| 20 6d 61 6e 79 20 6c 65 | 76 65 6c 73 20 72 65 74 | many le|vels ret|
|00000d80| 75 72 6e 20 30 20 63 61 | 75 73 65 20 69 74 20 73 |urn 0 ca|use it s|
|00000d90| 68 6f 75 6c 64 6e 27 74 | 20 6d 61 74 74 65 72 20 |houldn't| matter |
|00000da0| 2a 2f 0d 20 20 20 20 65 | 6c 73 65 0d 09 6c 67 68 |*/. e|lse..lgh|
|00000db0| 74 20 3d 20 30 3b 0d 20 | 20 20 20 6c 65 76 65 6c |t = 0;. | level|
|00000dc0| 2d 2d 3b 0d 20 20 20 20 | 69 66 20 28 6c 67 68 74 |--;. |if (lght|
|00000dd0| 20 3c 20 30 2e 30 29 0d | 09 6c 67 68 74 20 3d 20 | < 0.0).|.lght = |
|00000de0| 30 2e 30 3b 0d 20 20 20 | 20 69 66 20 28 6c 67 68 |0.0;. | if (lgh|
|00000df0| 74 20 3e 20 32 35 35 2e | 30 29 0d 09 6c 67 68 74 |t > 255.|0)..lght|
|00000e00| 20 3d 20 32 35 35 2e 30 | 3b 0d 20 20 20 20 72 65 | = 255.0|;. re|
|00000e10| 74 75 72 6e 20 28 28 69 | 6e 74 29 20 6c 67 68 74 |turn ((i|nt) lght|
|00000e20| 29 3b 0d 7d 00 00 00 00 | 00 00 00 00 00 00 00 00 |);.}....|........|
|00000e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+