Rotation of sprites, not using extra colors.

BlitzMax Forums/BlitzMax Programming/Rotation of sprites, not using extra colors.

Ryan Burnside(Posted 2006) [#1]
Hello, I'm making a game with a limited color palette and I noticed that when you rotate an image it add extra midtones to smooth out the image. Since my game is a retro style game I can't have all these extra midtones. Is there a way to rotate and stay within the colors used in the sprite?


H&K(Posted 2006) [#2]
Graphics( width,height,8)

well ok

Graphics( width,height,4) [For Really retro]

or

Graphics( width,height,2) [For Really Really Retro]


Ryan Burnside(Posted 2006) [#3]
I tried those and it just gave me an error and exited. Wouldn't these limit the colors in my palette and change the ones I have? Isn't there just a way to turn off rotation blending or just use the colors within the original image?


sswift(Posted 2006) [#4]
When you load the image, specify MASKEDIMAGE for the flags, unless you're using alpha mapped images, in which case you should set flags to 0.

The extra colors are probably coming from the bilinear filtering and the mipmapping. That will disable them.

It's possible there's other filtering going on, but I think that should do it.


Ryan Burnside(Posted 2006) [#5]
OK thank you very much I'll try that and get back to you tomorrow, thanks for the prompt reply.


Ryan Burnside(Posted 2006) [#6]



Well It's still close but not perfect. The challange of this was to only use a limited color palette. Even if one color is off a sma;l; amount it still counts/ I suppose i might have to write an algorithem to save all colors from the initial image rotate then fix the colors pixel by pixel to the initial colors.


skidracer(Posted 2006) [#7]
Are you using SetBlend SOLIDBLEND or maybe MASKBLEND?


Ryan Burnside(Posted 2006) [#8]
I have tried all the blends all give slightly varying results, but even with maskedblend and solid blend, it still manages to make about 2 shades of the teal color. I might just have to give up on dynamic rotation. I hate to be so picky but that is part of the limitations challange.


Grey Alien(Posted 2006) [#9]
yeah predraw your rotation. Also don't forget to draw at integer coords only so you don't get interpolation. For such a retro project you'd actually be better of with BlitzPlus.


Ryan Burnside(Posted 2006) [#10]
OK i got it working thank you guys this looks great now.(if a drop in quality can be considered better). I had not learned about graphic flags yet. I have so much to learn and i would pay cash money for a good book, Again thanks for all your help gents!