home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Pogo Slideshow program
- ;
- ; This program demonstrates Pogo's screen and blit functions.
- ;
- ; To run it, substitute the filenames for names of picture files in the
- ; same directory as SLIDESHO.POG and POGO.TTP. Remember, Pogo accepts
- ; PI1, PC1 or NEO pictures.
-
- int ps,bs
-
- string fname
-
- constant wx = 30
- constant wy = 20
-
- to wblit(x,y)
- {
- int px1,py1 ;pixel offsets
- int px2,py2
-
- px1 = x*320/wx
- px2 = (x+1)*320/wx
- py1 = y*200/wy
- py2 = (y+1)*200/wy
- blit(px2-px1,py2-py1,bs,px1,py1,ps,px1,py1)
- }
-
-
- to wipe()
- {
- constant wsize = wx*wy
- int used[wsize]
- int x,y,w
- int gotit
- int i,j
-
- for i = 0 to wsize-1
- used[i] = 0
- for i = 0 to wsize-1
- {
- gotit = 0
- for j = 1 to 200
- {
- w = random(wsize)
- if (!used[w])
- {
- gotit = 1
- used[w] = 1
- ;if (j%(wsize/8) == 0)
- ;Vsync()
- x = w%wx
- y = w/wx
- wblit(x,y)
- break
- }
- }
- if (!gotit)
- break;
- }
- copyscreen(bs,ps)
- }
-
- to wipe1()
- {
- int j;
-
- UseScreen(bs)
- if (!LoadPic(fname))
- {
- prints("Couldn't load " + fname)
- return
- }
- ;CopyColors(bs,ps) ;do colors first
- Wipe()
- for j = 1 to 60
- Vsync()
- ClearScreen()
- UseScreen(ps)
- Wipe()
- }
-
- to main()
- {
- int i,j
-
- ClearScreen()
- bs = AllocScreen()
- ps = Pscreen()
- if (bs == 0)
- {
- prints("Couldn't alloc screen")
- return
- }
- ;
- ; Note: substitute filenames here.
- ;
-
- fname = "bluemist.pc1";
- wipe1()
- fname = "tut.pc1";
- wipe1()
- fname = "whatisit.pc1"
- wipe1()
- FreeScreen(bs)
- }
-
- int k
-
- ToGraphics()
- loop
- main()
-
-