www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Hsaka on April 22, 2009, 08:34:58 pm

Title: Rotated Blitting
Post by: Hsaka on April 22, 2009, 08:34:58 pm
Hi,

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

Code: [Select]
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.
Title: Re: Rotated Blitting
Post by: EgonOlsen on April 22, 2009, 08:40:14 pm
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...
Title: Re: Rotated Blitting
Post by: Hsaka on April 22, 2009, 08:45:22 pm
Thanks for the quick reply Egon.  :)
Title: Re: Rotated Blitting
Post by: EgonOlsen on April 22, 2009, 10:04:45 pm
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.
Title: Re: Rotated Blitting
Post by: Hsaka on April 22, 2009, 10:47:05 pm
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.
Title: Re: Rotated Blitting
Post by: EgonOlsen on April 22, 2009, 11:00:16 pm
Ok, here you go: http://www.jpct.net/forum2/index.php/topic,1354.0.html (http://www.jpct.net/forum2/index.php/topic,1354.0.html) or download it directly: http://www.jpct.net/download/beta/jpctapi_118pre3.zip (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...:-)