[comp.sys.amiga] BOBS?

billium@pro-charlotte.cts.com (Bill Blanke) (11/28/88)

In the last few weeks, I've been trying to learn about BOBs, and, as
many of you know, learning usually requires a lot of pouring over the
include files. I've figured out the basics of BOBs, and now I'd like
to know more about the other structures used with them...

(1) What do the structures that begin with ac_CompFlags and ao_NextOb
(This is with the assembly .i includes) do? I assume they're part of 
an animation system. Could someone tell me how they work, and how
to use them?
(2) I think I've figured out the collision routines. Would anyone happen
to know the registers (d0 etc) that point/hold the variables that the OS
returns to the collision routine? :-)
(3) How do you use the DoubleBuffer structure. It would seem very easy
to enact, since its so small, and by programming BOBs, I've figured out
that you really have to have some sort of DoubleBuffering to make things
flicker free. Could someone describe to me how this structure works?

I've only found two examples of even programming Bobs! Why is this? One
is from Prog. Guide to Amiga (It says its example is Double Buffered, but
later admits it isn't, still a good book though). The other is on the
Fred Fish disk called DBUFFGELS. It uses Double Buffering, but doesn't go
through the OS. Instead, he manually flips his bitmaps using a toggle.
I would really like to know how these structures work. Since I'm
programming in assembly, it would be faster to go directly to the blitter,
but while I'm going through the OS, I might as well use every option the
OS provides me. Please don't refer me to a $30 manual unless you have
to, since I'm not that rich! :-) PLEASE HELP! Thanks!

rap@ardent.UUCP (Rob Peck) (12/01/88)

In article <3603@crash.cts.com>, billium@pro-charlotte.cts.com (Bill Blanke) writes:
> (1) What do the structures that begin with ac_CompFlags and ao_NextOb
> (This is with the assembly .i includes) do? I assume they're part of 
> an animation system. Could someone tell me how they work, and how
> to use them?
I think you can find information about these items in the Amiga ROM Kernel
Manual, volume II, Libraries and Devices.  There are few if any examples
of AnimComp demos available in the public domain.  Looks like time someone
created a simple one for distribution.

> (3) How do you use the DoubleBuffer structure. It would seem very easy
> to enact, since its so small, and by programming BOBs, I've figured out
> that you really have to have some sort of DoubleBuffering to make things
> flicker free. Could someone describe to me how this structure works?
>
Double buffering bobs entails drawing rendering into one buffer while the
other buffer is being displayed.  By properly initializing the Double Buffering
structure, you provide a place for the system to save the background that
one bob is covering up in one buffer, while the Save Buffer (forgot exact
terminology here) stores the background area for what you're drawing over
in the current drawing buffer.  Again I must suggest the RKM for what I
believe is a fairly good description.  (RJ and I wrote it).

> I've only found two examples of even programming Bobs! Why is this? One
> is from Prog. Guide to Amiga (It says its example is Double Buffered, but
> later admits it isn't, still a good book though).

Thanks for the compliment.  The example was supposed to have been double
buffered but I ran out of time.  Perhaps some other experimenter has
converted it to double-buffered and can post the modified code.

I'd do it but don't quite have time right now.

Just as a side-note, did anyone (other than me) realize that if you initialize
a rastport and bitmap properly, you can point it to the data area that is
reserved for a Bob's bitmap and actually draw stuff directly into the Bob
while it is moving on the screen?  It does require that you be careful
with the ImageMask, perhaps deliberatly stuffing it with all 1 bits to
allow full freedom of motion of a rectangular region, but thats a small
price to pay.  I happened across this as a solution to a particular problem,
where I wanted to produce pair of playing cards bouncing around on the
screen.  Originally I just wanted to double-buffer outlines of the
cards and fill the outlines with a pattern as I went along.  However the
area pattern is fixed with respect to the upperleft corner of a screen,
so as the outlines moved, the patterns would change; instead of a playing
card, they seemed like windows over a patterned background.  I used
double-buffered Bob's instead, (perhaps I can find that example), and
drew the playing card pattern into the Bob bitmap using the special RastPort
and BitMap I created.  Thus wherever the Bob went, the pattern remained
positioned relative to the Bob's edge, not the Screen's.

The idea of this demo was to have the playing cards shuffle around on the
screen for a little while, then to eventually bring up the words "If you
play your cards right, maybe someone will buy you an Amiga".  I'll see if
I can find it, maybe the code would help someone using Bobs.

Rob Peck

walker@sas.UUCP (Doug Walker) (12/03/88)

In article <3603@crash.cts.com> billium@pro-charlotte.cts.com (Bill Blanke) writes:
<technical questions about graphics.library routines deleted>
>OS provides me. Please don't refer me to a $30 manual unless you have
>to, since I'm not that rich! :-) PLEASE HELP! Thanks!

Programming graphics library calls without the ROM kernel manual or 
equivalent is like driving without eyes.

cjp@antique.UUCP (Charles Poirier) (12/07/88)

In article <737@ardent.UUCP> rap@ardent.UUCP writes:
>In article <3603@crash.cts.com>, billium@pro-charlotte.cts.com (Bill Blanke) writes:
>
>> (3) How do you use the DoubleBuffer structure. It would seem very easy
>> to enact, since its so small, and by programming BOBs, I've figured out...
>>
>Double buffering bobs entails drawing rendering into one buffer while the
>other buffer is being displayed.  By properly initializing the Double Buffering
>structure, you provide a place for the system to save the background that
>one bob is covering up in one buffer, while the Save Buffer (forgot exact
>terminology here) stores the background area for what you're drawing over
>in the current drawing buffer.  Again I must suggest the RKM for what I
>believe is a fairly good description.  (RJ and I wrote it).

The part that tells you how to set up the double-buffered BOBs is
fine.  What I found missing is a description, at that point in the RKM,
on how to double buffer the containing Intuition window.  As it now
reads, it's not clear (to the novice anyway) how to set up the window's
second BitMap (or is it the RastPort?), nor that such is even needed.

Now for my pet beef.  I can't find a documented way to tell the BOBs
system to redraw only a subset of the BOBs.  I have an application
where I am moving one BOB at a time, and I know that only say three out
of fifty or so BOBs are affected, and I also know which three.  If it
has to redraw all fifty, it becomes unacceptably slow.  Do I have to
write up my own replacement for the BOB system to accomplish this, or
is it possible to hack around this problem?  Any help would be appreciated.

	Thanks,
-- 
	Charles Poirier   (decvax,ucbvax,mcnc,attmail)!vax135!cjp

   "Docking complete...       Docking complete...       Docking complete..."