home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / spritegen / MkSolid (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1992-09-28  |  2.0 KB  |  63 lines

  1.   >MkSolid
  2.      auxillary library file for "MakeSpGen"
  3.      creates "rotating buckets"
  4.      (lots of "same" words ie highly optimisable)
  5.  *********************************************************************
  6.         These are constants
  7. _Define_Constants
  8.  i, r%, g%, b%
  9. B  Usage$ = "[-Side <r>] [-NSpoke <n>] [-Colours <rrGGbb:...>]"
  10. &  Param$ = "Side,NSpoke/e,Colours"
  11. E  Side     = 0.6                        :
  12.   (0, 1) of each square
  13. K  NSpoke   = 3                          :
  14.   positive integer, number of
  15. '  Colours$ = "ffFFff:ddBB22:228833"
  16.  Col%(255/7)
  17.  *********************************************************************
  18. "        Parse the command line
  19. _Params(b%)
  20. getr(Side,     b%!0)
  21. geti(NSpoke,   b%!4)
  22. getz(Colours$, b%!8)
  23. _Read_Colours(Colours$, Col%(), NSpoke)
  24.  *********************************************************************
  25. !        The mode has been set
  26. _Define_Palette
  27.  19, &0, 16, &00, &00, &00  :
  28.  palette
  29.  19, &1, 16, &00, &ff, &00
  30.  19, &2, 16, &ee, &00, &00
  31.  19, &3, 16, &ff, &bb, &44
  32.  19, &4, 16, &ee, &ee, &00
  33.  19, &5, 16, &bb, &88, &55
  34.  19, &6, 16, &aa, &44, &bb
  35.  19, &7, 16, &44, &ff, &00
  36.  19, &8, 16, &66, &dd, &ff
  37.  19, &9, 16, &44, &33, &bb
  38.  19, &a, 16, &77, &77, &77
  39.  19, &b, 16, &bb, &ff, &dd
  40.  19, &c, 16, &11, &11, &dd
  41.  19, &d, 16, &ff, &99, &44
  42.  19, &e, 16, &ff, &ff, &ff
  43.  19, &f, 16, &ee, &ee, &ee
  44.  *********************************************************************
  45.      f = (0, 1]
  46. 6.        xc, yc = OS co-ordinates of center
  47. _Draw_Frame(f, xc, yc)
  48.  f2, r, s, x, y, t, dx, dy
  49.  spoke%
  50.   r = RMax * Side
  51.   s = RMax - r
  52.  spoke%= 0 
  53.  NSpoke-1
  54. >9    
  55.  "ColourTrans_SetGCOL", Col%(spoke%),,, &100, 0
  56. ?-    x = xc + r*
  57. *(f + spoke%/NSpoke))
  58. @-    y = yc + r*
  59. *(f + spoke%/NSpoke))
  60. A0    
  61.  x-s+0.5, y-s+0.5, s*2+0.5, s*2+0.5
  62.  spoke%
  63.