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 --- PropGadgets.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 PropGadgets.c (limited to 'PropGadgets.c') diff --git a/PropGadgets.c b/PropGadgets.c new file mode 100644 index 0000000..dbbbd8e --- /dev/null +++ b/PropGadgets.c @@ -0,0 +1,61 @@ +#include +#include +#include +#include + +#include "Bobi.h" +#include "BobStructure.h" + +extern struct MyBob *BobTable[]; +extern struct Window *mainwindow; +extern struct Gadget PosPropGadget; +extern struct PropInfo PosPropGadgetSInfo; +extern WORD numbobs,actbobnum; + +/*************************************************************************/ + +void MovePosFunc() +{ + register struct Message *msg; + register WORD oldnum=-1; + + for(;;) + { + WaitTOF(); + if(msg = GetMsg(mainwindow->UserPort)) + { + ReplyMsg(msg); + break; + } + actbobnum = ReadBobNum(); + if(actbobnum != oldnum) + { + ShowFrame(actbobnum); + /* ShowBob(BobTable[actbobnum]); */ + oldnum = actbobnum; + } + } + actbobnum = ReadBobNum(); + ShowFrame(actbobnum); +} + +/*************************************************************************/ + +WORD ReadBobNum() +{ + return((WORD)((((UWORD)numbobs*PosPropGadgetSInfo.VertPot)+0x7fffL)>>16)); +} + +/*************************************************************************/ + +void RefreshBobNum() +{ + PosPropGadgetSInfo.VertBody = 0xffffL/(numbobs+1); + if(numbobs>0) + { + PosPropGadgetSInfo.VertPot = (actbobnum*0xffffL)/numbobs; + } + else PosPropGadgetSInfo.VertPot = 0; + + RefreshGList(&PosPropGadget,mainwindow,0,1); +} -- cgit v1.2.3