home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 42 / af042b.adf / Extras.lha / IFF_Brush_To_Sprite.AMOS / IFF_Brush_To_Sprite.amosSourceCode
AMOS Source Code  |  1992-02-21  |  967b  |  29 lines

  1. '                      IFF Brush To Sprite Maker 
  2. '
  3. '                            By P.J.Hickman
  4. '
  5. '    See below for brushes that have less or more than 16 colours
  6. '
  7. Default : Erase 1 : Show On 
  8. FILE$=Fsel$("*.*","","Pick brush to convert")
  9. If FILE$<>""
  10. Hide On 
  11. ' ~~~~~ Get file info ~~~~~
  12. Open In 1,FILE$ : L=Lof(1) : Close 1 : Erase 6
  13. Reserve As Data 6,L : Bload FILE$,Start(6)
  14. BWIDTH=Deek(Start(6)+20) : BHEIGHT=Deek(Start(6)+22) : SWIDTH=Deek(Start(6)+36) : SHEIGHT=Deek(Start(6)+38)
  15. ' Brushes can be resolution independant, eg. it can be either hi or
  16. ' lo res. For this reason you must set your own res (and number of 
  17. ' colours) in the next line. 
  18. Screen Open 0,SWIDTH,SHEIGHT,16,Lowres
  19. Flash Off : Cls 0 : Load Iff FILE$ : Get Bob 1,0,0 To BWIDTH+1,BHEIGHT+1
  20. Show On : FILE$=Fsel$("*.ABK","","Please type Save name For bank") : Hide On 
  21. If FILE$<>""
  22.    If Right$(Upper$(F$),4)<>".ABK"
  23.       F$=F$+".Abk"
  24.    End If 
  25.    Save FILE$,1
  26. End If 
  27. End If 
  28. Default 
  29. End