home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 601-625 / apd602 / cubic.amos / cubic.amosSourceCode < prev   
AMOS Source Code  |  1993-02-25  |  3KB  |  69 lines

  1. '
  2. '      it don't work!!!!!!!!!!!! 
  3. '
  4.                   '*********************************** 
  5.                   '*  Depth sort Pre-calc routine... * 
  6.                   '*     (c) Shockwave / Cubic.      * 
  7.                   '*********************************** 
  8.  
  9.  
  10.          Screen Open 0,320,250,4,Lowres
  11.                Curs Off 
  12.                      Flash Off 
  13.                   Cls 0
  14. '
  15.                Palette $2,$F00,$F0,$F,$FFF,$FF0,$FF
  16. '
  17.                Double Buffer 
  18.                Autoback 0
  19. Erase 8
  20.                   Reserve As Chip Data 8,9000
  21. '
  22. '                  Load "df1:cube2.abk",6
  23. '                 Load "df1:cube2z.abk",7
  24. '
  25.                   ST=Start(6)
  26.                   BT=Start(7)
  27.                   ZT=Start(8)
  28. '
  29.                   Dim _ORDER(6)
  30.                   Paper 0
  31. Do 
  32. '
  33.          _ORDER(0)=(Peek(BT)+Peek(BT+1)+Peek(BT+2)+Peek(BT+3))
  34.          _ORDER(1)=(Peek(BT+5)+Peek(BT+6)+Peek(BT+7)+Peek(BT+8))
  35.          _ORDER(2)=(Peek(BT)+Peek(BT+5)+Peek(BT+8)+Peek(BT+4))
  36.          _ORDER(3)=(Peek(BT+1)+Peek(BT+2)+Peek(BT+7)+Peek(BT+6))
  37.          _ORDER(4)=(Peek(BT)+Peek(BT+5)+Peek(BT+6)+Peek(BT+1))
  38.          _ORDER(5)=(Peek(BT+3)+Peek(BT+4)+Peek(BT+8)+Peek(BT+7))
  39. '
  40.          For A=0 To 5
  41. '
  42.             CNT=0
  43. '
  44.                For B=0 To 5
  45.                   If(_ORDER(B)>_ORDER(A)) Then Inc CNT
  46. '
  47.                Next B
  48.                Poke ZT+A,CNT
  49. '
  50.          Next A
  51. '
  52. For M=1 To 6
  53.          If Peek(ZT)=M Then Ink 1 : Polygon Peek(ST),Peek(ST+1) To Peek(ST+2),Peek(ST+3) To Peek(ST+4),Peek(ST+5) To Peek(ST+6),Peek(ST+7) To Peek(ST),Peek(ST+1)
  54.          If Peek(ZT+1)=M Then Ink 2 : Polygon Peek(ST+8),Peek(ST+9) To Peek(ST+10),Peek(ST+11) To Peek(ST+12),Peek(ST+13) To Peek(ST+14),Peek(ST+15) To Peek(ST+8),Peek(ST+9)
  55.          If Peek(ZT+2)=M Then Ink 3 : Polygon Peek(ST),Peek(ST+1) To Peek(ST+8),Peek(ST+9) To Peek(ST+14),Peek(ST+15) To Peek(ST+6),Peek(ST+7) To Peek(ST),Peek(ST+1)
  56.          If Peek(ZT+3)=M Then Ink 3 : Polygon Peek(ST+2),Peek(ST+3) To Peek(ST+4),Peek(ST+5) To Peek(ST+12),Peek(ST+13) To Peek(ST+10),Peek(ST+11) To Peek(ST+2),Peek(ST+3)
  57.          If Peek(ZT+4)=M Then Ink 2 : Polygon Peek(ST),Peek(ST+1) To Peek(ST+8),Peek(ST+9) To Peek(ST+10),Peek(ST+11) To Peek(ST+2),Peek(ST+3) To Peek(ST),Peek(ST+1)
  58.          If Peek(ZT+5)=M Then Ink 1 : Polygon Peek(ST+4),Peek(ST+5) To Peek(ST+6),Peek(ST+7) To Peek(ST+14),Peek(ST+15) To Peek(ST+12),Peek(ST+13) To Peek(ST+4),Peek(ST+5)
  59. Next M
  60. '
  61.          Add ST,16
  62.          Add BT,8
  63.          Add ZT,6
  64. '
  65.          Screen Swap 
  66.          Wait Vbl 
  67.          Cls 0
  68. '
  69. Loop