From 62e509e9c90d728c9f65145947276f79112ab48c Mon Sep 17 00:00:00 2001 From: "Christian A. Weber" Date: Tue, 2 Nov 1993 18:53:33 +0000 Subject: Initial revision --- Anim.c | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 Anim.c (limited to 'Anim.c') diff --git a/Anim.c b/Anim.c new file mode 100644 index 0000000..c4aa3c0 --- /dev/null +++ b/Anim.c @@ -0,0 +1,196 @@ +/* +** Bobi - The Ultimate Amiga Bob Manipulator +** +** Anim.c - Bobs animieren +** +** COPYRIGHT (C) 1989-1993 BY CHRISTIAN A. WEBER, ZUERICH, SWITZERLAND. +** ALL RIGHTS RESERVED. NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, +** OR TRANSMITTED IN ANY FORM OR BY ANY MEANS, WITHOUT THE PRIOR WRITTEN +** PERMISSION OF THE AUTHOR. NO WARRANTY. USE AT YOUR OWN RISK. +*/ + +#include +#include +#include +#include + +#include "Bobi.h" +#include "BobStructure.h" + +#define MAXANIMDELAY 50 + +extern struct Gadget AnimSpeedGadget; +extern struct PropInfo AnimSpeedGadgetSInfo; +extern struct MyBob *BobTable[]; +extern struct Window *mainwindow,*toolwindow; +extern WORD numbobs,actbobnum; +extern WORD firstanimbob,lastanimbob,animflags; + +extern struct MenuItem ForwardItem,BackwardItem,PingPongItem; + + +/*************************************************************************/ + +void SetFirstBobFunc() +{ + if(BobTable[actbobnum]) firstanimbob = actbobnum; + else ShowMonoReq2("No bob selected!"); +} + + +/*************************************************************************/ + +void SetLastBobFunc() +{ + if(BobTable[actbobnum]) lastanimbob = actbobnum; + else ShowMonoReq2("No bob selected!"); +} + + +/*************************************************************************/ + +void StartAnimFunc() +{ + register struct IntuiMessage *msg; + register LONG bobnum,dir,delay,i; + struct Menu *mainmenus,*toolmenus; + STRPTR oldmaintitle,oldtooltitle; + + oldmaintitle=mainwindow->ScreenTitle; + SetWindowTitles(mainwindow,(STRPTR)(~0L),"Hit or RMB to stop animation"); + mainmenus = mainwindow->MenuStrip; + ClearMenuStrip(mainwindow); + + if(toolwindow) + { + oldtooltitle=toolwindow->ScreenTitle; + SetWindowTitles(toolwindow,(STRPTR)(~0L),"Hit or RMB to stop animation"); + toolmenus = toolwindow->MenuStrip; + ClearMenuStrip(toolwindow); + } + + if(lastanimbob < firstanimbob) + { + bobnum = lastanimbob; + lastanimbob = firstanimbob; + firstanimbob = bobnum; + } + bobnum = firstanimbob; + dir=1; if(animflags & AF_BACKWARD) dir=-1; + + for(;;) + { + delay = (GetAnimSpeed()*MAXANIMDELAY+0x7fffL)>>16; + for(i=0; iUserPort); + if(toolwindow) + { + if(!msg) msg=(struct IntuiMessage *)GetMsg(toolwindow->UserPort); + } + + if(msg) + { + if((msg->Class==MENUPICK) || + ((msg->Class==RAWKEY) && (msg->Code==0x45))) + { + ReplyMsg((struct Message *)msg); + goto endanim; + } + ReplyMsg((struct Message *)msg); + } + } + bobnum += dir; + if(animflags & AF_BOUNCE) + { + if((bobnum>lastanimbob) || (bobnumlastanimbob) bobnum = firstanimbob; + if(bobnum