So, before I get anymore confused on what this method is called, let me demonstrate:

I want to take this sprite

Code:

00011000
01100110
11000011
11000011
01100110
0001100


and insert it into a rectangle area. The rectangle starts at 2,4, ends at 9,7, origin is 0,0, and the sprite is inserted at 0,1. The resulting image should look like:

Code:

x--->
y
|
v
0000000000.
0000000000.
0000000000.
0000000000.
0000001100
0010011000
0001100000
0000000000
..
outside rect is is not to be drawn in, and is marked with a period.


Does anyone know if a function exists in asm? I can make one, but it will be horribly unoptimized... I can write it in C, but that's still not fast...

If you don't understand what I am talking about, let me know...
I believe that would just be generic sprite clipping based on arbitrary x/y values instead of 95x64 or w/e the calc screen is.

You could probably adapt a existing clipped sprite routine if you want shouldn't be that hard to make it work how you want it to.
the only issue would be when the pixel cols don't match from the clipping bounds... I will try to write something later on...

oh, and the rectangle and sprites will not be aligned to 8 bits.
AHelper wrote:
the only issue would be when the pixel cols don't match from the clipping bounds



Huh? can you try refrasing that?

AHelper wrote:

oh, and the rectangle and sprites will not be aligned to 8 bits.


Expected this which is why I stated unaligned earlier ^_^
nm, I meant that the bounds of the rectangle will not be of multiples of 8.
Yeah then it would just be a unaligned clipping routine with arbitrary bounds. which should not be to hard to edit what you need from a existing aligned sprite routine.
Basically, you rotate each row of the sprite first, then mask the pieces into the buffer, up to (N+1) pieces for an N-byte-wide sprite. Of course, most sprite routines contain a special, fast case for aligned sprites.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement