Esempio n. 1
0
  private void createState() {
    mWorldState = new WorldState();
    mWorldState.width = mWidth;
    mWorldState.height = mHeight;
    mWorldState.meshWidth = mMeshWidth;
    mWorldState.meshHeight = mMeshHeight;
    mWorldState.rippleIndex = 0;
    mWorldState.glWidth = 2.0f;
    mWorldState.glHeight = mGlHeight;
    mWorldState.skySpeedX = random(-0.001f, 0.001f);
    mWorldState.skySpeedY = random(0.00008f, 0.0002f);
    mWorldState.rotate = mWidth > mHeight ? 1 : 0;
    mWorldState.isPreview = isPreview() ? 1 : 0;

    mScript.set_g_glWidth(mWorldState.glWidth);
    mScript.set_g_glHeight(mWorldState.glHeight);
    mScript.set_g_meshWidth(mWorldState.meshWidth);
    mScript.set_g_meshHeight(mWorldState.meshHeight);
    mScript.set_g_xOffset(0);
    mScript.set_g_rotate(mWorldState.rotate);
  }
Esempio n. 2
0
 @Override
 public void setOffset(float xOffset, float yOffset, int xPixels, int yPixels) {
   mWorldState.xOffset = xOffset;
   mScript.set_g_xOffset(mWorldState.xOffset);
 }