Author Topic: Rotated Blitting  (Read 4544 times)

Offline Hsaka

  • byte
  • *
  • Posts: 8
    • View Profile
Rotated Blitting
« 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Rotated Blitting
« Reply #1 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...

Offline Hsaka

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Rotated Blitting
« Reply #2 on: April 22, 2009, 08:45:22 pm »
Thanks for the quick reply Egon.  :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Rotated Blitting
« Reply #3 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.
« Last Edit: April 22, 2009, 10:11:19 pm by EgonOlsen »

Offline Hsaka

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Rotated Blitting
« Reply #4 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Rotated Blitting
« Reply #5 on: April 22, 2009, 11:00:16 pm »
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...:-)