Author Topic: Blitting Problem  (Read 1986 times)

Offline Brainsaw

  • byte
  • *
  • Posts: 2
    • View Profile
Blitting Problem
« on: December 28, 2013, 07:38:09 pm »
  Hello,

I am pretty new to Android development though I have some experience in programming. I am trying to write an Android client for my current project "the Sky of Verdun" (http://dustbin-online.de/sov.php), and I have run into a problem: I am trying to blit 2 images as controller, and the first image is OK, but the second doesn't show up:

Code: [Select]
  // Flight state, user controls a plane. m_Width and m_Height are the framebuffer width and height values.
  // m_Ctrl is a texture for the control stick, m_Fire is a firebutton
  case 3:
    m_FrameBuffer.blit(m_Fire, 0, 0, m_Width - 143, m_Height - 143, 128, 128, true);
    m_FrameBuffer.blit(m_Ctrl, 0, 0,      15      , m_Height - 271, 256, 256, true);
  break;

In this case only the fire button shows up, if I swap the lines only the controller shows up. Does anyone have an idea or a hint? Thanks.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Blitting Problem
« Reply #1 on: December 28, 2013, 08:27:00 pm »
That shouldn't happen. Where are you doing the blitting, i.e. in which stage? Blits will be accumulated and executed if the engine thinks that is has to. Maybe you are doing something (you are don't do something that you actually should) in a way that this doesn't trigger for the last blit. Can you post the context in which this calls happen?

In addition, try the latest beta jar to see if that helps: http://jpct.de/download/beta/jpct_ae.jar 

Offline Brainsaw

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Blitting Problem
« Reply #2 on: December 28, 2013, 09:59:14 pm »
Thanks, that did the job. I moved the code from the end of the "onDrawFrame" method to the line before the "framebuffer.display()" call. Now the controls are visible (though it's better to play the game with a gamepad ;) ).