home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / amiga.free / sorgenti vari / wolf3dmacsource.sit / Wolf3DMacSource / Refresh.c < prev    next >
MacBinary  |  1994-10-06  |  11.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu Oct 6 13:41:39 1994, modified Thu Oct 6 13:41:39 1994, creator 'CWIE', type ASCII, 11269 bytes "Refresh.c" , at 0x2c85 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 52 65 66 72 65 73 | 68 2e 63 00 00 00 00 00 |..Refres|h.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 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 2c 05 00 | 00 01 7e aa b9 e7 53 aa |.....,..|..~...S.|
|00000060| b9 e7 53 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..S.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 4b bb 00 00 |........|....K...|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 57 6f 6c 66 44 65 |#include| "WolfDe|
|00000090| 66 2e 68 22 0d 23 69 6e | 63 6c 75 64 65 20 3c 73 |f.h".#in|clude <s|
|000000a0| 74 72 69 6e 67 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |tring.h>|.#includ|
|000000b0| 65 20 3c 6d 61 74 68 2e | 68 3e 0d 0d 23 64 65 66 |e <math.|h>..#def|
|000000c0| 69 6e 65 09 44 4f 4f 52 | 50 49 43 09 35 39 0d 0d |ine.DOOR|PIC.59..|
|000000d0| 2f 2a 20 53 63 61 6c 65 | 20 72 61 6e 67 65 73 20 |/* Scale| ranges |
|000000e0| 66 72 6f 6d 20 30 78 66 | 66 66 66 20 28 6f 6e 65 |from 0xf|fff (one|
|000000f0| 20 74 69 6c 65 20 3d 3d | 20 35 31 32 20 70 69 78 | tile ==| 512 pix|
|00000100| 65 6c 73 20 68 69 67 68 | 29 20 64 6f 77 6e 20 74 |els high|) down t|
|00000110| 6f 20 30 78 31 30 30 20 | 28 6f 6e 65 20 74 69 6c |o 0x100 |(one til|
|00000120| 65 20 3d 3d 20 32 20 70 | 69 78 65 6c 73 29 20 2a |e == 2 p|ixels) *|
|00000130| 2f 0d 0d 73 61 76 65 6e | 6f 64 65 5f 74 20 2a 6e |/..saven|ode_t *n|
|00000140| 6f 64 65 73 3b 0d 73 61 | 76 65 73 65 67 5f 74 20 |odes;.sa|veseg_t |
|00000150| 2a 70 77 61 6c 6c 73 65 | 67 3b 09 09 09 09 2f 2a |*pwallse|g;..../*|
|00000160| 20 70 75 73 68 77 61 6c | 6c 20 69 6e 20 6d 6f 74 | pushwal|l in mot|
|00000170| 69 6f 6e 2a 2f 0d 0d 2f | 2a 0d 3d 3d 3d 3d 3d 3d |ion*/../|*.======|
|00000180| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000190| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 0d 09 09 09 09 |========|==......|
|000001b0| 4d 41 54 48 20 52 4f 55 | 54 49 4e 45 53 0d 0d 3d |MATH ROU|TINES..=|
|000001c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 0d |========|=======.|
|000001f0| 2a 2f 0d 0d 2f 2a 20 2d | 38 2e 38 20 2a 20 2d 30 |*/../* -|8.8 * -0|
|00000200| 2e 38 20 3d 20 2d 38 2e | 38 2a 2f 0d 66 69 78 65 |.8 = -8.|8*/.fixe|
|00000210| 64 5f 74 09 46 69 78 65 | 64 42 79 46 72 61 63 20 |d_t.Fixe|dByFrac |
|00000220| 28 66 69 78 65 64 5f 74 | 20 61 2c 20 66 69 78 65 |(fixed_t| a, fixe|
|00000230| 64 5f 74 20 62 29 0d 7b | 0d 09 66 69 78 65 64 5f |d_t b).{|..fixed_|
|00000240| 74 09 63 3b 0d 09 63 20 | 3d 20 28 28 6c 6f 6e 67 |t.c;..c |= ((long|
|00000250| 29 61 20 2a 20 28 6c 6f | 6e 67 29 62 29 3e 3e 46 |)a * (lo|ng)b)>>F|
|00000260| 52 41 43 42 49 54 53 3b | 0d 09 72 65 74 75 72 6e |RACBITS;|..return|
|00000270| 20 63 3b 0d 7d 0d 0d 2f | 2a 20 2d 38 2e 38 20 2a | c;.}../|* -8.8 *|
|00000280| 20 2d 30 2e 38 20 3d 20 | 2d 38 2e 38 2a 2f 0d 66 | -0.8 = |-8.8*/.f|
|00000290| 69 78 65 64 5f 74 09 53 | 55 46 69 78 65 64 4d 75 |ixed_t.S|UFixedMu|
|000002a0| 6c 20 28 66 69 78 65 64 | 5f 74 20 61 2c 20 75 66 |l (fixed|_t a, uf|
|000002b0| 69 78 65 64 5f 74 20 62 | 29 0d 7b 0d 09 66 69 78 |ixed_t b|).{..fix|
|000002c0| 65 64 5f 74 09 63 3b 0d | 09 63 20 3d 20 28 28 6c |ed_t.c;.|.c = ((l|
|000002d0| 6f 6e 67 29 61 20 2a 20 | 28 6c 6f 6e 67 29 62 29 |ong)a * |(long)b)|
|000002e0| 3e 3e 46 52 41 43 42 49 | 54 53 3b 0d 09 72 65 74 |>>FRACBI|TS;..ret|
|000002f0| 75 72 6e 20 63 3b 0d 7d | 0d 0d 2f 2a 20 2d 38 2e |urn c;.}|../* -8.|
|00000300| 38 20 2f 20 2d 38 2e 38 | 20 3d 20 2d 38 2e 38 2a |8 / -8.8| = -8.8*|
|00000310| 2f 0d 66 69 78 65 64 5f | 74 09 46 69 78 65 64 44 |/.fixed_|t.FixedD|
|00000320| 69 76 20 28 66 69 78 65 | 64 5f 74 20 61 2c 20 66 |iv (fixe|d_t a, f|
|00000330| 69 78 65 64 5f 74 20 62 | 29 0d 7b 0d 09 61 20 3d |ixed_t b|).{..a =|
|00000340| 20 28 6c 6f 6e 67 29 28 | 28 28 6c 6f 6e 67 29 61 | (long)(|((long)a|
|00000350| 3c 3c 46 52 41 43 42 49 | 54 53 29 20 2f 20 28 6c |<<FRACBI|TS) / (l|
|00000360| 6f 6e 67 29 62 29 3b 0d | 09 72 65 74 75 72 6e 20 |ong)b);.|.return |
|00000370| 61 3b 0d 7d 0d 0d 2f 2a | 2a 2a 2a 2a 2a 2a 2a 2a |a;.}../*|********|
|00000380| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000390| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0d 0d 09 52 65 74 75 |********|*...Retu|
|000003a0| 72 6e 20 74 68 65 20 78 | 20 63 6f 6f 72 64 20 66 |rn the x| coord f|
|000003b0| 6f 72 20 61 20 73 70 72 | 69 74 65 0d 09 0d 2a 2a |or a spr|ite...**|
|000003c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003e0| 2f 0d 0d 66 69 78 65 64 | 5f 74 20 52 5f 54 72 61 |/..fixed|_t R_Tra|
|000003f0| 6e 73 66 6f 72 6d 58 28 | 66 69 78 65 64 5f 74 20 |nsformX(|fixed_t |
|00000400| 78 2c 66 69 78 65 64 5f | 74 20 79 29 0d 7b 0d 09 |x,fixed_|t y).{..|
|00000410| 66 69 78 65 64 5f 74 20 | 67 78 74 2c 67 79 74 3b |fixed_t |gxt,gyt;|
|00000420| 0d 09 67 78 74 20 3d 20 | 46 69 78 65 64 42 79 46 |..gxt = |FixedByF|
|00000430| 72 61 63 28 78 2c 76 69 | 65 77 73 69 6e 29 3b 0d |rac(x,vi|ewsin);.|
|00000440| 09 67 79 74 20 3d 20 46 | 69 78 65 64 42 79 46 72 |.gyt = F|ixedByFr|
|00000450| 61 63 28 79 2c 76 69 65 | 77 63 6f 73 29 3b 0d 09 |ac(y,vie|wcos);..|
|00000460| 72 65 74 75 72 6e 20 67 | 78 74 2d 67 79 74 3b 0d |return g|xt-gyt;.|
|00000470| 7d 0d 0d 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |}../****|********|
|00000480| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000490| 2a 2a 2a 2a 2a 2a 0d 0d | 09 52 65 74 75 72 6e 20 |******..|.Return |
|000004a0| 74 68 65 20 73 63 61 6c | 65 20 66 61 63 74 6f 72 |the scal|e factor|
|000004b0| 20 66 6f 72 20 61 20 73 | 70 72 69 74 65 0d 09 0d | for a s|prite...|
|000004c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000004d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000004e0| 2a 2a 2f 0d 0d 66 69 78 | 65 64 5f 74 20 52 5f 54 |**/..fix|ed_t R_T|
|000004f0| 72 61 6e 73 66 6f 72 6d | 5a 28 66 69 78 65 64 5f |ransform|Z(fixed_|
|00000500| 74 20 78 2c 66 69 78 65 | 64 5f 74 20 79 29 0d 7b |t x,fixe|d_t y).{|
|00000510| 0d 09 66 69 78 65 64 5f | 74 09 67 78 74 2c 67 79 |..fixed_|t.gxt,gy|
|00000520| 74 3b 0d 09 67 78 74 20 | 3d 20 46 69 78 65 64 42 |t;..gxt |= FixedB|
|00000530| 79 46 72 61 63 28 78 2c | 76 69 65 77 63 6f 73 29 |yFrac(x,|viewcos)|
|00000540| 3b 0d 09 67 79 74 20 3d | 20 46 69 78 65 64 42 79 |;..gyt =| FixedBy|
|00000550| 46 72 61 63 28 79 2c 76 | 69 65 77 73 69 6e 29 3b |Frac(y,v|iewsin);|
|00000560| 0d 09 72 65 74 75 72 6e | 20 67 78 74 2b 67 79 74 |..return| gxt+gyt|
|00000570| 3b 0d 7d 0d 0d 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |;.}../**|********|
|00000580| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000590| 2a 2a 2a 2a 2a 2a 2a 2a | 0d 0d 09 52 65 74 75 72 |********|...Retur|
|000005a0| 6e 20 74 68 65 20 73 63 | 61 6c 65 20 66 61 63 74 |n the sc|ale fact|
|000005b0| 6f 72 20 66 72 6f 6d 20 | 61 20 36 34 6b 20 72 61 |or from |a 64k ra|
|000005c0| 6e 67 65 20 61 6e 67 6c | 65 0d 09 0d 2a 2a 2a 2a |nge angl|e...****|
|000005d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000005e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2f 0d |********|******/.|
|000005f0| 0d 57 6f 72 64 20 53 63 | 61 6c 65 46 72 6f 6d 47 |.Word Sc|aleFromG|
|00000600| 6c 6f 62 61 6c 41 6e 67 | 6c 65 28 69 6e 74 20 76 |lobalAng|le(int v|
|00000610| 69 73 61 6e 67 6c 65 2c | 69 6e 74 20 64 69 73 74 |isangle,|int dist|
|00000620| 61 6e 63 65 29 0d 7b 0d | 09 66 69 78 65 64 5f 74 |ance).{.|.fixed_t|
|00000630| 09 74 7a 3b 0d 0d 09 57 | 6f 72 64 20 61 6e 67 6c |.tz;...W|ord angl|
|00000640| 65 61 2c 20 61 6e 67 6c | 65 62 3b 0d 09 57 6f 72 |ea, angl|eb;..Wor|
|00000650| 64 20 73 69 6e 65 61 2c | 20 73 69 6e 65 62 3b 0d |d sinea,| sineb;.|
|00000660| 09 0d 09 76 69 73 61 6e | 67 6c 65 20 3e 3e 3d 20 |...visan|gle >>= |
|00000670| 41 4e 47 4c 45 54 4f 46 | 49 4e 45 53 48 49 46 54 |ANGLETOF|INESHIFT|
|00000680| 3b 0d 09 61 6e 67 6c 65 | 61 20 3d 20 28 46 49 4e |;..angle|a = (FIN|
|00000690| 45 41 4e 47 4c 45 53 2f | 34 20 2b 20 28 76 69 73 |EANGLES/|4 + (vis|
|000006a0| 61 6e 67 6c 65 2d 63 65 | 6e 74 65 72 61 6e 67 6c |angle-ce|nterangl|
|000006b0| 65 29 29 26 28 46 49 4e | 45 41 4e 47 4c 45 53 2f |e))&(FIN|EANGLES/|
|000006c0| 32 2d 31 29 3b 0d 09 61 | 6e 67 6c 65 62 20 3d 20 |2-1);..a|ngleb = |
|000006d0| 28 46 49 4e 45 41 4e 47 | 4c 45 53 2f 34 20 2b 20 |(FINEANG|LES/4 + |
|000006e0| 28 76 69 73 61 6e 67 6c | 65 2d 6e 6f 72 6d 61 6c |(visangl|e-normal|
|000006f0| 61 6e 67 6c 65 29 29 26 | 28 46 49 4e 45 41 4e 47 |angle))&|(FINEANG|
|00000700| 4c 45 53 2f 32 2d 31 29 | 3b 0d 09 73 69 6e 65 61 |LES/2-1)|;..sinea|
|00000710| 20 3d 20 66 69 6e 65 73 | 69 6e 65 5b 61 6e 67 6c | = fines|ine[angl|
|00000720| 65 61 5d 3b 09 2f 2a 20 | 62 6f 74 68 65 20 73 69 |ea];./* |bothe si|
|00000730| 6e 65 73 20 61 72 65 20 | 61 6c 77 61 79 73 20 70 |nes are |always p|
|00000740| 6f 73 69 74 69 76 65 2a | 2f 0d 09 73 69 6e 65 62 |ositive*|/..sineb|
|00000750| 20 3d 20 66 69 6e 65 73 | 69 6e 65 5b 61 6e 67 6c | = fines|ine[angl|
|00000760| 65 62 5d 3b 0d 09 0d 09 | 74 7a 20 3d 20 28 28 6c |eb];....|tz = ((l|
|00000770| 6f 6e 67 29 64 69 73 74 | 61 6e 63 65 20 2a 20 73 |ong)dist|ance * s|
|00000780| 69 6e 65 61 29 20 2f 20 | 73 69 6e 65 62 3b 0d 0d |inea) / |sineb;..|
|00000790| 09 69 66 20 28 74 7a 3e | 3d 4d 41 58 5a 29 20 7b |.if (tz>|=MAXZ) {|
|000007a0| 09 09 2f 2a 20 4d 61 6b | 65 20 73 75 72 65 20 69 |../* Mak|e sure i|
|000007b0| 74 27 73 20 6e 6f 74 20 | 74 6f 6f 20 62 69 67 2e |t's not |too big.|
|000007c0| 2e 2e 20 2a 2f 0d 09 09 | 74 7a 20 3d 20 4d 41 58 |.. */...|tz = MAX|
|000007d0| 5a 2d 31 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |Z-1;..}.|.return |
|000007e0| 73 63 61 6c 65 61 74 7a | 70 74 72 5b 74 7a 5d 3b |scaleatz|ptr[tz];|
|000007f0| 09 09 2f 2a 20 52 65 74 | 75 72 6e 20 74 68 65 20 |../* Ret|urn the |
|00000800| 73 69 7a 65 20 2a 2f 0d | 7d 0d 0d 2f 2a 2a 2a 2a |size */.|}../****|
|00000810| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000820| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0d 0d |********|******..|
|00000830| 09 54 68 65 20 61 75 74 | 6f 6d 61 70 20 68 61 73 |.The aut|omap has|
|00000840| 20 74 6f 20 62 65 20 64 | 6f 6e 65 20 69 6e 20 71 | to be d|one in q|
|00000850| 75 61 64 72 61 6e 74 73 | 20 66 6f 72 20 76 61 72 |uadrants| for var|
|00000860| 69 6f 75 73 20 72 65 61 | 73 6f 6e 73 0d 09 0d 2a |ious rea|sons...*|
|00000870| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000880| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000890| 2a 2f 0d 0d 76 6f 69 64 | 20 44 72 61 77 41 75 74 |*/..void| DrawAut|
|000008a0| 6f 6d 61 70 28 57 6f 72 | 64 20 74 78 2c 57 6f 72 |omap(Wor|d tx,Wor|
|000008b0| 64 20 74 79 29 0d 7b 0d | 09 57 6f 72 64 20 69 2c |d ty).{.|.Word i,|
|000008c0| 20 74 69 6c 65 3b 0d 09 | 73 61 76 65 73 65 67 5f | tile;..|saveseg_|
|000008d0| 74 20 2a 73 65 67 3b 0d | 09 57 6f 72 64 20 78 2c |t *seg;.|.Word x,|
|000008e0| 79 2c 78 73 74 65 70 2c | 79 73 74 65 70 2c 63 6f |y,xstep,|ystep,co|
|000008f0| 75 6e 74 3b 0d 09 57 6f | 72 64 20 6d 69 6e 2c 6d |unt;..Wo|rd min,m|
|00000900| 61 78 3b 0d 09 57 6f 72 | 64 20 6d 61 78 74 78 2c |ax;..Wor|d maxtx,|
|00000910| 20 6d 61 78 74 79 3b 0d | 09 57 6f 72 64 20 4e 6f | maxty;.|.Word No|
|00000920| 64 65 43 6f 75 6e 74 3b | 0d 09 0d 09 4e 6f 64 65 |deCount;|....Node|
|00000930| 43 6f 75 6e 74 20 3d 20 | 4d 61 70 50 74 72 2d 3e |Count = |MapPtr->|
|00000940| 6e 75 6d 6e 6f 64 65 73 | 3b 0d 09 6d 61 78 74 78 |numnodes|;..maxtx|
|00000950| 20 3d 20 74 78 2b 28 53 | 43 52 45 45 4e 57 49 44 | = tx+(S|CREENWID|
|00000960| 54 48 2f 31 36 29 3b 0d | 09 6d 61 78 74 79 20 3d |TH/16);.|.maxty =|
|00000970| 20 74 79 2b 28 53 43 52 | 45 45 4e 48 45 49 47 48 | ty+(SCR|EENHEIGH|
|00000980| 54 2f 31 36 29 3b 0d 09 | 73 65 67 20 3d 20 28 73 |T/16);..|seg = (s|
|00000990| 61 76 65 73 65 67 5f 74 | 20 2a 29 6e 6f 64 65 73 |aveseg_t| *)nodes|
|000009a0| 3b 0d 09 69 20 3d 20 30 | 3b 0d 09 64 6f 20 7b 0d |;..i = 0|;..do {.|
|000009b0| 09 09 69 66 20 28 20 28 | 73 65 67 2d 3e 64 69 72 |..if ( (|seg->dir|
|000009c0| 20 26 20 28 44 49 52 5f | 53 45 47 46 4c 41 47 7c | & (DIR_|SEGFLAG||
|000009d0| 44 49 52 5f 53 45 45 4e | 46 4c 41 47 29 29 20 3d |DIR_SEEN|FLAG)) =|
|000009e0| 3d 20 28 44 49 52 5f 53 | 45 47 46 4c 41 47 7c 44 |= (DIR_S|EGFLAG|D|
|000009f0| 49 52 5f 53 45 45 4e 46 | 4c 41 47 29 20 29 20 7b |IR_SEENF|LAG) ) {|
|00000a00| 0d 09 09 09 6d 69 6e 20 | 3d 20 28 73 65 67 2d 3e |....min |= (seg->|
|00000a10| 6d 69 6e 2d 31 29 3e 3e | 31 3b 0d 09 09 09 6d 61 |min-1)>>|1;....ma|
|00000a20| 78 20 3d 20 28 73 65 67 | 2d 3e 6d 61 78 2b 33 29 |x = (seg|->max+3)|
|00000a30| 3e 3e 31 3b 0d 09 09 0d | 09 09 09 73 77 69 74 63 |>>1;....|...switc|
|00000a40| 68 20 28 73 65 67 2d 3e | 64 69 72 26 33 29 20 7b |h (seg->|dir&3) {|
|00000a50| 0d 09 09 09 63 61 73 65 | 20 64 69 5f 6e 6f 72 74 |....case| di_nort|
|00000a60| 68 3a 0d 09 09 09 09 78 | 20 3d 20 28 73 65 67 2d |h:.....x| = (seg-|
|00000a70| 3e 70 6c 61 6e 65 2d 31 | 29 3e 3e 31 3b 0d 09 09 |>plane-1|)>>1;...|
|00000a80| 09 09 79 20 3d 20 6d 69 | 6e 3b 0d 09 09 09 09 78 |..y = mi|n;.....x|
|00000a90| 73 74 65 70 20 3d 20 30 | 3b 0d 09 09 09 09 79 73 |step = 0|;.....ys|
|00000aa0| 74 65 70 20 3d 20 31 3b | 0d 09 09 09 09 62 72 65 |tep = 1;|.....bre|
|00000ab0| 61 6b 3b 0d 09 09 09 63 | 61 73 65 20 64 69 5f 73 |ak;....c|ase di_s|
|00000ac0| 6f 75 74 68 3a 0d 09 09 | 09 09 78 20 3d 20 73 65 |outh:...|..x = se|
|00000ad0| 67 2d 3e 70 6c 61 6e 65 | 3e 3e 31 3b 0d 09 09 09 |g->plane|>>1;....|
|00000ae0| 09 79 20 3d 20 6d 69 6e | 3b 0d 09 09 09 09 78 73 |.y = min|;.....xs|
|00000af0| 74 65 70 20 3d 20 30 3b | 0d 09 09 09 09 79 73 74 |tep = 0;|.....yst|
|00000b00| 65 70 20 3d 20 31 3b 0d | 09 09 09 09 62 72 65 61 |ep = 1;.|....brea|
|00000b10| 6b 3b 0d 09 09 09 63 61 | 73 65 20 64 69 5f 65 61 |k;....ca|se di_ea|
|00000b20| 73 74 3a 0d 09 09 09 09 | 79 20 3d 20 28 73 65 67 |st:.....|y = (seg|
|00000b30| 2d 3e 70 6c 61 6e 65 2d | 31 29 3e 3e 31 3b 0d 09 |->plane-|1)>>1;..|
|00000b40| 09 09 09 78 20 3d 20 6d | 69 6e 3b 0d 09 09 09 09 |...x = m|in;.....|
|00000b50| 78 73 74 65 70 20 3d 20 | 31 3b 0d 09 09 09 09 79 |xstep = |1;.....y|
|00000b60| 73 74 65 70 20 3d 20 30 | 3b 0d 09 09 09 09 62 72 |step = 0|;.....br|
|00000b70| 65 61 6b 3b 0d 09 09 09 | 63 61 73 65 20 64 69 5f |eak;....|case di_|
|00000b80| 77 65 73 74 3a 0d 09 09 | 09 09 79 20 3d 20 73 65 |west:...|..y = se|
|00000b90| 67 2d 3e 70 6c 61 6e 65 | 3e 3e 31 3b 0d 09 09 09 |g->plane|>>1;....|
|00000ba0| 09 78 20 3d 20 6d 69 6e | 3b 0d 09 09 09 09 78 73 |.x = min|;.....xs|
|00000bb0| 74 65 70 20 3d 20 31 3b | 0d 09 09 09 09 79 73 74 |tep = 1;|.....yst|
|00000bc0| 65 70 20 3d 20 30 3b 0d | 09 09 09 09 62 72 65 61 |ep = 0;.|....brea|
|00000bd0| 6b 3b 0d 09 09 09 7d 0d | 09 09 0d 09 09 09 66 6f |k;....}.|......fo|
|00000be0| 72 20 28 63 6f 75 6e 74 | 3d 6d 61 78 2d 6d 69 6e |r (count|=max-min|
|00000bf0| 20 3b 20 63 6f 75 6e 74 | 20 3b 20 2d 2d 63 6f 75 | ; count| ; --cou|
|00000c00| 6e 74 2c 78 2b 3d 78 73 | 74 65 70 2c 79 2b 3d 79 |nt,x+=xs|tep,y+=y|
|00000c10| 73 74 65 70 29 20 7b 0d | 09 09 09 09 69 66 20 28 |step) {.|....if (|
|00000c20| 78 20 3c 20 74 78 20 7c | 7c 20 78 20 3e 3d 20 6d |x < tx ||| x >= m|
|00000c30| 61 78 74 78 20 7c 7c 20 | 79 20 3c 20 74 79 20 7c |axtx || |y < ty ||
|00000c40| 7c 20 79 3e 3d 6d 61 78 | 74 79 29 20 7b 0d 09 09 || y>=max|ty) {...|
|00000c50| 09 09 09 63 6f 6e 74 69 | 6e 75 65 3b 0d 09 09 09 |...conti|nue;....|
|00000c60| 09 7d 0d 09 09 09 09 74 | 69 6c 65 20 3d 20 74 69 |.}.....t|ile = ti|
|00000c70| 6c 65 6d 61 70 5b 79 5d | 5b 78 5d 3b 0d 09 09 09 |lemap[y]|[x];....|
|00000c80| 09 69 66 20 28 74 69 6c | 65 20 26 20 54 49 5f 44 |.if (til|e & TI_D|
|00000c90| 4f 4f 52 29 20 7b 0d 09 | 09 09 09 09 74 69 6c 65 |OOR) {..|....tile|
|00000ca0| 20 3d 20 35 39 20 2f 2a | 28 73 65 67 2d 3e 64 69 | = 59 /*|(seg->di|
|00000cb0| 72 26 31 29 20 2b 20 33 | 30 2a 2f 3b 0d 09 09 09 |r&1) + 3|0*/;....|
|00000cc0| 09 7d 20 65 6c 73 65 20 | 69 66 20 28 74 69 6c 65 |.} else |if (tile|
|00000cd0| 20 26 20 54 49 5f 50 55 | 53 48 57 41 4c 4c 29 20 | & TI_PU|SHWALL) |
|00000ce0| 7b 0d 09 09 09 09 09 69 | 66 20 28 53 68 6f 77 50 |{......i|f (ShowP|
|00000cf0| 75 73 68 29 20 7b 0d 09 | 09 09 09 09 09 74 69 6c |ush) {..|.....til|
|00000d00| 65 20 3d 20 36 34 3b 0d | 09 09 09 09 09 7d 20 65 |e = 64;.|.....} e|
|00000d10| 6c 73 65 20 7b 0d 09 09 | 09 09 09 09 74 69 6c 65 |lse {...|....tile|
|00000d20| 20 3d 20 74 65 78 74 75 | 72 65 73 5b 79 5d 5b 78 | = textu|res[y][x|
|00000d30| 5d 3b 0d 09 09 09 09 09 | 7d 0d 09 09 09 09 7d 20 |];......|}.....} |
|00000d40| 65 6c 73 65 20 7b 0d 09 | 09 09 09 09 74 69 6c 65 |else {..|....tile|
|00000d50| 20 3d 20 4d 61 70 50 74 | 72 2d 3e 74 69 6c 65 6d | = MapPt|r->tilem|
|00000d60| 61 70 5b 79 5d 5b 78 5d | 3b 0d 09 09 09 09 09 69 |ap[y][x]|;......i|
|00000d70| 66 20 28 21 20 28 74 69 | 6c 65 26 30 78 38 30 29 |f (! (ti|le&0x80)|
|00000d80| 20 29 20 7b 0d 09 09 09 | 09 09 09 63 6f 6e 74 69 | ) {....|...conti|
|00000d90| 6e 75 65 3b 09 09 2f 2a | 20 6e 6f 74 20 61 20 73 |nue;../*| not a s|
|00000da0| 6f 6c 69 64 20 74 69 6c | 65 2a 2f 0d 09 09 09 09 |olid til|e*/.....|
|00000db0| 09 7d 0d 09 09 09 09 09 | 74 69 6c 65 20 3d 20 74 |.}......|tile = t|
|00000dc0| 65 78 74 75 72 65 73 5b | 79 5d 5b 78 5d 3b 20 0d |extures[|y][x]; .|
|00000dd0| 09 09 09 09 7d 0d 09 09 | 09 09 44 72 61 77 53 6d |....}...|..DrawSm|
|00000de0| 61 6c 6c 28 78 2d 74 78 | 2c 79 2d 74 79 2c 74 69 |all(x-tx|,y-ty,ti|
|00000df0| 6c 65 29 3b 09 2f 2a 20 | 44 72 61 77 20 74 68 65 |le);./* |Draw the|
|00000e00| 20 74 69 6c 65 20 6f 6e | 20 74 68 65 20 73 63 72 | tile on| the scr|
|00000e10| 65 65 6e 20 2a 2f 0d 09 | 09 09 7d 09 0d 09 09 7d |een */..|..}....}|
|00000e20| 0d 09 09 2b 2b 73 65 67 | 3b 09 0d 09 7d 20 77 68 |...++seg|;...} wh|
|00000e30| 69 6c 65 20 28 2b 2b 69 | 3c 4e 6f 64 65 43 6f 75 |ile (++i|<NodeCou|
|00000e40| 6e 74 29 3b 0d 09 78 20 | 3d 20 76 69 65 77 78 3e |nt);..x |= viewx>|
|00000e50| 3e 38 3b 0d 09 79 20 3d | 20 76 69 65 77 79 3e 3e |>8;..y =| viewy>>|
|00000e60| 38 3b 0d 09 69 66 20 28 | 78 20 3e 3d 20 74 78 20 |8;..if (|x >= tx |
|00000e70| 26 26 20 78 20 3c 20 6d | 61 78 74 78 20 26 26 20 |&& x < m|axtx && |
|00000e80| 79 20 3e 3d 20 74 79 20 | 26 26 20 79 3c 6d 61 78 |y >= ty |&& y<max|
|00000e90| 74 79 29 20 7b 0d 09 09 | 44 72 61 77 53 6d 61 6c |ty) {...|DrawSmal|
|00000ea0| 6c 28 78 2d 74 78 2c 79 | 2d 74 79 2c 36 34 29 3b |l(x-tx,y|-ty,64);|
|00000eb0| 09 09 2f 2a 20 44 72 61 | 77 20 42 4a 27 73 20 66 |../* Dra|w BJ's f|
|00000ec0| 61 63 65 20 68 65 72 65 | 20 2a 2f 0d 09 7d 0d 09 |ace here| */..}..|
|00000ed0| 42 6c 61 73 74 53 63 72 | 65 65 6e 28 29 3b 0d 7d |BlastScr|een();.}|
|00000ee0| 0d 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |../*****|********|
|00000ef0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f00| 2a 2a 2a 2a 2a 0d 0d 09 | 49 6e 69 74 20 6d 79 20 |*****...|Init my |
|00000f10| 6d 61 74 68 20 74 61 62 | 6c 65 73 20 66 6f 72 20 |math tab|les for |
|00000f20| 74 68 65 20 63 75 72 72 | 65 6e 74 20 76 69 65 77 |the curr|ent view|
|00000f30| 0d 09 0d 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |...*****|********|
|00000f40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f50| 2a 2a 2a 2a 2a 2f 0d 0d | 23 64 65 66 69 6e 65 09 |*****/..|#define.|
|00000f60| 50 49 09 33 2e 31 34 31 | 35 39 32 36 35 37 0d 0d |PI.3.141|592657..|
|00000f70| 42 6f 6f 6c 65 61 6e 20 | 53 74 61 72 74 75 70 52 |Boolean |StartupR|
|00000f80| 65 6e 64 65 72 69 6e 67 | 28 57 6f 72 64 20 4e 65 |endering|(Word Ne|
|00000f90| 77 53 69 7a 65 29 0d 7b | 0d 23 69 66 64 65 66 20 |wSize).{|.#ifdef |
|00000fa0| 5f 5f 4d 41 43 5f 5f 0d | 09 69 6e 74 09 09 69 3b |__MAC__.|.int..i;|
|00000fb0| 0d 09 57 6f 72 64 20 6d | 69 6e 7a 3b 0d 09 69 6e |..Word m|inz;..in|
|00000fc0| 74 09 09 78 3b 0d 09 66 | 6c 6f 61 74 09 61 2c 20 |t..x;..f|loat.a, |
|00000fd0| 66 76 3b 0d 09 6c 6f 6e | 67 09 74 3b 0d 09 4c 6f |fv;..lon|g.t;..Lo|
|00000fe0| 6e 67 57 6f 72 64 20 66 | 6f 63 61 6c 6c 65 6e 67 |ngWord f|ocalleng|
|00000ff0| 74 68 3b 0d 09 57 6f 72 | 64 20 6a 3b 0d 09 57 6f |th;..Wor|d j;..Wo|
|00001000| 72 64 20 2a 53 63 61 6c | 65 50 74 72 3b 0d 23 65 |rd *Scal|ePtr;.#e|
|00001010| 6e 64 69 66 0d 0d 09 69 | 66 20 28 4e 65 77 53 69 |ndif...i|f (NewSi|
|00001020| 7a 65 20 3d 3d 20 4d 61 | 74 68 53 69 7a 65 29 20 |ze == Ma|thSize) |
|00001030| 7b 09 2f 2a 20 41 6c 72 | 65 61 64 79 20 6c 6f 61 |{./* Alr|eady loa|
|00001040| 64 65 64 3f 20 2a 2f 0d | 09 09 72 65 74 75 72 6e |ded? */.|..return|
|00001050| 20 54 52 55 45 3b 0d 09 | 7d 0d 09 0d 23 69 66 64 | TRUE;..|}...#ifd|
|00001060| 65 66 20 5f 5f 4d 41 43 | 5f 5f 09 09 2f 2a 20 4f |ef __MAC|__../* O|
|00001070| 6e 6c 79 20 74 68 65 20 | 6d 61 63 20 76 65 72 73 |nly the |mac vers|
|00001080| 69 6f 6e 20 77 69 6c 6c | 20 63 61 6c 63 75 6c 61 |ion will| calcula|
|00001090| 74 65 20 74 68 65 20 74 | 61 62 6c 65 73 20 2a 2f |te the t|ables */|
|000010a0| 0d 0d 2f 2a 20 67 65 6e | 65 72 61 74 65 20 73 63 |../* gen|erate sc|
|000010b0| 61 6c 65 61 74 7a 2a 2f | 0d 0d 09 53 63 61 6c 65 |aleatz*/|...Scale|
|000010c0| 50 74 72 20 3d 20 73 63 | 61 6c 65 61 74 7a 70 74 |Ptr = sc|aleatzpt|
|000010d0| 72 3b 0d 09 6d 69 6e 7a | 20 3d 20 50 52 4f 4a 45 |r;..minz| = PROJE|
|000010e0| 43 54 49 4f 4e 53 43 41 | 4c 45 2f 4d 41 58 46 52 |CTIONSCA|LE/MAXFR|
|000010f0| 41 43 3b 09 09 2f 2a 20 | 57 68 61 74 27 73 20 74 |AC;../* |What's t|
|00001100| 68 65 20 6c 61 72 67 65 | 73 74 20 69 6e 64 65 78 |he large|st index|
|00001110| 20 2a 2f 09 09 0d 09 66 | 6f 72 20 28 6a 3d 30 3b | */....f|or (j=0;|
|00001120| 6a 3c 3d 6d 69 6e 7a 3b | 6a 2b 2b 29 20 7b 09 09 |j<=minz;|j++) {..|
|00001130| 09 09 0d 09 09 53 63 61 | 6c 65 50 74 72 5b 6a 5d |.....Sca|lePtr[j]|
|00001140| 20 3d 20 4d 41 58 46 52 | 41 43 3b 09 09 2f 2a 20 | = MAXFR|AC;../* |
|00001150| 46 69 6c 6c 20 69 6e 20 | 74 68 65 20 6f 76 65 72 |Fill in |the over|
|00001160| 66 6c 6f 77 20 61 72 65 | 61 20 28 4e 6f 20 6c 6f |flow are|a (No lo|
|00001170| 6e 67 73 29 20 2a 2f 0d | 09 7d 0d 09 64 6f 20 7b |ngs) */.|.}..do {|
|00001180| 09 09 09 09 09 2f 2a 20 | 43 61 6c 63 75 6c 61 74 |...../* |Calculat|
|00001190| 65 20 74 68 65 20 72 65 | 73 74 20 2a 2f 0d 09 09 |e the re|st */...|
|000011a0| 53 63 61 6c 65 50 74 72 | 5b 6a 5d 20 3d 20 50 52 |ScalePtr|[j] = PR|
|000011b0| 4f 4a 45 43 54 49 4f 4e | 53 43 41 4c 45 2f 6a 3b |OJECTION|SCALE/j;|
|000011c0| 09 2f 2a 20 43 72 65 61 | 74 65 20 77 68 6f 6c 65 |./* Crea|te whole|
|000011d0| 20 6e 75 6d 62 65 72 73 | 20 2a 2f 0d 09 7d 20 77 | numbers| */..} w|
|000011e0| 68 69 6c 65 20 28 2b 2b | 6a 3c 4d 41 58 5a 29 3b |hile (++|j<MAXZ);|
|000011f0| 0d 0d 2f 2a 20 76 69 65 | 77 61 6e 67 6c 65 20 74 |../* vie|wangle t|
|00001200| 61 6e 67 65 6e 74 20 74 | 61 62 6c 65 2a 2f 0d 0d |angent t|able*/..|
|00001210| 09 69 66 20 28 4d 61 74 | 68 53 69 7a 65 3d 3d 2d |.if (Mat|hSize==-|
|00001220| 31 29 20 7b 09 09 2f 2a | 20 4f 6e 6c 79 20 6e 65 |1) {../*| Only ne|
|00001230| 65 64 73 20 74 6f 20 62 | 65 20 64 6f 6e 65 20 6f |eds to b|e done o|
|00001240| 6e 63 65 20 2a 2f 0d 09 | 09 69 20 3d 20 30 3b 0d |nce */..|.i = 0;.|
|00001250| 09 09 64 6f 20 7b 0d 09 | 09 09 61 20 3d 20 28 69 |..do {..|..a = (i|
|00001260| 2d 46 49 4e 45 41 4e 47 | 4c 45 53 2f 34 2b 30 2e |-FINEANG|LES/4+0.|
|00001270| 31 29 2a 50 49 2a 32 2f | 46 49 4e 45 41 4e 47 4c |1)*PI*2/|FINEANGL|
|00001280| 45 53 3b 0d 09 09 09 66 | 76 20 3d 20 32 35 36 2a |ES;....f|v = 256*|
|00001290| 74 61 6e 28 61 29 3b 0d | 09 09 09 69 66 20 28 66 |tan(a);.|...if (f|
|000012a0| 76 3e 30 78 37 66 66 66 | 29 20 7b 0d 09 09 09 09 |v>0x7fff|) {.....|
|000012b0| 74 20 3d 20 30 78 37 66 | 66 66 3b 0d 09 09 09 7d |t = 0x7f|ff;....}|
|000012c0| 20 65 6c 73 65 20 69 66 | 20 28 66 76 3c 2d 30 78 | else if| (fv<-0x|
|000012d0| 37 66 66 66 29 20 7b 0d | 09 09 09 09 74 20 3d 20 |7fff) {.|....t = |
|000012e0| 2d 30 78 37 66 66 66 3b | 0d 09 09 09 7d 20 65 6c |-0x7fff;|....} el|
|000012f0| 73 65 20 7b 0d 09 09 09 | 09 74 20 3d 20 66 76 3b |se {....|.t = fv;|
|00001300| 0d 09 09 09 7d 0d 09 09 | 09 66 69 6e 65 74 61 6e |....}...|.finetan|
|00001310| 67 65 6e 74 5b 69 5d 20 | 3d 20 74 3b 0d 09 09 7d |gent[i] |= t;...}|
|00001320| 20 77 68 69 6c 65 20 28 | 2b 2b 69 3c 46 49 4e 45 | while (|++i<FINE|
|00001330| 41 4e 47 4c 45 53 2f 32 | 29 3b 0d 09 0d 2f 2a 20 |ANGLES/2|);.../* |
|00001340| 66 69 6e 65 73 69 6e 65 | 20 74 61 62 6c 65 2a 2f |finesine| table*/|
|00001350| 0d 09 09 0d 09 09 69 20 | 3d 20 30 3b 0d 09 09 64 |......i |= 0;...d|
|00001360| 6f 20 7b 0d 09 09 09 61 | 20 3d 20 28 69 2b 30 2e |o {....a| = (i+0.|
|00001370| 30 29 2a 50 49 2a 32 2f | 46 49 4e 45 41 4e 47 4c |0)*PI*2/|FINEANGL|
|00001380| 45 53 3b 0d 09 09 09 74 | 20 3d 20 32 35 36 2a 73 |ES;....t| = 256*s|
|00001390| 69 6e 28 61 29 3b 0d 09 | 09 09 69 66 20 28 74 3e |in(a);..|..if (t>|
|000013a0| 32 35 35 29 20 7b 0d 09 | 09 09 09 74 20 3d 20 32 |255) {..|...t = 2|
|000013b0| 35 35 3b 0d 09 09 09 7d | 0d 09 09 09 69 66 20 28 |55;....}|....if (|
|000013c0| 74 3c 31 29 20 7b 0d 09 | 09 09 09 74 20 3d 20 31 |t<1) {..|...t = 1|
|000013d0| 3b 0d 09 09 09 7d 0d 09 | 09 09 66 69 6e 65 73 69 |;....}..|..finesi|
|000013e0| 6e 65 5b 69 5d 20 3d 20 | 74 3b 0d 09 09 7d 20 77 |ne[i] = |t;...} w|
|000013f0| 68 69 6c 65 20 28 2b 2b | 69 3c 46 49 4e 45 41 4e |hile (++|i<FINEAN|
|00001400| 47 4c 45 53 2f 32 29 3b | 0d 09 7d 0d 0d 2f 2a 20 |GLES/2);|..}../* |
|00001410| 75 73 65 20 74 61 6e 67 | 65 6e 74 20 74 61 62 6c |use tang|ent tabl|
|00001420| 65 20 74 6f 20 67 65 6e | 65 72 61 74 65 20 76 69 |e to gen|erate vi|
|00001430| 65 77 61 6e 67 6c 65 74 | 6f 78 2a 2f 0d 0d 09 2f |ewanglet|ox*/.../|
|00001440| 2a 20 63 61 6c 63 20 66 | 6f 63 61 6c 6c 65 6e 67 |* calc f|ocalleng|
|00001450| 74 68 20 73 6f 20 46 49 | 45 4c 44 4f 46 56 49 45 |th so FI|ELDOFVIE|
|00001460| 57 20 61 6e 67 6c 65 73 | 20 63 6f 76 65 72 73 20 |W angles| covers |
|00001470| 53 43 52 45 45 4e 57 49 | 44 54 48 20 2a 2f 0d 0d |SCREENWI|DTH */..|
|00001480| 09 66 6f 63 61 6c 6c 65 | 6e 67 74 68 20 3d 20 28 |.focalle|ngth = (|
|00001490| 53 43 52 45 45 4e 57 49 | 44 54 48 2f 32 29 3c 3c |SCREENWI|DTH/2)<<|
|000014a0| 46 52 41 43 42 49 54 53 | 2f 66 69 6e 65 74 61 6e |FRACBITS|/finetan|
|000014b0| 67 65 6e 74 5b 46 49 4e | 45 41 4e 47 4c 45 53 2f |gent[FIN|EANGLES/|
|000014c0| 34 2b 46 49 45 4c 44 4f | 46 56 49 45 57 2f 32 5d |4+FIELDO|FVIEW/2]|
|000014d0| 3b 0d 09 69 20 3d 20 30 | 3b 0d 09 64 6f 20 7b 0d |;..i = 0|;..do {.|
|000014e0| 09 09 74 20 3d 20 28 28 | 6c 6f 6e 67 29 20 66 69 |..t = ((|long) fi|
|000014f0| 6e 65 74 61 6e 67 65 6e | 74 5b 69 5d 2a 28 6c 6f |netangen|t[i]*(lo|
|00001500| 6e 67 29 66 6f 63 61 6c | 6c 65 6e 67 74 68 29 3e |ng)focal|length)>|
|00001510| 3e 46 52 41 43 42 49 54 | 53 3b 0d 09 09 74 20 3d |>FRACBIT|S;...t =|
|00001520| 20 28 69 6e 74 29 53 43 | 52 45 45 4e 57 49 44 54 | (int)SC|REENWIDT|
|00001530| 48 2f 32 20 2d 20 74 3b | 0d 09 09 69 66 20 28 74 |H/2 - t;|...if (t|
|00001540| 20 3c 20 2d 31 29 20 7b | 0d 09 09 09 74 20 3d 20 | < -1) {|....t = |
|00001550| 2d 31 3b 0d 09 09 7d 20 | 65 6c 73 65 20 69 66 20 |-1;...} |else if |
|00001560| 28 74 3e 28 69 6e 74 29 | 53 43 52 45 45 4e 57 49 |(t>(int)|SCREENWI|
|00001570| 44 54 48 2b 31 29 20 7b | 0d 09 09 09 74 20 3d 20 |DTH+1) {|....t = |
|00001580| 53 43 52 45 45 4e 57 49 | 44 54 48 2b 31 3b 0d 09 |SCREENWI|DTH+1;..|
|00001590| 09 7d 0d 09 09 76 69 65 | 77 61 6e 67 6c 65 74 6f |.}...vie|wangleto|
|000015a0| 78 5b 69 5d 20 3d 20 74 | 3b 0d 09 7d 20 77 68 69 |x[i] = t|;..} whi|
|000015b0| 6c 65 20 28 2b 2b 69 3c | 46 49 4e 45 41 4e 47 4c |le (++i<|FINEANGL|
|000015c0| 45 53 2f 32 29 3b 0d 0d | 2f 2a 20 73 63 61 6e 20 |ES/2);..|/* scan |
|000015d0| 76 69 65 77 61 6e 67 6c | 65 74 6f 78 5b 5d 20 74 |viewangl|etox[] t|
|000015e0| 6f 20 67 65 6e 65 72 61 | 74 65 20 78 74 6f 76 69 |o genera|te xtovi|
|000015f0| 65 77 61 6e 67 6c 65 5b | 5d 2a 2f 0d 0d 09 78 20 |ewangle[|]*/...x |
|00001600| 3d 20 30 3b 0d 09 64 6f | 20 7b 0d 09 09 69 20 3d |= 0;..do| {...i =|
|00001610| 20 30 3b 0d 09 09 77 68 | 69 6c 65 20 28 76 69 65 | 0;...wh|ile (vie|
|00001620| 77 61 6e 67 6c 65 74 6f | 78 5b 69 5d 3e 3d 78 29 |wangleto|x[i]>=x)|
|00001630| 20 7b 0d 09 09 09 69 2b | 2b 3b 0d 09 09 7d 0d 09 | {....i+|+;...}..|
|00001640| 09 78 74 6f 76 69 65 77 | 61 6e 67 6c 65 5b 78 5d |.xtoview|angle[x]|
|00001650| 20 3d 20 69 2d 46 49 4e | 45 41 4e 47 4c 45 53 2f | = i-FIN|EANGLES/|
|00001660| 34 2d 31 3b 0d 09 7d 20 | 77 68 69 6c 65 20 28 2b |4-1;..} |while (+|
|00001670| 2b 78 3c 3d 53 43 52 45 | 45 4e 57 49 44 54 48 29 |+x<=SCRE|ENWIDTH)|
|00001680| 3b 0d 0d 2f 2a 20 74 61 | 6b 65 20 6f 75 74 20 74 |;../* ta|ke out t|
|00001690| 68 65 20 66 65 6e 63 65 | 70 6f 73 74 20 63 61 73 |he fence|post cas|
|000016a0| 65 73 20 66 72 6f 6d 20 | 76 69 65 77 61 6e 67 6c |es from |viewangl|
|000016b0| 65 74 6f 78 2a 2f 0d 0d | 09 66 6f 72 20 28 69 3d |etox*/..|.for (i=|
|000016c0| 30 20 3b 20 69 3c 46 49 | 4e 45 41 4e 47 4c 45 53 |0 ; i<FI|NEANGLES|
|000016d0| 2f 32 20 3b 20 69 2b 2b | 29 20 7b 0d 09 09 74 20 |/2 ; i++|) {...t |
|000016e0| 3d 20 53 55 46 69 78 65 | 64 4d 75 6c 20 28 66 69 |= SUFixe|dMul (fi|
|000016f0| 6e 65 74 61 6e 67 65 6e | 74 5b 69 5d 2c 20 66 6f |netangen|t[i], fo|
|00001700| 63 61 6c 6c 65 6e 67 74 | 68 29 3b 0d 09 09 74 20 |callengt|h);...t |
|00001710| 3d 20 28 69 6e 74 29 53 | 43 52 45 45 4e 57 49 44 |= (int)S|CREENWID|
|00001720| 54 48 2f 32 20 2d 20 74 | 3b 0d 09 09 69 66 20 28 |TH/2 - t|;...if (|
|00001730| 76 69 65 77 61 6e 67 6c | 65 74 6f 78 5b 69 5d 20 |viewangl|etox[i] |
|00001740| 3d 3d 20 2d 31 29 20 7b | 0d 09 09 09 76 69 65 77 |== -1) {|....view|
|00001750| 61 6e 67 6c 65 74 6f 78 | 5b 69 5d 20 3d 20 30 3b |angletox|[i] = 0;|
|00001760| 0d 09 09 7d 20 65 6c 73 | 65 20 69 66 20 28 76 69 |...} els|e if (vi|
|00001770| 65 77 61 6e 67 6c 65 74 | 6f 78 5b 69 5d 20 3d 3d |ewanglet|ox[i] ==|
|00001780| 20 53 43 52 45 45 4e 57 | 49 44 54 48 2b 31 29 20 | SCREENW|IDTH+1) |
|00001790| 7b 0d 09 09 09 76 69 65 | 77 61 6e 67 6c 65 74 6f |{....vie|wangleto|
|000017a0| 78 5b 69 5d 20 3d 20 53 | 43 52 45 45 4e 57 49 44 |x[i] = S|CREENWID|
|000017b0| 54 48 3b 0d 09 09 7d 0d | 09 7d 0d 09 0d 23 69 66 |TH;...}.|.}...#if|
|000017c0| 20 30 09 09 2f 2a 20 53 | 68 6f 75 6c 64 20 49 20 | 0../* S|hould I |
|000017d0| 73 61 76 65 20 74 68 65 | 73 65 20 74 61 62 6c 65 |save the|se table|
|000017e0| 73 3f 20 2a 2f 0d 69 66 | 20 28 21 4e 65 77 53 69 |s? */.if| (!NewSi|
|000017f0| 7a 65 29 20 7b 0d 53 61 | 76 65 4a 75 6e 6b 28 73 |ze) {.Sa|veJunk(s|
|00001800| 63 61 6c 65 61 74 7a 70 | 74 72 2c 73 69 7a 65 6f |caleatzp|tr,sizeo|
|00001810| 66 28 57 6f 72 64 29 2a | 4d 41 58 5a 29 3b 0d 53 |f(Word)*|MAXZ);.S|
|00001820| 61 76 65 4a 75 6e 6b 28 | 66 69 6e 65 74 61 6e 67 |aveJunk(|finetang|
|00001830| 65 6e 74 2c 73 69 7a 65 | 6f 66 28 73 68 6f 72 74 |ent,size|of(short|
|00001840| 29 2a 46 49 4e 45 41 4e | 47 4c 45 53 2f 32 29 3b |)*FINEAN|GLES/2);|
|00001850| 0d 53 61 76 65 4a 75 6e | 6b 28 66 69 6e 65 73 69 |.SaveJun|k(finesi|
|00001860| 6e 65 2c 73 69 7a 65 6f | 66 28 73 68 6f 72 74 29 |ne,sizeo|f(short)|
|00001870| 2a 46 49 4e 45 41 4e 47 | 4c 45 53 2f 32 29 3b 0d |*FINEANG|LES/2);.|
|00001880| 53 61 76 65 4a 75 6e 6b | 28 76 69 65 77 61 6e 67 |SaveJunk|(viewang|
|00001890| 6c 65 74 6f 78 2c 73 69 | 7a 65 6f 66 28 73 68 6f |letox,si|zeof(sho|
|000018a0| 72 74 29 2a 46 49 4e 45 | 41 4e 47 4c 45 53 2f 32 |rt)*FINE|ANGLES/2|
|000018b0| 29 3b 0d 53 61 76 65 4a | 75 6e 6b 28 78 74 6f 76 |);.SaveJ|unk(xtov|
|000018c0| 69 65 77 61 6e 67 6c 65 | 2c 73 69 7a 65 6f 66 28 |iewangle|,sizeof(|
|000018d0| 73 68 6f 72 74 29 2a 28 | 53 43 52 45 45 4e 57 49 |short)*(|SCREENWI|
|000018e0| 44 54 48 2b 31 29 29 3b | 0d 47 6f 6f 64 42 79 65 |DTH+1));|.GoodBye|
|000018f0| 28 29 3b 0d 7d 0d 23 65 | 6e 64 69 66 0d 09 0d 23 |();.}.#e|ndif...#|
|00001900| 65 6c 73 65 0d 2f 2a 20 | 41 6c 6c 20 6f 74 68 65 |else./* |All othe|
|00001910| 72 20 76 65 72 73 69 6f | 6e 73 20 6c 6f 61 64 20 |r versio|ns load |
|00001920| 74 68 65 20 74 61 62 6c | 65 73 20 66 72 6f 6d 20 |the tabl|es from |
|00001930| 64 69 73 6b 20 28 4d 55 | 43 48 20 46 41 53 54 45 |disk (MU|CH FASTE|
|00001940| 52 21 21 29 20 2a 2f 0d | 09 69 66 20 28 4d 61 74 |R!!) */.|.if (Mat|
|00001950| 68 53 69 7a 65 3d 3d 2d | 31 29 20 7b 0d 09 09 66 |hSize==-|1) {...f|
|00001960| 69 6e 65 74 61 6e 67 65 | 6e 74 20 3d 20 4c 6f 61 |inetange|nt = Loa|
|00001970| 64 41 52 65 73 6f 75 72 | 63 65 28 72 46 69 6e 65 |dAResour|ce(rFine|
|00001980| 54 61 6e 67 65 6e 74 29 | 3b 0d 09 09 66 69 6e 65 |Tangent)|;...fine|
|00001990| 73 69 6e 65 20 3d 20 4c | 6f 61 64 41 52 65 73 6f |sine = L|oadAReso|
|000019a0| 75 72 63 65 28 72 46 69 | 6e 65 53 69 6e 65 29 3b |urce(rFi|neSine);|
|000019b0| 0d 09 7d 0d 09 73 63 61 | 6c 65 61 74 7a 70 74 72 |..}..sca|leatzptr|
|000019c0| 20 3d 20 4c 6f 61 64 41 | 52 65 73 6f 75 72 63 65 | = LoadA|Resource|
|000019d0| 28 72 53 63 61 6c 65 41 | 74 5a 29 3b 0d 09 76 69 |(rScaleA|tZ);..vi|
|000019e0| 65 77 61 6e 67 6c 65 74 | 6f 78 20 3d 20 4c 6f 61 |ewanglet|ox = Loa|
|000019f0| 64 41 52 65 73 6f 75 72 | 63 65 28 72 56 69 65 77 |dAResour|ce(rView|
|00001a00| 41 6e 67 6c 65 54 6f 58 | 29 3b 0d 09 78 74 6f 76 |AngleToX|);..xtov|
|00001a10| 69 65 77 61 6e 67 6c 65 | 20 3d 20 4c 6f 61 64 41 |iewangle| = LoadA|
|00001a20| 52 65 73 6f 75 72 63 65 | 28 72 58 54 6f 56 69 65 |Resource|(rXToVie|
|00001a30| 77 41 6e 67 6c 65 29 3b | 0d 23 65 6e 64 69 66 0d |wAngle);|.#endif.|
|00001a40| 0d 09 63 6c 69 70 73 68 | 6f 72 74 61 6e 67 6c 65 |..clipsh|ortangle|
|00001a50| 20 3d 20 78 74 6f 76 69 | 65 77 61 6e 67 6c 65 5b | = xtovi|ewangle[|
|00001a60| 30 5d 3c 3c 41 4e 47 4c | 45 54 4f 46 49 4e 45 53 |0]<<ANGL|ETOFINES|
|00001a70| 48 49 46 54 3b 09 2f 2a | 20 53 61 76 65 20 6c 65 |HIFT;./*| Save le|
|00001a80| 66 74 6d 6f 73 74 20 61 | 6e 67 6c 65 20 66 6f 72 |ftmost a|ngle for|
|00001a90| 20 76 69 65 77 20 2a 2f | 0d 09 63 6c 69 70 73 68 | view */|..clipsh|
|00001aa0| 6f 72 74 61 6e 67 6c 65 | 32 20 3d 20 63 6c 69 70 |ortangle|2 = clip|
|00001ab0| 73 68 6f 72 74 61 6e 67 | 6c 65 2a 32 3b 09 09 09 |shortang|le*2;...|
|00001ac0| 09 09 2f 2a 20 44 6f 75 | 62 6c 65 20 74 68 65 20 |../* Dou|ble the |
|00001ad0| 61 6e 67 6c 65 20 66 6f | 72 20 63 6f 6e 73 74 61 |angle fo|r consta|
|00001ae0| 6e 74 20 2a 2f 0d 09 0d | 2f 2a 20 74 65 78 74 75 |nt */...|/* textu|
|00001af0| 72 65 73 20 66 6f 72 20 | 64 6f 6f 72 73 20 73 74 |res for |doors st|
|00001b00| 61 79 20 74 68 65 20 73 | 61 6d 65 20 61 63 72 6f |ay the s|ame acro|
|00001b10| 73 73 20 6d 61 70 73 2a | 2f 0d 0d 09 6d 65 6d 73 |ss maps*|/...mems|
|00001b20| 65 74 28 74 65 78 74 75 | 72 65 73 5b 31 32 38 5d |et(textu|res[128]|
|00001b30| 2c 44 4f 4f 52 50 49 43 | 2b 34 2c 4d 41 50 53 49 |,DOORPIC|+4,MAPSI|
|00001b40| 5a 45 29 3b 20 2f 2a 20 | 64 6f 6f 72 20 73 69 64 |ZE); /* |door sid|
|00001b50| 65 2a 2f 0d 09 6d 65 6d | 73 65 74 28 74 65 78 74 |e*/..mem|set(text|
|00001b60| 75 72 65 73 5b 31 32 39 | 5d 2c 44 4f 4f 52 50 49 |ures[129|],DOORPI|
|00001b70| 43 2b 30 2c 4d 41 50 53 | 49 5a 45 29 3b 20 2f 2a |C+0,MAPS|IZE); /*|
|00001b80| 20 72 65 67 75 6c 61 72 | 20 64 6f 6f 72 2a 2f 0d | regular| door*/.|
|00001b90| 09 6d 65 6d 73 65 74 28 | 74 65 78 74 75 72 65 73 |.memset(|textures|
|00001ba0| 5b 31 33 30 5d 2c 44 4f | 4f 52 50 49 43 2b 31 2c |[130],DO|ORPIC+1,|
|00001bb0| 4d 41 50 53 49 5a 45 29 | 3b 20 2f 2a 20 6c 6f 63 |MAPSIZE)|; /* loc|
|00001bc0| 6b 20 31 2a 2f 0d 09 6d | 65 6d 73 65 74 28 74 65 |k 1*/..m|emset(te|
|00001bd0| 78 74 75 72 65 73 5b 31 | 33 31 5d 2c 44 4f 4f 52 |xtures[1|31],DOOR|
|00001be0| 50 49 43 2b 32 2c 4d 41 | 50 53 49 5a 45 29 3b 20 |PIC+2,MA|PSIZE); |
|00001bf0| 2f 2a 20 6c 6f 63 6b 20 | 32 2a 2f 0d 09 6d 65 6d |/* lock |2*/..mem|
|00001c00| 73 65 74 28 74 65 78 74 | 75 72 65 73 5b 31 33 32 |set(text|ures[132|
|00001c10| 5d 2c 44 4f 4f 52 50 49 | 43 2b 33 2c 4d 41 50 53 |],DOORPI|C+3,MAPS|
|00001c20| 49 5a 45 29 3b 20 2f 2a | 20 65 6c 65 76 61 74 6f |IZE); /*| elevato|
|00001c30| 72 2a 2f 0d 09 52 65 6c | 65 61 73 65 53 63 61 6c |r*/..Rel|easeScal|
|00001c40| 65 72 73 28 29 3b 09 09 | 2f 2a 20 52 65 6c 65 61 |ers();..|/* Relea|
|00001c50| 73 65 20 61 6e 79 20 63 | 6f 6d 70 69 6c 65 64 20 |se any c|ompiled |
|00001c60| 73 63 61 6c 65 72 73 20 | 2a 2f 0d 09 69 66 20 28 |scalers |*/..if (|
|00001c70| 21 53 65 74 75 70 53 63 | 61 6c 65 72 73 28 29 29 |!SetupSc|alers())|
|00001c80| 20 7b 09 09 09 09 2f 2a | 20 52 65 64 6f 20 61 6e | {..../*| Redo an|
|00001c90| 79 20 73 63 61 6c 65 72 | 73 20 2a 2f 0d 09 09 72 |y scaler|s */...r|
|00001ca0| 65 74 75 72 6e 20 46 41 | 4c 53 45 3b 0d 09 7d 0d |eturn FA|LSE;..}.|
|00001cb0| 09 4d 61 74 68 53 69 7a | 65 20 3d 20 4e 65 77 53 |.MathSiz|e = NewS|
|00001cc0| 69 7a 65 3b 0d 09 72 65 | 74 75 72 6e 20 54 52 55 |ize;..re|turn TRU|
|00001cd0| 45 3b 0d 7d 0d 0d 2f 2a | 2a 2a 2a 2a 2a 2a 2a 2a |E;.}../*|********|
|00001ce0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001cf0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0d 0d 09 41 6c 65 72 |********|*...Aler|
|00001d00| 74 20 74 68 65 20 72 65 | 6e 64 65 72 69 6e 67 20 |t the re|ndering |
|00001d10| 65 6e 67 69 6e 65 20 61 | 62 6f 75 74 20 61 20 6e |engine a|bout a n|
|00001d20| 65 77 20 6d 61 70 0d 09 | 0d 2a 2a 2a 2a 2a 2a 2a |ew map..|.*******|
|00001d30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001d40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0d 0d 76 6f |********|***/..vo|
|00001d50| 69 64 20 4e 65 77 4d 61 | 70 28 76 6f 69 64 29 0d |id NewMa|p(void).|
|00001d60| 7b 0d 09 57 6f 72 64 20 | 78 2c 79 2c 20 74 69 6c |{..Word |x,y, til|
|00001d70| 65 3b 0d 09 42 79 74 65 | 20 2a 73 72 63 3b 0d 23 |e;..Byte| *src;.#|
|00001d80| 69 66 64 65 66 20 5f 5f | 42 49 47 45 4e 44 49 41 |ifdef __|BIGENDIA|
|00001d90| 4e 5f 5f 0d 09 73 61 76 | 65 6e 6f 64 65 5f 74 20 |N__..sav|enode_t |
|00001da0| 2a 46 69 78 50 74 72 3b | 0d 23 65 6e 64 69 66 0d |*FixPtr;|.#endif.|
|00001db0| 09 6d 65 6d 73 65 74 28 | 74 65 78 74 75 72 65 73 |.memset(|textures|
|00001dc0| 2c 30 78 66 66 2c 31 32 | 38 2a 36 34 29 3b 09 2f |,0xff,12|8*64);./|
|00001dd0| 2a 20 63 6c 65 61 72 20 | 61 72 72 61 79 20 73 6f |* clear |array so|
|00001de0| 20 70 75 73 68 77 61 6c | 6c 20 73 70 61 77 6e 69 | pushwal|l spawni|
|00001df0| 6e 67 20 63 61 6e 20 69 | 6e 73 65 72 74 2a 2f 0d |ng can i|nsert*/.|
|00001e00| 09 09 09 09 09 09 09 09 | 09 2f 2a 20 74 65 78 74 |........|./* text|
|00001e10| 75 72 65 20 6e 75 6d 62 | 65 72 73 20 69 6e 20 65 |ure numb|ers in e|
|00001e20| 6d 70 74 79 20 73 70 6f | 74 73 2a 2f 0d 09 73 72 |mpty spo|ts*/..sr|
|00001e30| 63 20 3d 20 26 4d 61 70 | 50 74 72 2d 3e 74 69 6c |c = &Map|Ptr->til|
|00001e40| 65 6d 61 70 5b 30 5d 5b | 30 5d 3b 0d 09 79 20 3d |emap[0][|0];..y =|
|00001e50| 20 30 3b 0d 09 64 6f 20 | 7b 0d 09 09 78 20 3d 20 | 0;..do |{...x = |
|00001e60| 30 3b 0d 09 09 64 6f 20 | 7b 0d 09 09 09 74 69 6c |0;...do |{....til|
|00001e70| 65 20 3d 20 2a 73 72 63 | 2b 2b 3b 0d 09 09 09 69 |e = *src|++;....i|
|00001e80| 66 20 28 74 69 6c 65 26 | 54 49 5f 42 4c 4f 43 4b |f (tile&|TI_BLOCK|
|00001e90| 4d 4f 56 45 29 20 7b 09 | 2f 2a 20 62 6c 6f 63 6b |MOVE) {.|/* block|
|00001ea0| 69 6e 67 3f 2a 2f 0d 09 | 09 09 09 74 69 6c 65 20 |ing?*/..|...tile |
|00001eb0| 3d 20 28 28 74 69 6c 65 | 26 30 78 33 66 29 2d 31 |= ((tile|&0x3f)-1|
|00001ec0| 29 2a 32 3b 0d 09 09 09 | 09 74 65 78 74 75 72 65 |)*2;....|.texture|
|00001ed0| 73 5b 4d 41 50 53 49 5a | 45 2b 78 5d 5b 79 5d 20 |s[MAPSIZ|E+x][y] |
|00001ee0| 3d 20 74 69 6c 65 20 2b | 20 31 3b 09 2f 2a 20 55 |= tile +| 1;./* U|
|00001ef0| 73 65 20 74 68 65 20 64 | 61 72 6b 20 73 68 61 70 |se the d|ark shap|
|00001f00| 65 20 2a 2f 0d 09 09 09 | 09 74 65 78 74 75 72 65 |e */....|.texture|
|00001f10| 73 5b 79 5d 5b 78 5d 20 | 3d 20 74 69 6c 65 3b 09 |s[y][x] |= tile;.|
|00001f20| 09 09 2f 2a 20 55 73 65 | 20 74 68 65 20 6c 69 67 |../* Use| the lig|
|00001f30| 68 74 20 73 68 61 70 65 | 20 2a 2f 0d 09 09 09 7d |ht shape| */....}|
|00001f40| 0d 09 09 7d 20 77 68 69 | 6c 65 20 28 2b 2b 78 3c |...} whi|le (++x<|
|00001f50| 4d 41 50 53 49 5a 45 29 | 3b 0d 09 7d 20 77 68 69 |MAPSIZE)|;..} whi|
|00001f60| 6c 65 20 28 2b 2b 79 3c | 4d 41 50 53 49 5a 45 29 |le (++y<|MAPSIZE)|
|00001f70| 3b 0d 09 0d 09 6e 6f 64 | 65 73 20 3d 20 28 73 61 |;....nod|es = (sa|
|00001f80| 76 65 6e 6f 64 65 5f 74 | 20 2a 29 28 28 42 79 74 |venode_t| *)((Byt|
|00001f90| 65 20 2a 29 4d 61 70 50 | 74 72 20 2b 20 4d 61 70 |e *)MapP|tr + Map|
|00001fa0| 50 74 72 2d 3e 6e 6f 64 | 65 6c 69 73 74 6f 66 73 |Ptr->nod|elistofs|
|00001fb0| 29 3b 0d 23 69 66 64 65 | 66 20 5f 5f 42 49 47 45 |);.#ifde|f __BIGE|
|00001fc0| 4e 44 49 41 4e 5f 5f 0d | 09 79 20 3d 20 4d 61 70 |NDIAN__.|.y = Map|
|00001fd0| 50 74 72 2d 3e 6e 75 6d | 6e 6f 64 65 73 3b 0d 09 |Ptr->num|nodes;..|
|00001fe0| 46 69 78 50 74 72 20 3d | 20 6e 6f 64 65 73 3b 0d |FixPtr =| nodes;.|
|00001ff0| 09 77 68 69 6c 65 20 28 | 79 29 20 7b 0d 09 09 46 |.while (|y) {...F|
|00002000| 69 78 50 74 72 2d 3e 63 | 68 69 6c 64 72 65 6e 5b |ixPtr->c|hildren[|
|00002010| 30 5d 20 3d 20 53 77 61 | 70 55 53 68 6f 72 74 28 |0] = Swa|pUShort(|
|00002020| 46 69 78 50 74 72 2d 3e | 63 68 69 6c 64 72 65 6e |FixPtr->|children|
|00002030| 5b 30 5d 29 3b 09 2f 2a | 20 53 77 61 70 20 65 6e |[0]);./*| Swap en|
|00002040| 64 69 61 6e 20 6f 6e 20 | 61 6c 6c 20 6f 66 66 73 |dian on |all offs|
|00002050| 65 74 73 20 2a 2f 0d 09 | 09 46 69 78 50 74 72 2d |ets */..|.FixPtr-|
|00002060| 3e 63 68 69 6c 64 72 65 | 6e 5b 31 5d 20 3d 20 53 |>childre|n[1] = S|
|00002070| 77 61 70 55 53 68 6f 72 | 74 28 46 69 78 50 74 72 |wapUShor|t(FixPtr|
|00002080| 2d 3e 63 68 69 6c 64 72 | 65 6e 5b 31 5d 29 3b 0d |->childr|en[1]);.|
|00002090| 09 09 2b 2b 46 69 78 50 | 74 72 3b 0d 09 09 2d 2d |..++FixP|tr;...--|
|000020a0| 79 3b 0d 09 7d 09 0d 23 | 65 6e 64 69 66 0d 09 70 |y;..}..#|endif..p|
|000020b0| 77 61 6c 6c 73 65 67 20 | 3d 20 30 3b 09 09 2f 2a |wallseg |= 0;../*|
|000020c0| 20 4e 6f 20 70 75 73 68 | 77 61 6c 6c 73 20 69 6e | No push|walls in|
|000020d0| 20 70 72 6f 67 72 65 73 | 73 20 2a 2f 0d 09 0d 7d | progres|s */...}|
|000020e0| 0d 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |../*****|********|
|000020f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002100| 2a 2a 2a 2a 2a 0d 0d 09 | 53 65 74 20 75 70 20 6d |*****...|Set up m|
|00002110| 79 20 70 75 73 68 77 61 | 6c 6c 20 72 65 63 6f 72 |y pushwa|ll recor|
|00002120| 64 20 73 6f 20 74 68 65 | 20 42 53 50 20 72 65 63 |d so the| BSP rec|
|00002130| 6f 72 64 73 20 77 69 6c | 6c 20 66 6f 6c 6c 6f 77 |ords wil|l follow|
|00002140| 0d 09 0d 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |...*****|********|
|00002150| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002160| 2a 2a 2a 2a 2a 2f 0d 0d | 76 6f 69 64 20 53 74 61 |*****/..|void Sta|
|00002170| 72 74 50 75 73 68 57 61 | 6c 6c 28 76 6f 69 64 29 |rtPushWa|ll(void)|
|00002180| 0d 7b 0d 09 57 6f 72 64 | 20 69 3b 0d 09 57 6f 72 |.{..Word| i;..Wor|
|00002190| 64 20 73 65 67 64 69 72 | 2c 73 65 67 70 6c 61 6e |d segdir|,segplan|
|000021a0| 65 2c 73 65 67 6d 69 6e | 3b 0d 09 73 61 76 65 73 |e,segmin|;..saves|
|000021b0| 65 67 5f 74 20 2a 53 61 | 76 65 50 74 72 3b 09 09 |eg_t *Sa|vePtr;..|
|000021c0| 09 09 2f 2a 20 54 65 6d | 70 20 70 6f 69 6e 74 65 |../* Tem|p pointe|
|000021d0| 72 20 2a 2f 0d 0d 09 70 | 77 61 6c 6c 73 65 67 20 |r */...p|wallseg |
|000021e0| 3d 20 30 3b 09 2f 2a 20 | 4e 6f 20 70 75 73 68 77 |= 0;./* |No pushw|
|000021f0| 61 6c 6c 73 20 69 6e 20 | 70 72 6f 67 72 65 73 73 |alls in |progress|
|00002200| 20 2a 2f 0d 09 09 09 0d | 09 73 77 69 74 63 68 20 | */.....|.switch |
|00002210| 28 50 75 73 68 57 61 6c | 6c 52 65 63 2e 70 77 61 |(PushWal|lRec.pwa|
|00002220| 6c 6c 64 69 72 29 20 7b | 09 2f 2a 20 57 68 69 63 |lldir) {|./* Whic|
|00002230| 68 20 64 69 72 65 63 74 | 69 6f 6e 3f 20 2a 2f 0d |h direct|ion? */.|
|00002240| 09 63 61 73 65 20 43 44 | 5f 4e 4f 52 54 48 3a 0d |.case CD|_NORTH:.|
|00002250| 09 09 73 65 67 6d 69 6e | 20 3d 20 50 75 73 68 57 |..segmin| = PushW|
|00002260| 61 6c 6c 52 65 63 2e 70 | 77 61 6c 6c 78 3c 3c 31 |allRec.p|wallx<<1|
|00002270| 3b 09 2f 2a 20 4d 69 6e | 69 6d 75 6d 20 73 65 67 |;./* Min|imum seg|
|00002280| 6d 65 6e 74 20 2a 2f 0d | 09 09 73 65 67 70 6c 61 |ment */.|..segpla|
|00002290| 6e 65 20 3d 20 28 50 75 | 73 68 57 61 6c 6c 52 65 |ne = (Pu|shWallRe|
|000022a0| 63 2e 70 77 61 6c 6c 79 | 2b 31 29 3c 3c 31 3b 09 |c.pwally|+1)<<1;.|
|000022b0| 2f 2a 20 79 20 66 61 63 | 69 6e 67 20 70 6c 61 6e |/* y fac|ing plan|
|000022c0| 65 20 2a 2f 0d 09 09 73 | 65 67 64 69 72 20 3d 20 |e */...s|egdir = |
|000022d0| 64 69 5f 65 61 73 74 3b | 09 2f 2a 20 50 6f 69 6e |di_east;|./* Poin|
|000022e0| 74 20 65 61 73 74 20 2a | 2f 0d 09 09 62 72 65 61 |t east *|/...brea|
|000022f0| 6b 3b 0d 09 63 61 73 65 | 20 43 44 5f 45 41 53 54 |k;..case| CD_EAST|
|00002300| 3a 0d 09 09 73 65 67 70 | 6c 61 6e 65 20 3d 20 50 |:...segp|lane = P|
|00002310| 75 73 68 57 61 6c 6c 52 | 65 63 2e 70 77 61 6c 6c |ushWallR|ec.pwall|
|00002320| 78 3c 3c 31 3b 09 2f 2a | 20 4d 69 6e 69 6d 75 6d |x<<1;./*| Minimum|
|00002330| 20 73 65 67 6d 65 6e 74 | 20 2a 2f 0d 09 09 73 65 | segment| */...se|
|00002340| 67 6d 69 6e 20 3d 20 50 | 75 73 68 57 61 6c 6c 52 |gmin = P|ushWallR|
|00002350| 65 63 2e 70 77 61 6c 6c | 79 3c 3c 31 3b 0d 09 09 |ec.pwall|y<<1;...|
|00002360| 73 65 67 64 69 72 20 3d | 20 64 69 5f 73 6f 75 74 |segdir =| di_sout|
|00002370| 68 3b 09 2f 2a 20 50 6f | 69 6e 74 20 73 6f 75 74 |h;./* Po|int sout|
|00002380| 68 20 2a 2f 0d 09 09 62 | 72 65 61 6b 3b 0d 09 63 |h */...b|reak;..c|
|00002390| 61 73 65 20 43 44 5f 53 | 4f 55 54 48 3a 0d 09 09 |ase CD_S|OUTH:...|
|000023a0| 73 65 67 6d 69 6e 20 3d | 20 50 75 73 68 57 61 6c |segmin =| PushWal|
|000023b0| 6c 52 65 63 2e 70 77 61 | 6c 6c 78 3c 3c 31 3b 0d |lRec.pwa|llx<<1;.|
|000023c0| 09 09 73 65 67 70 6c 61 | 6e 65 20 3d 20 50 75 73 |..segpla|ne = Pus|
|000023d0| 68 57 61 6c 6c 52 65 63 | 2e 70 77 61 6c 6c 79 3c |hWallRec|.pwally<|
|000023e0| 3c 31 3b 0d 09 09 73 65 | 67 64 69 72 20 3d 20 64 |<1;...se|gdir = d|
|000023f0| 69 5f 77 65 73 74 3b 09 | 2f 2a 20 50 6f 69 6e 74 |i_west;.|/* Point|
|00002400| 20 77 65 73 74 20 2a 2f | 0d 09 09 62 72 65 61 6b | west */|...break|
|00002410| 3b 0d 09 63 61 73 65 20 | 43 44 5f 57 45 53 54 3a |;..case |CD_WEST:|
|00002420| 0d 09 09 73 65 67 70 6c | 61 6e 65 20 3d 20 28 50 |...segpl|ane = (P|
|00002430| 75 73 68 57 61 6c 6c 52 | 65 63 2e 70 77 61 6c 6c |ushWallR|ec.pwall|
|00002440| 78 2b 31 29 3c 3c 31 3b | 0d 09 09 73 65 67 6d 69 |x+1)<<1;|...segmi|
|00002450| 6e 20 3d 20 50 75 73 68 | 57 61 6c 6c 52 65 63 2e |n = Push|WallRec.|
|00002460| 70 77 61 6c 6c 79 3c 3c | 31 3b 0d 09 09 73 65 67 |pwally<<|1;...seg|
|00002470| 64 69 72 20 3d 20 64 69 | 5f 6e 6f 72 74 68 3b 09 |dir = di|_north;.|
|00002480| 2f 2a 20 50 6f 69 6e 74 | 20 6e 6f 72 74 68 20 2a |/* Point| north *|
|00002490| 2f 0d 09 7d 0d 09 0d 09 | 53 61 76 65 50 74 72 20 |/..}....|SavePtr |
|000024a0| 3d 20 28 73 61 76 65 73 | 65 67 5f 74 20 2a 29 6e |= (saves|eg_t *)n|
|000024b0| 6f 64 65 73 3b 09 2f 2a | 20 49 6e 69 74 20 70 6f |odes;./*| Init po|
|000024c0| 69 6e 74 65 72 20 74 6f | 20 74 68 65 20 6e 6f 64 |inter to| the nod|
|000024d0| 65 73 20 2a 2f 0d 09 69 | 20 3d 20 4d 61 70 50 74 |es */..i| = MapPt|
|000024e0| 72 2d 3e 6e 75 6d 6e 6f | 64 65 73 3b 09 09 2f 2a |r->numno|des;../*|
|000024f0| 20 47 65 74 20 74 68 65 | 20 6e 6f 64 65 20 63 6f | Get the| node co|
|00002500| 75 6e 74 20 2a 2f 0d 09 | 69 66 20 28 69 29 20 7b |unt */..|if (i) {|
|00002510| 09 09 09 09 2f 2a 20 4d | 61 70 73 20 4d 55 53 54 |..../* M|aps MUST|
|00002520| 20 68 61 76 65 20 6e 6f | 64 65 73 20 2a 2f 0d 09 | have no|des */..|
|00002530| 09 64 6f 20 7b 0d 09 09 | 09 69 66 20 28 28 53 61 |.do {...|.if ((Sa|
|00002540| 76 65 50 74 72 2d 3e 64 | 69 72 20 26 20 44 49 52 |vePtr->d|ir & DIR|
|00002550| 5f 53 45 47 46 4c 41 47 | 29 20 26 26 09 09 2f 2a |_SEGFLAG|) &&../*|
|00002560| 20 53 65 67 6d 65 6e 74 | 65 64 3f 20 2a 2f 0d 09 | Segment|ed? */..|
|00002570| 09 09 09 28 28 53 61 76 | 65 50 74 72 2d 3e 64 69 |...((Sav|ePtr->di|
|00002580| 72 20 26 20 33 29 20 3d | 3d 20 73 65 67 64 69 72 |r & 3) =|= segdir|
|00002590| 29 20 26 26 09 2f 2a 20 | 50 72 6f 70 65 72 20 73 |) &&./* |Proper s|
|000025a0| 69 64 65 3f 20 2a 2f 0d | 09 09 09 09 28 53 61 76 |ide? */.|....(Sav|
|000025b0| 65 50 74 72 2d 3e 70 6c | 61 6e 65 20 3d 3d 20 73 |ePtr->pl|ane == s|
|000025c0| 65 67 70 6c 61 6e 65 29 | 20 26 26 09 09 2f 2a 20 |egplane)| &&../* |
|000025d0| 50 72 6f 70 65 72 20 70 | 6c 61 6e 65 3f 20 2a 2f |Proper p|lane? */|
|000025e0| 0d 09 09 09 09 28 53 61 | 76 65 50 74 72 2d 3e 6d |.....(Sa|vePtr->m|
|000025f0| 69 6e 20 3d 3d 20 73 65 | 67 6d 69 6e 29 20 29 20 |in == se|gmin) ) |
|00002600| 7b 09 09 2f 2a 20 50 72 | 6f 70 65 72 20 73 65 67 |{../* Pr|oper seg|
|00002610| 6d 65 6e 74 20 2a 2f 0d | 09 09 09 09 09 70 77 61 |ment */.|.....pwa|
|00002620| 6c 6c 73 65 67 20 3d 20 | 53 61 76 65 50 74 72 3b |llseg = |SavePtr;|
|00002630| 09 09 09 09 2f 2a 20 53 | 61 76 65 20 74 68 65 20 |..../* S|ave the |
|00002640| 73 65 67 6d 65 6e 74 20 | 2a 2f 0d 09 09 09 09 09 |segment |*/......|
|00002650| 72 65 74 75 72 6e 3b 09 | 09 09 09 09 09 09 2f 2a |return;.|....../*|
|00002660| 20 45 78 69 74 20 2a 2f | 0d 09 09 09 7d 0d 09 09 | Exit */|....}...|
|00002670| 09 2b 2b 53 61 76 65 50 | 74 72 3b 09 09 09 2f 2a |.++SaveP|tr;.../*|
|00002680| 20 4e 65 78 74 20 69 6e | 64 65 78 20 2a 2f 0d 09 | Next in|dex */..|
|00002690| 09 7d 20 77 68 69 6c 65 | 20 28 2d 2d 69 29 3b 09 |.} while| (--i);.|
|000026a0| 09 09 2f 2a 20 43 6f 75 | 6e 74 20 64 6f 77 6e 20 |../* Cou|nt down |
|000026b0| 2a 2f 0d 09 7d 0d 7d 0d | 0d 2f 2a 2a 2a 2a 2a 2a |*/..}.}.|./******|
|000026c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000026d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0d 0d 09 4d |********|****...M|
|000026e0| 61 72 6b 20 61 20 70 75 | 73 68 77 61 6c 6c 20 42 |ark a pu|shwall B|
|000026f0| 53 50 20 73 65 67 6d 65 | 6e 74 20 61 73 20 64 69 |SP segme|nt as di|
|00002700| 73 61 62 6c 65 64 0d 09 | 0d 2a 2a 2a 2a 2a 2a 2a |sabled..|.*******|
|00002710| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002720| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0d 0d 76 6f |********|***/..vo|
|00002730| 69 64 20 41 64 76 61 6e | 63 65 50 75 73 68 57 61 |id Advan|cePushWa|
|00002740| 6c 6c 28 76 6f 69 64 29 | 0d 7b 0d 09 69 66 20 28 |ll(void)|.{..if (|
|00002750| 70 77 61 6c 6c 73 65 67 | 29 20 7b 09 09 2f 2a 20 |pwallseg|) {../* |
|00002760| 46 61 69 6c 73 61 66 65 | 20 2a 2f 0d 09 09 70 77 |Failsafe| */...pw|
|00002770| 61 6c 6c 73 65 67 2d 3e | 64 69 72 20 7c 3d 20 44 |allseg->|dir |= D|
|00002780| 49 52 5f 44 49 53 41 42 | 4c 45 44 46 4c 41 47 3b |IR_DISAB|LEDFLAG;|
|00002790| 09 09 2f 2a 20 4d 61 72 | 6b 20 74 68 65 20 70 75 |../* Mar|k the pu|
|000027a0| 73 68 77 61 6c 6c 20 61 | 73 20 64 69 73 61 62 6c |shwall a|s disabl|
|000027b0| 65 64 20 2a 2f 0d 09 7d | 0d 7d 0d 0d 2f 2a 2a 2a |ed */..}|.}../***|
|000027c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000027d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0d |********|*******.|
|000027e0| 0d 09 52 65 6e 64 65 72 | 20 74 68 65 20 65 6e 74 |..Render| the ent|
|000027f0| 69 72 65 20 33 2d 44 20 | 76 69 65 77 0d 09 0d 2a |ire 3-D |view...*|
|00002800| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002810| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002820| 2a 2f 0d 0d 76 6f 69 64 | 20 52 65 6e 64 65 72 56 |*/..void| RenderV|
|00002830| 69 65 77 28 76 6f 69 64 | 29 0d 7b 0d 0d 09 57 6f |iew(void|).{...Wo|
|00002840| 72 64 20 66 72 61 6d 65 | 3b 0d 09 0d 09 63 65 6e |rd frame|;....cen|
|00002850| 74 65 72 61 6e 67 6c 65 | 20 3d 20 67 61 6d 65 73 |terangle| = games|
|00002860| 74 61 74 65 2e 76 69 65 | 77 61 6e 67 6c 65 3c 3c |tate.vie|wangle<<|
|00002870| 47 41 4d 45 41 4e 47 4c | 45 54 4f 46 49 4e 45 3b |GAMEANGL|ETOFINE;|
|00002880| 09 2f 2a 20 35 31 32 20 | 74 6f 20 32 30 34 38 20 |./* 512 |to 2048 |
|00002890| 2a 2f 0d 09 63 65 6e 74 | 65 72 73 68 6f 72 74 20 |*/..cent|ershort |
|000028a0| 3d 20 63 65 6e 74 65 72 | 61 6e 67 6c 65 3c 3c 41 |= center|angle<<A|
|000028b0| 4e 47 4c 45 54 4f 46 49 | 4e 45 53 48 49 46 54 3b |NGLETOFI|NESHIFT;|
|000028c0| 09 2f 2a 20 32 30 34 38 | 20 74 6f 20 36 34 6b 20 |./* 2048| to 64k |
|000028d0| 2a 2f 0d 09 76 69 65 77 | 73 69 6e 20 3d 20 73 69 |*/..view|sin = si|
|000028e0| 6e 74 61 62 6c 65 5b 67 | 61 6d 65 73 74 61 74 65 |ntable[g|amestate|
|000028f0| 2e 76 69 65 77 61 6e 67 | 6c 65 5d 3b 09 2f 2a 20 |.viewang|le];./* |
|00002900| 47 65 74 20 74 68 65 20 | 62 61 73 69 63 20 73 69 |Get the |basic si|
|00002910| 6e 65 20 2a 2f 0d 09 76 | 69 65 77 63 6f 73 20 3d |ne */..v|iewcos =|
|00002920| 20 63 6f 73 74 61 62 6c | 65 5b 67 61 6d 65 73 74 | costabl|e[gamest|
|00002930| 61 74 65 2e 76 69 65 77 | 61 6e 67 6c 65 5d 3b 09 |ate.view|angle];.|
|00002940| 2f 2a 20 47 65 74 20 74 | 68 65 20 62 61 73 69 63 |/* Get t|he basic|
|00002950| 20 63 6f 73 69 6e 65 20 | 2a 2f 0d 09 6d 65 6d 73 | cosine |*/..mems|
|00002960| 65 74 28 61 72 65 61 76 | 69 73 2c 20 30 2c 20 73 |et(areav|is, 0, s|
|00002970| 69 7a 65 6f 66 28 61 72 | 65 61 76 69 73 29 29 3b |izeof(ar|eavis));|
|00002980| 09 2f 2a 20 4e 6f 20 61 | 72 65 61 73 20 61 72 65 |./* No a|reas are|
|00002990| 20 76 69 73 69 62 6c 65 | 20 2a 2f 0d 09 43 6c 65 | visible| */..Cle|
|000029a0| 61 72 43 6c 69 70 53 65 | 67 73 28 29 3b 09 09 09 |arClipSe|gs();...|
|000029b0| 2f 2a 20 43 6c 69 70 20 | 66 69 72 73 74 20 73 65 |/* Clip |first se|
|000029c0| 67 20 6f 6e 6c 79 20 74 | 6f 20 73 69 64 65 73 20 |g only t|o sides |
|000029d0| 6f 66 20 73 63 72 65 65 | 6e 20 2a 2f 09 0d 09 49 |of scree|n */...I|
|000029e0| 4f 5f 43 6c 65 61 72 56 | 69 65 77 42 75 66 66 65 |O_ClearV|iewBuffe|
|000029f0| 72 28 29 3b 09 09 2f 2a | 20 45 72 61 73 65 20 74 |r();../*| Erase t|
|00002a00| 6f 20 63 65 69 6c 69 6e | 67 20 2f 20 66 6c 6f 6f |o ceilin|g / floo|
|00002a10| 72 20 63 6f 6c 6f 72 73 | 2a 2f 0d 09 0d 09 62 73 |r colors|*/....bs|
|00002a20| 70 63 6f 6f 72 64 5b 42 | 53 50 54 4f 50 5d 20 3d |pcoord[B|SPTOP] =|
|00002a30| 20 30 3b 09 09 2f 2a 20 | 54 68 65 20 6d 61 70 20 | 0;../* |The map |
|00002a40| 69 73 20 36 34 2a 36 34 | 20 2a 2f 0d 09 62 73 70 |is 64*64| */..bsp|
|00002a50| 63 6f 6f 72 64 5b 42 53 | 50 42 4f 54 54 4f 4d 5d |coord[BS|PBOTTOM]|
|00002a60| 20 3d 20 36 34 2a 46 52 | 41 43 55 4e 49 54 3b 0d | = 64*FR|ACUNIT;.|
|00002a70| 09 62 73 70 63 6f 6f 72 | 64 5b 42 53 50 4c 45 46 |.bspcoor|d[BSPLEF|
|00002a80| 54 5d 20 3d 20 30 3b 0d | 09 62 73 70 63 6f 6f 72 |T] = 0;.|.bspcoor|
|00002a90| 64 5b 42 53 50 52 49 47 | 48 54 5d 20 3d 20 36 34 |d[BSPRIG|HT] = 64|
|00002aa0| 2a 46 52 41 43 55 4e 49 | 54 3b 0d 09 0d 09 52 65 |*FRACUNI|T;....Re|
|00002ab0| 6e 64 65 72 42 53 50 4e | 6f 64 65 28 30 29 3b 09 |nderBSPN|ode(0);.|
|00002ac0| 09 2f 2a 20 74 72 61 76 | 65 72 73 65 20 74 68 65 |./* trav|erse the|
|00002ad0| 20 42 53 50 20 74 72 65 | 65 20 66 72 6f 6d 20 74 | BSP tre|e from t|
|00002ae0| 68 65 20 72 6f 6f 74 20 | 2a 2f 0d 09 44 72 61 77 |he root |*/..Draw|
|00002af0| 53 70 72 69 74 65 73 28 | 29 3b 09 09 09 2f 2a 20 |Sprites(|);.../* |
|00002b00| 73 6f 72 74 20 61 6c 6c | 20 74 68 65 20 73 70 72 |sort all| the spr|
|00002b10| 69 74 65 73 20 69 6e 20 | 61 6e 79 20 6f 66 20 74 |ites in |any of t|
|00002b20| 68 65 20 72 65 6e 64 65 | 72 65 64 20 61 72 65 61 |he rende|red area|
|00002b30| 73 2a 2f 0d 09 44 72 61 | 77 54 6f 70 53 70 72 69 |s*/..Dra|wTopSpri|
|00002b40| 74 65 28 29 3b 09 09 2f | 2a 20 64 72 61 77 20 67 |te();../|* draw g|
|00002b50| 61 6d 65 20 6f 76 65 72 | 20 73 70 72 69 74 65 20 |ame over| sprite |
|00002b60| 6f 6e 20 74 6f 70 20 6f | 66 20 65 76 65 72 79 74 |on top o|f everyt|
|00002b70| 68 69 6e 67 2a 2f 0d 09 | 0d 09 69 66 20 28 21 4e |hing*/..|..if (!N|
|00002b80| 6f 57 65 61 70 6f 6e 44 | 72 61 77 29 20 7b 09 2f |oWeaponD|raw) {./|
|00002b90| 2a 20 44 6f 6e 27 74 20 | 64 72 61 77 20 74 68 65 |* Don't |draw the|
|00002ba0| 20 77 65 61 70 6f 6e 3f | 20 2a 2f 0d 09 09 66 72 | weapon?| */...fr|
|00002bb0| 61 6d 65 20 3d 20 67 61 | 6d 65 73 74 61 74 65 2e |ame = ga|mestate.|
|00002bc0| 61 74 74 61 63 6b 66 72 | 61 6d 65 3b 0d 09 09 69 |attackfr|ame;...i|
|00002bd0| 66 20 28 66 72 61 6d 65 | 20 3d 3d 20 34 29 20 7b |f (frame| == 4) {|
|00002be0| 0d 09 09 09 66 72 61 6d | 65 20 3d 20 31 3b 09 09 |....fram|e = 1;..|
|00002bf0| 09 2f 2a 20 64 72 6f 70 | 20 62 61 63 6b 20 66 72 |./* drop| back fr|
|00002c00| 61 6d 65 2a 2f 0d 09 09 | 7d 0d 09 09 49 4f 5f 41 |ame*/...|}...IO_A|
|00002c10| 74 74 61 63 6b 53 68 61 | 70 65 28 67 61 6d 65 73 |ttackSha|pe(games|
|00002c20| 74 61 74 65 2e 77 65 61 | 70 6f 6e 2a 34 20 2b 20 |tate.wea|pon*4 + |
|00002c30| 66 72 61 6d 65 29 3b 09 | 09 2f 2a 20 44 72 61 77 |frame);.|./* Draw|
|00002c40| 20 74 68 65 20 67 75 6e | 20 73 68 61 70 65 20 2a | the gun| shape *|
|00002c50| 2f 0d 09 7d 0d 09 49 4f | 5f 44 69 73 70 6c 61 79 |/..}..IO|_Display|
|00002c60| 56 69 65 77 42 75 66 66 | 65 72 28 29 3b 09 2f 2a |ViewBuff|er();./*|
|00002c70| 20 62 6c 69 74 20 74 6f | 20 73 63 72 65 65 6e 20 | blit to| screen |
|00002c80| 2a 2f 0d 7d 0d 00 00 00 | 00 00 00 00 00 00 00 00 |*/.}....|........|
|00002c90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d00| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00002d10| 65 72 6e 09 75 73 68 6f | 72 74 09 6e 6f 72 6d 61 |ern.usho|rt.norma|
|00002d20| 6c 61 6e 67 6c 65 3b 09 | 09 2f 2a 20 61 6e 67 6c |langle;.|./* angl|
|00002d30| 09 52 65 66 72 65 73 68 | 2e 63 02 00 00 00 54 45 |.Refresh|.c....TE|
|00002d40| 58 54 70 64 6f 73 01 00 | 00 d0 00 00 00 00 00 00 |XTpdos..|........|
|00002d50| 00 00 54 45 58 54 70 64 | 6f 73 01 00 00 d0 00 00 |..TEXTpd|os......|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 a9 61 c9 ba 00 00 | 2c 05 00 00 01 7e 69 6e |...a....|,....~in|
|00002d80| 20 66 69 6e 65 61 6e 67 | 6c 65 73 2a 2f 0d 65 78 | fineang|les*/.ex|
|00002d90| 74 65 72 6e 09 75 73 68 | 6f 72 74 09 63 65 6e 74 |tern.ush|ort.cent|
|00002da0| 65 72 73 68 6f 72 74 3b | 09 09 2f 2a 20 76 69 65 |ershort;|../* vie|
|00002db0| 77 61 6e 67 6c 65 20 69 | 6e 20 36 34 6b 20 61 6e |wangle i|n 64k an|
|00002dc0| 67 6c 65 73 2a 2f 0d 0d | 65 78 74 65 72 6e 09 75 |gles*/..|extern.u|
|00002dd0| 73 68 6f 72 74 09 72 77 | 5f 78 3b 0d 65 78 74 65 |short.rw|_x;.exte|
|00002de0| 72 6e 09 75 73 68 6f 72 | 74 09 72 77 5f 73 74 6f |rn.ushor|t.rw_sto|
|00002df0| 70 78 3b 0d 65 78 74 65 | 72 6e 09 75 73 68 6f 72 |px;.exte|rn.ushor|
|00002e00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e20| 00 00 00 00 00 00 00 03 | 00 04 00 42 00 0b 01 dd |........|...B....|
|00002e30| 02 7e 00 42 00 0b 01 dd | 02 7e aa ca b7 44 00 00 |.~.B....|.~...D..|
|00002e40| 1e d9 00 00 1e d9 00 00 | 1d ad 01 00 00 00 01 00 |........|........|
|00002e50| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 ba db 18 |...L...L|...2....|
|00002e60| 0d 98 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00002e70| 00 0a 03 ed ff ff 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+