Rotated Blitting

Started by Hsaka, April 22, 2009, 08:34:58 PM

Previous topic - Next topic

Hsaka

Hi,

Is it possible to incorporate a rotation when blitting? For instance, something like :

public void blit(Texture src,
                 int srcX,
                 int srcY,
                 int destX,
                 int destY,
                 int sourceWidth,
                 int sourceHeight,
                 int destWidth,
                 int destHeight,
                 int transValue,
                 boolean additive,
                 java.awt.Color addColor,
                 float rotationAngle)


Also, does jPCT use a textured plane in the background when blitting or does it blit directly to the screen?
Thanks in advance.

EgonOlsen

It depends on the renderer. The software renderer blits directly to the screen, the hardware renderer textures a plane in the background. Unless you are doing a scaled blit in software, which is converted internally into an Overlay. Adding rotation to blits doesn't really fit, but maybe it's possible to add it to the Overlay-class, which is very similar to blitting...i'll try and see how it works...

Hsaka

Thanks for the quick reply Egon.  :)

EgonOlsen

#3
Works fine with the Overlay. Is it an option for you to use that instead of blitting for rotated "blits"? I would upload a modified version then.

Hsaka

Changing to Overlays would not be a problem, in fact, I probably should have been using Overlays in the first place.

Thanks a lot Egon.

EgonOlsen

Ok, here you go: http://www.jpct.net/forum2/index.php/topic,1354.0.html or download it directly: http://www.jpct.net/download/beta/jpctapi_118pre3.zip. Both additions haven't been extensively tested, so please report any bugs as soon as you find them...:-)