How to sineflag

AmigaOS specific forum
xperience2003
Enthusiast
Enthusiast
Posts: 105
Joined: Tue Oct 05, 2004 9:05 pm
Location: germany
Contact:

How to sineflag

Post by xperience2003 »

Image

Code: Select all

;************************************
;*******      SINUSPIC      *********
;************************************
InitScreen(0)
InitBitMap(2)
initpicture(0)
InitPalette(0)
*TagList = InitTagList(40)

AllocateBitMap(1,320,256,4)
AllocateBitMap(0,320,256,4)

ResetTagList(#SA_Type, #CUSTOMSCREEN | #CUSTOMBITMAP)
      AddTag(#SA_Quiet, 1)
      AddTag(#SA_BitMap, BitMapID())
      ;AddTag(#SA_Draggable, 0)
      OpenScreen(0, 320, 256, 4, *TagList)
    
 ;we load the picture
  AllocateBitMap(2,113,135,4)
  LoadPicture(0,"dat/face.iff")
  PictureToBitMap(0, BitMapID()) 
   
  GetPicturePalette(0,PictureID())
  DisplayPalette(0,ScreenID())

  DB=1

  Repeat
    ;VWait() 
    ShowBitMap(DB,ScreenID(),0,0)
   
    DB=1-DB
   
     UseBitMap(DB)
     drawingoutput(bitmaprastport())
     Cls(0)     
     UseBitMap(2)
     For y=0 To 130 Step 5
       sini+1
       If sini>360:sini=0:EndIf
       sinus=PeekL(?sintable+(sini*4))
       CopyBitMap(BitMapID(),0,y,50+sinus/20,y,112,5)
     Next

    mb.w=mouseButtons()
  Until mb.w=2
  
  End

DisableDebugger
sintable:
IncludeBinary "dat/sintable"
EnableDebugger
files and sources here
download 10kb