Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Raylin on September 16, 2010, 05:29:08 pm

Title: Large masked sprites?
Post by: Raylin on September 16, 2010, 05:29:08 pm
How do you do it in Axe outside of a million Pt-Mask() commands?
Title: Re: Large masked sprites?
Post by: SirCmpwn on September 16, 2010, 06:47:23 pm
You could write a custom bitmap routine, I guess.
I'm several versions behind on Axe, I haven't even seen Pt-Mask.  Advance Wars uses its own masked sprite routine.
Title: Re: Large masked sprites?
Post by: Raylin on September 16, 2010, 06:48:47 pm
What was your solution to that, Sir? Could you input arbitrary numbers for the size of said bitmap?
Title: Re: Large masked sprites?
Post by: SirCmpwn on September 16, 2010, 06:59:40 pm
Well, you can define them at compile time, and you can use SMC to define them at runtime.
Title: Re: Large masked sprites?
Post by: Raylin on September 16, 2010, 07:04:42 pm
Hmm...

How would one make his own masking routine?
What are the basics of masking?
Title: Re: Large masked sprites?
Post by: SirCmpwn on September 16, 2010, 07:13:39 pm
Well, I made one sprite completely black (sprite A), and the other one was just the white pixels (sprite B), then I used Pt-On first with sprite A, then Pt-Change with sprite B on top.
Title: Re: Large masked sprites?
Post by: Raylin on September 16, 2010, 07:30:54 pm
PICS OR IT DIDN'T HAPPEN.
Title: Re: Large masked sprites?
Post by: SirCmpwn on September 16, 2010, 07:32:10 pm
No.  I'm having trouble sending things between my calc and my computer.  Just try it on your own, it will work.
Title: Re: Large masked sprites?
Post by: calc84maniac on September 16, 2010, 08:03:26 pm
This is actually how masking is done in xLib too (though most people prefer using AND/OR masking, but AND is not an option in Axe)
Title: Re: Large masked sprites?
Post by: tloz128 on September 16, 2010, 08:05:45 pm
I used XOR to do sprite masking in my axe game. I would draw on one sprite that contained black for everywhere that I wanted to be masked using OR logic (Pt-On), and I would draw a sprite over that with black for all the areas of the masked sprite I wanted white using XOR logic (Pt-Change).
EDIT: oh wait, SirCmpwn already said that
Title: Re: Large masked sprites?
Post by: Raylin on September 16, 2010, 08:24:34 pm
Quigibo? Any ideas? Maybe add in this badass feature (masked bitmaps)?
Title: Re: Large masked sprites?
Post by: DJ Omnimaga on September 16, 2010, 08:28:23 pm
I would like this feature. I think it uses TI's routine, though, so I am unsure how it can be modified.
Title: Re: Large masked sprites?
Post by: Quigibo on September 16, 2010, 08:47:47 pm
The Pt-Mask() is a way to automate exactly what SirCmpwn was talking about.  There isn't a way to optimize it further outside of writing an Asm routine.
Title: Re: Large masked sprites?
Post by: Raylin on September 16, 2010, 09:34:25 pm
Is there ANY WAY to mask huge sprites without the Pt-Mask()?
Title: Re: Large masked sprites?
Post by: Quigibo on September 16, 2010, 09:54:10 pm
You can write a gazillion pxl-change()/pxl-on()/pxl-off() but that's really slow.  Like I said, your only other option is inline assembly or multiple Pt-Mask() routines.
Title: Re: Large masked sprites?
Post by: shmibs on September 16, 2010, 10:17:44 pm
you could also copy the data directly from the source to the buffer using logic, but that only has arbitrary height(width still must be a multiple of 8), and its x position has to be a multiple of 8 as well...
so yeah, your best bet is just multiple pt-masks

EDIT: LOLS, 8 ) was turned into a smiley...
Title: Re: Large masked sprites?
Post by: Raylin on September 16, 2010, 10:22:39 pm
o.o

shmibs, EXPOUND! That may be the key! :D