DragASprite_Start

Tony van der Hoff tony at mk-net.demon.co.uk
Wed Jul 30 15:19:34 BST 2003


On 30 Jul 2003, in message
<gemini.3f27b0b800c8a1f6%richard at rvanderhoff.org.uk>, Richard van der Hoff
<richard at rvanderhoff.org.uk> wrote:

> Tony van der Hoff <tony at mk-net.demon.co.uk> wrote:
> 
> > On 28 Jul 2003, in message
> <7f4bdc184c%Marco at dionin.esw-heim.tu-clausthal.de>,
> > Marco Baye <Marco.Baye at tu-clausthal.de> wrote:
> > 
> > > Hi!
> > > 
> > > PRM 3-300 says about DragASprite_Start:
> > > 
> > > On entry
> > >     R0 = flags
> > >     R1 = sprite area holding sprite:
> > >         0       system sprite area
> > >         1       wimp sprite area
> > >         Other   address of sprite area
> > > 
> > > When reading the OSLib function's StrongHelp page, I realized there are
> > > no constants defined for accessing the system or wimp sprite area. Any
> > > chance of adding
> > > 
> > > #define dragasprite_SYSTEM_SPRITE_AREA (osspriteop_area const*) 0
> > > #define dragasprite_WIMP_SPRITE_AREA   (osspriteop_area const*) 1
> > > 
> > > to "oslib/dragasprite.h" ?
> > > 
> > [snip]
> > 
> > Yes, that seems a reasonable thing to do. I'll put it on the list.
> > Thanks.
> > 
> 
> Hmm; I only have a rather old version of oslib to hand, but in it I have 
> 
> #define wimpspriteop_AREA  ((osspriteop_area *) 0x1u)
> 
> (that's in wimpspriteop.h), though I can't find one for the system sprite
> area.
> 
> Anyway, the point is, those constants aren't limited to use with
> dragasprite, as they apply to almost every sprite operation under the wimp,
> so dragasprite.h is the wrong place for them, IMHO.

Yes, I wondered about that. However, I can see nothing wrong in having
multiple names for the same constant; and to some extent it improves
documentation by localising the constant to the context within which it's
being used. As Marco says, it makes the StrongHelp lookup easier.

Taking this to its conclusion does indeed suggest that every module that uses
system and user sprite areas could have its own definition, but is that a bad
thing?

-- 
Tony van der Hoff         | MailTo:tony at mk-net.demon.co.uk
                          | MailTo:avanderhoff at iee.org
Buckinghamshire, England  | http:www.mk-net.demon.co.uk



More information about the oslib-user mailing list