Blitting Problem

Started by Brainsaw, December 28, 2013, 07:38:09 PM

Previous topic - Next topic

Brainsaw

  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:


  // 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.

EgonOlsen

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 

Brainsaw

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 ;) ).