home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / pictures / flick2 / FLICK.OPL < prev    next >
Text File  |  1992-05-25  |  1KB  |  81 lines

  1. APP Flick
  2.   type 1
  3.   icon "\opd\view"
  4. ENDA
  5.  
  6. PROC start:
  7. GLOBAL c%,w$(128),p$(128),dum%,off%(6)
  8. GLOBAL w1%,w2%,x%,y%,w%,h%,t%,f%,d%
  9.   REM Dont keep S3 awake!
  10.   Call ($138b,0,0,0,0,0)
  11.   w$="\pic\*01.PIC"
  12.   dINIT "Flick Animations"
  13.   dFILE w$,"1st Frame:",3
  14.   d%=DIALOG
  15.   if d%<>0
  16.     w$=left$(w$,len(w$)-6)
  17.     f%=fframes%:(w$)
  18.     if f%>1
  19.       Init:(w$)
  20.       do
  21.         c%=0
  22.         do
  23.           c%=c%+1
  24.           s:(c%)
  25.         until c%=f%
  26.         do
  27.           c%=c%-1
  28.           s:(c%)
  29.         until c%=1
  30.       until 0
  31.     endif
  32.   endif
  33. ENDP
  34.  
  35. PROC s:(a%)
  36. LOCAL bi%
  37.   t%=w1% : w1%=w2% : w2%=t%
  38.   bi%=gLOADBIT(w$+num$:(a%,2))
  39.   gORDER w2%,1
  40.   gUSE w1%
  41.   gAT 0,0
  42.   gPATT bi%,w%,h%,3
  43.   gCLOSE bi%
  44. ENDP
  45.  
  46. PROC init:(t2$)
  47. LOCAL bit%
  48.   REM t$=PIC to load
  49.   REM Centre Window, Ret Window Id.
  50.   bit%=gLOADBIT(t2$+"01.PIC")
  51.   gUSE bit%
  52.   w%=gWIDTH
  53.   h%=gHEIGHT
  54.   gCLOSE bit%
  55.   x%=(240-w%)/2.0
  56.   y%=(80-h%)/2.0
  57.   w1%=gCREATE(x%,y%,w%,h%,1)
  58.   w2%=gCREATE(x%,y%,w%,h%,1)
  59. ENDP
  60.  
  61. PROC fframes%:(z$)
  62. LOCAL t%,s$(30)
  63.   t%=0
  64.   do
  65.     t%=t%+1
  66.   until (NOT EXIST(z$+num$:(t%,2)+".PIC")) or (t%=99)
  67.   t%=t%-1
  68.   s$=num$(t%,3)+" frames found"
  69.   GIPRINT s$,0
  70.   pause 10
  71.   cls
  72.   RETURN t%
  73. ENDP
  74.  
  75. PROC num$:(a%,b%)
  76. LOCAL z$(4)
  77.   z$=num$(a%,b%)
  78.   z$=left$("0",2-len(z$))+z$
  79. RETURN z$
  80. ENDP
  81.