Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: SirCmpwn on March 25, 2011, 10:33:17 pm

Title: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 10:33:17 pm
Hello,
Does the Bitmap( command properly handle clipping?
Title: Re: Bitmap( Clipping
Post by: Runer112 on March 25, 2011, 10:33:32 pm
Nope.
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 10:33:45 pm
I don't believe it does.
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 10:33:56 pm
Do you know for sure?  Because it wouldn't be difficult to handle it accidentally.
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 10:37:39 pm
I know the Pt- commands handle clipping, but others like the Line command don't. Iono, maybe something could be done with Bitmap.
Title: Re: Bitmap( Clipping
Post by: Runer112 on March 25, 2011, 10:39:19 pm
Well I just tried using Bitmap() to draw an image offscreen. Miraculously it didn't cause a RAM clear, but it turned the screen to maximum contrast and changed the z address, so I'd say the clipping is far from perfect.
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 10:39:52 pm
D: sad day.
Well, that's that.  Motherload faces yet another issue with speed.
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 10:40:58 pm
What do you need the Bitmap clipping for? I thought your map is all tile-based.
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 10:42:50 pm
Not the buildings on the surface :/
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 10:46:29 pm
If you converted the buildings into a bunch of tiles linked together, you could probably get it to work.
If a building is like 16 by 16 and the tiles for top left, top right, bottom left, and bottom right are 01, 02, 03, and 04 respectively just arrange them in your map like

0102etc
0304etc
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 10:47:55 pm
Well, in order to facilitate massive maps, I'm using half-byte tiles, and I need to dedicate most of them to minerals and the like.
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 11:10:34 pm
Ah I see. That's a problem I had with Graviter too.
Maybe if the y is above the dirt, use one tileset, but if it's below, use another? Because you'll also need some special tiles for natas's chamber.
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 11:12:53 pm
Natas's chamber will be an entirely different map.  I think I'll have the vehicle drop into a cavern, and as it is falling, load the new map.
This isn't my first wrestle with performance, I'm sure I'll get it working.  The separate tileset idea won't work, because there are a ton of different tiles :(

Also, I've never actually beaten Motherload <_< so if someone wants to describe the final battle to me I'd appreciate it.
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 11:24:47 pm
Er...use full byte at the top but half byte in the middle? Also the final boss with Natas is basically you just keep throwing dynamite at him until he blows up. If I remember correctly, because usually I cheated before then :P
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 11:25:17 pm
Can you resurface?
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 11:27:35 pm
There's earthquakes, and the gravity is way too strong, so I don't think so. You could teleport back to the surface though.
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 25, 2011, 11:28:26 pm
Ah, that makes it easier.
Title: Re: Bitmap( Clipping
Post by: leafy on March 25, 2011, 11:33:18 pm
lol yes it certainly does xD
Title: Re: Bitmap( Clipping
Post by: Builderboy on March 26, 2011, 01:35:35 am
I'm thinking using Bitmap would be something that would hinder the speed way too much to be useful o.O If i remember correctly its horribly slow.  Hmmmm, perhaps it could be hardcoded in, using a separate tilemap with full bytes or whatever?
Title: Re: Bitmap( Clipping
Post by: DJ Omnimaga on March 26, 2011, 01:52:33 am
I think Bitmap is more suitable for games that requires very low speed or less smooth movements and never use the sprite commands. THat way you save a few bytes of code. Otherwise it's best to use pt-on/off
Title: Re: Bitmap( Clipping
Post by: SirCmpwn on March 26, 2011, 11:30:11 am
Yeah, I'm thinking that the best way is a separate, full byte tilemap.
Title: Re: Bitmap( Clipping
Post by: Hot_Dog on March 26, 2011, 11:41:05 am
Interesting...from my experience, Bitmap( handled clipping perfectly unless the image was entirely off screen.
Title: Re: Bitmap( Clipping
Post by: Runer112 on March 26, 2011, 11:44:55 am
Interesting...from my experience, Bitmap( handled clipping perfectly unless the image was entirely off screen.

Now that I think of my testing, I think this might be right...
Title: Re: Bitmap( Clipping
Post by: Hot_Dog on March 26, 2011, 11:49:40 am
So SirCmpwn, you could probably draw an image unless it's entirely off screen (in other words, your code should have something like "If X > 95 don't draw"), and still use Bitmap( for your buildings.

The offscreen thing is something TI actually warned about in their SDK manual.  Who would have guessed.
Title: Re: Bitmap( Clipping
Post by: DJ Omnimaga on March 26, 2011, 04:21:06 pm
Does it also clip at the top of the screen? I remember some sprite routines got issues with that before. xLIB .601a or below clipped to the left, right and bottom, but when the sprite was outside the top of the screen you got a blue screen of death.
Title: Re: Bitmap( Clipping
Post by: leafy on March 26, 2011, 04:23:58 pm
Yeah but bitmap will still slow down the program significantly, and since you're using greyscale I don't think this is the way to go.