A89: Re: The problem with variable-line sprites


[Prev][Next][Index][Thread]

A89: Re: The problem with variable-line sprites




> l have a problem with the proper masking of variable-line sprites.  lt goes
> like this:
> if the sprite is to be 4 lines long (in a 4 line sprite), this is what
> happens obviously...
> sprite:
> dc.w 0      (pretend this 0 is a 4)
> dc.w 1
> dc.b 00000000
> dc.b 00000000
> dc.b 00000000
> dc.b 00000000
> spritemask:
> dc.b 11111111
> dc.b 11111111
> dc.b 11111111
> dc.b 11111111
>
> which will visually replace the graphscreen with a 8x4 box of clear pixels.
> However, let's say that l want to use the same sprite, but only display the
> first two lines of it.  it would go like this:
> sprite:
> dc.w 0      (pretend this 0 is a 2)
> dc.w 1
> dc.b 00000000   (this line and
> dc.b 00000000   this line would be the sprite)
> dc.b 00000000   (these two lines would
> dc.b 00000000   (end up being the mask)
> spritemask:
> dc.b 11111111       (these lines wouldn't do anything...)
> dc.b 11111111
> dc.b 11111111
> dc.b 11111111
>
> ...And so the problem is that the mask does not necessarily start from the
> label spritemask, it is just the next lines of sprite code.  So, what l am
> asking is, how can l take what l have there and make it so that it will
> display the lines of sprite and the lines of mask that l intended, instead of
> using the lines of sprite as a mask when changing the number of lines that
> the sprite is to be displayed?

To use the data you have here you could find or write a sprite routine that
takes a pointer to the mask as an argument...


 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF Quote follows:

- "ALL YOU CAN HOPE FOR IS THE MERCY OF HELL."
- "Yeah?"
- "JUST OUR LITTLE JOKE."
- "Ngk," said Crowley.
        -- Crowley in conversation with his superiors
           (Terry Pratchett & Neil Gaiman, Good Omens)




References: