Re: LZ: NASR


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

Re: LZ: NASR



At 09:58 PM 8/19/96 -0700, you wrote:
>Jingyang Xu wrote:
>> 
>> Rob Taylor wrote:
>> >
>> > > Hello,
>> > >       To people who are using NASR, before I go and use more of my
>> > > brain cells, has anyone written an algorithm to reverse a NASR sprite. I
>> > > mean reflect it over Y-Axis. Like if a character is facing one way, BAM,
>> > > he's facing the other way. I need this for Street Fighter. Fabrice, Tim,
>> > > Anyone?
>> >
>> > I'd just precalculate it: it's be to slow to use in a game, so just
>> > store sprites for both directions..
>> 
>> Yeah, thought about that, but the sprite table is so HUGE, it'd take at
>> least 3K to duplicate them. If that's the case, I could probably only fit
>> 3 or 4 characters in 28K!
>
>Isn't there are way to first reverse the sprites, and them put them out?
>Just write a routine that will change %01001010,%01011100 to
>%00111010,%01010010 every time the character change direction. Can't be
>so hard. I can write such a routine if you're lazy :)
>
That's exact it! I'm lazy! :)
But it's also not that simple. You see not all sprite end on exactly the
last bit of the last byte. So when you reverse it, the result have to start
with the last bit of the sprite, not the byte.
For example:
if the sprite's 10 pixels wide, then a horizontal line would be:
%11111111, %11000000, this have to become %11111111, %11000000, not
%00000011,%11111111. (Bad example I know, the result looks exactly like the
original :).


References: