home *** CD-ROM | disk | FTP | other *** search
-
-
- /* anim --- animate a gadget...
-
- Thuy (my girlfriend.device) insists this means "animal."
- I don't know why */
-
-
- #include <exec/memory.h>
- #include "stuff.h"
-
- #ifndef POPLITE
- #include "anim.h"
- #endif
-
- #define gadgedata(g) (((struct Image *) (g->GadgetRender))->ImageData)
- #define BIGDATA (save2SIZE*2)
- #define swilldefault 5
-
-
- extern struct Window * win ;
- extern ULONG msgclass ;
- extern USHORT msgcode ;
- extern int gadcode ;
- extern struct RastPort * reep ;
- extern struct Gadget TGads [] ;
- struct Image vop = { 0, 0, 32, 24, 5, NL, 0x1f, 0, NL };
- #ifndef POPLITE
- struct Image animage = { 0, 0, 32, 24, 5, NL, 0x1f, 0, NL };
-
- static struct Gadget *gogo;
- static long swill = swilldefault;
- #endif
-
-
- anim (gaga) struct Gadget *gaga;
- {
- #ifndef POPLITE
- REG int zot;
-
- animage.ImageData = AllocMem ( BIGDATA, MEMF_CHIP | MEMF_PUBLIC );
- ifn (animage.ImageData) { ALERT ("Low Chip Mem! Look out!"); RET; }
- gogo = gaga;
-
- if (gaga == &TGads [7]) {
- swill = 4;
- animage.Height = 20;
- animage.Width = 32;
-
- loop (zot = 3; --zot;) popanim (ni_clon2), popanim (gadgedata (gaga));
-
- swill = 5;
- } /* animate block */
-
- if (gaga == &TGads [3]) {
- animage.Height = 24;
- animage.Width = 32;
-
- loop (zot = 4; zot--;) {
- popanim (new1);
- popanim (new2);
- popanim (new3); }
-
- swill = 1;
- popanim (gadgedata (gaga));
- } /* animate block */
-
- if (gaga == &TGads [10]) {
- animage.Height = ni_inc1HITE;
- animage.Width = ni_inc1WIDT;
- animage.TopEdge = 3;
- animage.LeftEdge = 3;
- swill = 6;
- popanim (ni_inc1 ); popanim (ni_inc2 ); popanim (ni_inc3 );
- popanim (ni_inc4 ); popanim (ni_inc5 ); popanim (ni_inc6 );
- popanim (ni_inc7 ); popanim (ni_inc8 ); popanim (ni_inc9 );
- popanim (ni_inc10);
- animage.Height = 26;
- animage.Width = 38;
- animage.LeftEdge = 0;
- animage.TopEdge = 0;
- swill = 1;
- popanim (gadgedata (gaga)); }
-
- if (gaga == &TGads [6]) {
- animage.Height = ni_ld1HITE;
- animage.Width = ni_ld1WIDT;
- animage.TopEdge = 5;
- animage.LeftEdge = 3;
- swill = 8; popanim (ni_ld1 ); swill = 2;
- popanim (ni_ld2 ); popanim (ni_ld3 ); popanim (ni_ld2 );
- popanim (ni_ld3 ); popanim (ni_ld4 ); popanim (ni_ld3 );
- popanim (ni_ld4 ); popanim (ni_ld5 ); popanim (ni_ld6 );
- popanim (ni_ld3 ); popanim (ni_ld4 ); popanim (ni_ld6 );
- popanim (ni_ld4 ); popanim (ni_ld7 ); popanim (ni_ld5 );
- popanim (ni_ld6 ); popanim (ni_ld7 );
- swill = 8; popanim (ni_ld8 );
- animage.Height = 26;
- animage.Width = 38;
- animage.LeftEdge = 0;
- animage.TopEdge = 0;
- swill = 1;
- popanim (gadgedata (gaga)); }
-
- #endif
-
- if (gaga == &TGads [ 9]) {
-
- #ifndef POPLITE
-
- extern USHORT ni_roll [], ni_seq [];
-
-
- animage.Height = ni_roll1HITE;
- animage.Width = ni_roll1WIDT;
- popanim (ni_roll1); popanim (ni_roll2); popanim (ni_roll3);
- popanim (ni_roll4); popanim (ni_roll5); popanim (ni_roll6);
- popanim (ni_roll7); popanim (ni_roll8);
-
- #endif
-
- roll (); /* WE ACTUALLY DO IT HERE!!! */
-
- #ifndef POPLITE
-
- animage.Height = 20;
- popanim (ni_roll );
- vop.PlanePick = 0x017;
-
- popChip (ni_seq, ni_roll1SIZE /* should be big enough... */,
- 6, 20, 229, 121);
-
- vop.PlanePick = 0x01f;
- #endif
-
- } /* restore the seq gadget after roll clobbers it */
-
- #ifndef POPLITE
-
- if (gaga == &TGads [5]) {
- animage.Height = 24;
- animage.Width = 32;
- animage.LeftEdge = 3;
- animage.TopEdge = 0;
- swill = 3;
- popanim (save1 ); popanim (save2 ); popanim (save3 );
- popanim (save4 ); popanim (save5 ); popanim (save6 );
- popanim (save7 ); popanim (save8 ); popanim (save9 );
- popanim (save10); popanim (save11); popanim (save12);
- popanim (save13);
- swill = 11;
- popanim (save14);
- swill = 1;
- animage.Height = 26;
- animage.Width = 38;
- animage.LeftEdge = 0;
- animage.TopEdge = 0;
- popanim (gadgedata (gaga)); }
-
- if (gaga == &TGads[12]) { extern int webefillin;
- animage.Height = ni_fill1HITE;
- animage.Width = ni_fill1WIDT;
- animage.TopEdge = 3;
- animage.LeftEdge = 3;
- swill = 2;
-
- ifn (webefillin) {
- popanim (ni_fill1); popanim (ni_fill2); popanim (ni_fill3);
- popanim (ni_fill4); popanim (ni_fill5); popanim (ni_fill6);
- swill = 5;
- popanim (ni_fill7);
- swill = 1;
- animage.TopEdge = 0;
- animage.LeftEdge = 0;
- animage.Height = 26;
- animage.Width = 38;
- popanim (gadgedata (gaga)); }
- else {
- popanim (ni_fill7); popanim (ni_fill6); popanim (ni_fill5);
- popanim (ni_fill4); popanim (ni_fill3); popanim (ni_fill2);
- swill = 5;
- popanim (ni_fill1);
- swill = 1;
- animage.TopEdge = 0;
- animage.LeftEdge = 0;
- animage.Height = 26;
- animage.Width = 38;
- popanim (gadgedata (gaga)); } }
-
- swill = swilldefault;
- FreeMem (animage.ImageData, BIGDATA);
- #endif
- } /* now its a waste of code, now its a stub ... */
-
-
- #ifndef POPLITE
- popanim (what)
- void *what;
- {
-
- CopyMem (what, animage.ImageData, BIGDATA);
- WaitTOF ();
- Delay ((long) swill);
- DrawImage (reep, &animage, (long) gogo->LeftEdge, (long) gogo->TopEdge);
-
- } /* alright, alright, I'll put in a closing brace, you stupid compiler!
- gad - even COBOL can handled a missing subroutine exit!! */
- #endif
-
- void
- popChip (array, size, xsize, ysize, xx, yy)
- USHORT *array; long size;
- {
- REG USHORT *myChip;
- extern USHORT *imagine;
-
-
- IFN ( myChip = (USHORT *) AllocMem (size, MEMF_CHIP | MEMF_CLEAR))
- { ALERT ("Can't do it - no chips left!"); return; }
-
- CopyMem (array, myChip, size);
- vop.ImageData = myChip;
- vop.Width = xsize;
- vop.Height = ysize;
-
- #ifdef POPLITE
-
- if (imagine)
- vop.Depth = 5,
- vop.PlanePick = 0x1f;
- else
- vop.Depth = 1,
- vop.PlanePick = 1;
-
- #endif slap bubble gum on the cracks...
-
- DrawImage (win->RPort, &vop, (long) xx, (long) yy);
- FreeMem (myChip, size);
-
- }
-
-