Ok, for anyone that wants to use this on Android at the moment I have a couple diff patches you might be interested in (and maybe @t0neg0d to apply somehow or in a branch maybe). The first solved my crashing on the emulator (I was using 4.1.2 at the time), and the second one fixed the 1280 error I was getting because the Android TV box i was using does not support Int values for the Index Buffers.
tonegod.gui.core.Screen
[java]
This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and \n newlines.
— Screen.java (Yesterday 7:47:22 PM)
+++ Current File
@@ -46,11 +46,11 @@
import com.jme3.texture.Texture;
import java.awt.Cursor;
import java.awt.Toolkit;
-import java.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.ClipboardOwner;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.StringSelection;
-import java.awt.datatransfer.Transferable;
+//import java.awt.datatransfer.Clipboard;
+//import java.awt.datatransfer.ClipboardOwner;
+//import java.awt.datatransfer.DataFlavor;
+//import java.awt.datatransfer.StringSelection;
+//import java.awt.datatransfer.Transferable;
import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
@@ -85,7 +85,8 @@
*
-
@author t0neg0d
*/
-public class Screen implements Control, RawInputListener, ClipboardOwner {
+public class Screen implements Control, RawInputListener//, ClipboardOwner
+{
public static enum CursorType {
POINTER,
@@ -170,7 +171,7 @@
private Node cursorEmitterPlaneNode = new Node(“cursorEmitterPlaneNode”);
private boolean useCursorEffects = false;
-
private Clipboard clipboard;
+// private Clipboard clipboard;
private boolean clipboardActive = false;
private boolean useTextureAtlas = false;
@@ -840,9 +841,9 @@
*/
public void setClipboardText(String text) {
try {
-
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
-
StringSelection stringSelection = new StringSelection( text );
-
clipboard.setContents(stringSelection, this);
+// clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+// StringSelection stringSelection = new StringSelection( text );
+// clipboard.setContents(stringSelection, this);
} catch (Exception ex) {
this.clipboardText = text;
}
@@ -854,18 +855,18 @@
*/
public String getClipboardText() {
String ret = “”;
-
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
-
Transferable text = clipboard.getContents(null);
-
boolean isText = (text != null && text.isDataFlavorSupported(DataFlavor.stringFlavor));
-
if (isText) {
-
try {
-
ret = (String)text.getTransferData(DataFlavor.stringFlavor);
-
} catch (Exception ex) {
-
ret = this.clipboardText;
-
if (ret == null)
-
ret = "";
-
}
-
}
+// clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+// Transferable text = clipboard.getContents(null);
+// boolean isText = (text != null && text.isDataFlavorSupported(DataFlavor.stringFlavor));
+// if (isText) {
+// try {
+// ret = (String)text.getTransferData(DataFlavor.stringFlavor);
+// } catch (Exception ex) {
+// ret = this.clipboardText;
+// if (ret == null)
+// ret = “”;
+// }
+// }
return ret;
}
@@ -1615,11 +1616,11 @@
keyboardElement = element;
}
-
@Override
-
public void lostOwnership(Clipboard clipboard, Transferable contents) {
-
// System.out.println(“Clipboard failed, switching to internal clipboard.”);
-
// this.clipboardActive = false;
-
}
+// @Override
+// public void lostOwnership(Clipboard clipboard, Transferable contents) {
+// // System.out.println(“Clipboard failed, switching to internal clipboard.”);
+// // this.clipboardActive = false;
+// }
// Layout Parser
public void parseLayout(String path, AbstractAppState state) {
[/java]
tonegod.gui.core.ElementQuadGrid.java
[java]
This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and \n newlines.
— ElementQuadGrid.java (Yesterday 7:47:22 PM)
+++ Current File
@@ -11,7 +11,7 @@
import com.jme3.scene.VertexBuffer.Type;
import com.jme3.util.BufferUtils;
import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
+import java.nio.ShortBuffer;
/**
*
@@ -20,7 +20,7 @@
public class ElementQuadGrid extends Mesh {
private FloatBuffer verts = BufferUtils.createFloatBuffer(163);
private FloatBuffer coords = BufferUtils.createFloatBuffer(162);
- private IntBuffer indexes = BufferUtils.createIntBuffer(336);
- private ShortBuffer indexes = BufferUtils.createShortBuffer(336);
private FloatBuffer normals = BufferUtils.createFloatBuffer(16*3);
private FloatBuffer colors = null;
@@ -32,7 +32,7 @@
private float templateZ = 0;
private float imgWidth, imgHeight, pixelWidth, pixelHeight, atlasX, atlasY, atlasW, atlasH;
- private int[] templateIndexes = new int[] {
- private short[] templateIndexes = new short[] {
0,1,5,5,4,0
};
@@ -93,24 +93,24 @@
// Populate indexes from temple
indexX = 0;
for (int x = 0; x < indexes.capacity(); x += 18) {
-
indexes.put(x, templateIndexes[0]+indexX);
-
indexes.put(x+1, templateIndexes[1]+indexX);
-
indexes.put(x+2, templateIndexes[2]+indexX);
-
indexes.put(x+3, templateIndexes[3]+indexX);
-
indexes.put(x+4, templateIndexes[4]+indexX);
-
indexes.put(x+5, templateIndexes[5]+indexX);
-
indexes.put(x+6, templateIndexes[0]+indexX+1);
-
indexes.put(x+7, templateIndexes[1]+indexX+1);
-
indexes.put(x+8, templateIndexes[2]+indexX+1);
-
indexes.put(x+9, templateIndexes[3]+indexX+1);
-
indexes.put(x+10, templateIndexes[4]+indexX+1);
-
indexes.put(x+11, templateIndexes[5]+indexX+1);
-
indexes.put(x+12, templateIndexes[0]+indexX+2);
-
indexes.put(x+13, templateIndexes[1]+indexX+2);
-
indexes.put(x+14, templateIndexes[2]+indexX+2);
-
indexes.put(x+15, templateIndexes[3]+indexX+2);
-
indexes.put(x+16, templateIndexes[4]+indexX+2);
-
indexes.put(x+17, templateIndexes[5]+indexX+2);
-
indexes.put(x,(short) (templateIndexes[0]+indexX));
-
indexes.put(x+1, (short) (templateIndexes[1]+indexX));
-
indexes.put(x+2, (short) (templateIndexes[2]+indexX));
-
indexes.put(x+3, (short) (templateIndexes[3]+indexX));
-
indexes.put(x+4, (short) (templateIndexes[4]+indexX));
-
indexes.put(x+5, (short) (templateIndexes[5]+indexX));
-
indexes.put(x+6, (short) (templateIndexes[0]+indexX+1));
-
indexes.put(x+7, (short) (templateIndexes[1]+indexX+1));
-
indexes.put(x+8, (short) (templateIndexes[2]+indexX+1));
-
indexes.put(x+9, (short) (templateIndexes[3]+indexX+1));
-
indexes.put(x+10, (short) (templateIndexes[4]+indexX+1));
-
indexes.put(x+11, (short) (templateIndexes[5]+indexX+1));
-
indexes.put(x+12, (short) (templateIndexes[0]+indexX+2));
-
indexes.put(x+13, (short) (templateIndexes[1]+indexX+2));
-
indexes.put(x+14, (short) (templateIndexes[2]+indexX+2));
-
indexes.put(x+15, (short) (templateIndexes[3]+indexX+2));
-
indexes.put(x+16, (short) (templateIndexes[4]+indexX+2));
-
indexes.put(x+17, (short) (templateIndexes[5]+indexX+2));
indexX += 4;
}
[/java]