* Eclipse classpath no longer includes .svn folders

* Updated android.jar to 2.3
 * Add support for changing fullscreen mode in AndroidHarness
 * VBO now used by default for Android versions > 2.2
 * Fix wrong setting array type uniforms in android (e.g. Vector3Array)
 * Improved efficiency of setVertexAttrib in android by not creating iterator each time
 * Added method ParticleEmitter.killParticle()
 * Deleted useless com.jme3.renderer.layer package
 * Fix documentation of AppSettings.setCustomRenderer()
 * Fix SkyFactory on android (again!)
 * Deleted useless com.jme3.video package
 * Add KeyNames to get names of keyboard keys
 

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8317 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 13 years ago
parent ff3336679d
commit 3f95a0ca2f
  1. 40
      engine/.classpath
  2. BIN
      engine/lib/android/android.jar
  3. 29
      engine/src/android/com/jme3/app/AndroidHarness.java
  4. 86
      engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java
  5. 52
      engine/src/core/com/jme3/effect/ParticleEmitter.java
  6. 153
      engine/src/core/com/jme3/input/KeyNames.java
  7. 1
      engine/src/core/com/jme3/renderer/RenderContext.java
  8. 6
      engine/src/core/com/jme3/system/AppSettings.java
  9. 10
      engine/src/core/com/jme3/util/SkyFactory.java

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/core"/>
<classpathentry kind="src" path="src/core-data"/>
<classpathentry kind="src" path="src/core-plugins"/>
<classpathentry kind="src" path="src/desktop"/>
<classpathentry kind="src" path="src/desktop-fx"/>
<classpathentry kind="src" path="src/games"/>
<classpathentry kind="src" path="src/jbullet"/>
<classpathentry kind="src" path="src/jogg"/>
<classpathentry kind="src" path="src/lwjgl-oal"/>
<classpathentry kind="src" path="src/lwjgl-ogl"/>
<classpathentry kind="src" path="src/niftygui"/>
<classpathentry kind="src" path="src/ogre"/>
<classpathentry kind="src" path="src/pack"/>
<classpathentry kind="src" path="src/test"/>
<classpathentry kind="src" path="src/test-data"/>
<classpathentry kind="src" path="src/tools"/>
<classpathentry kind="src" path="src/xml"/>
<classpathentry kind="src" path="src/terrain"/>
<classpathentry kind="src" path="src/networking"/>
<classpathentry kind="src" path="src/blender"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/core"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/core-data"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/core-plugins"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/desktop"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/desktop-fx"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/games"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/jbullet"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/jogg"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/lwjgl-oal"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/lwjgl-ogl"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/niftygui"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/ogre"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/pack"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/test"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/test-data"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/tools"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/xml"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/terrain"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/networking"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src/blender"/>
<classpathentry kind="lib" path="lib/jbullet/asm-all-3.1.jar"/>
<classpathentry kind="lib" path="lib/jbullet/jbullet.jar"/>

Binary file not shown.

@ -74,6 +74,23 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
* Message of the exit dialog, default is "Use your home key to bring this app into the background or exit to terminate it."
*/
protected String exitDialogMessage = "Use your home key to bring this app into the background or exit to terminate it.";
/**
 * Set the screen window size
 * if screenFullSize is true, then the notification bar and title bar are
 *   removed and the screen covers the entire display
 * if screenFullSize is false, then the notification bar remains visible
 *   if screenShowTitle is true while screenFullScreen is false, then the
 *     title bar is also displayed under the notification bar
 */
protected boolean screenFullScreen = true;
/**
* if screenShowTitle is true while screenFullScreen is false, then the
 *     title bar is also displayed under the notification bar
*/
protected boolean screenShowTitle = true;
/**
* Set the screen orientation, default is SENSOR
* ActivityInfo.SCREEN_ORIENTATION_* constants
@ -115,9 +132,15 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
JmeSystem.setResources(getResources());
JmeSystem.setActivity(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (screenFullScreen) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
if (!screenShowTitle) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
}
setRequestedOrientation(screenOrientation);

@ -81,6 +81,8 @@ import android.graphics.Bitmap;
import android.opengl.GLES10;
import android.opengl.GLES11;
import android.opengl.GLES20;
import android.os.Build;
import java.util.ArrayList;
public class OGLESShaderRenderer implements Renderer {
@ -405,6 +407,12 @@ public class OGLESShaderRenderer implements Renderer {
// checkGLError();
if ("2.2".equals(Build.VERSION.RELEASE)) {
useVBO = false;
} else {
useVBO = true;
}
logger.log(Level.INFO, "Caps: {0}", caps);
}
@ -906,35 +914,35 @@ public class OGLESShaderRenderer implements Renderer {
logger.info("GLES20.glUniform1fv set FloatArray." + uniform.getName());
}
fb = (FloatBuffer) uniform.getValue();
GLES20.glUniform1fv(loc, 1, fb);
GLES20.glUniform1fv(loc, fb.capacity(), fb);
break;
case Vector2Array:
if (verboseLogging) {
logger.info("GLES20.glUniform2fv set Vector2Array." + uniform.getName());
}
fb = (FloatBuffer) uniform.getValue();
GLES20.glUniform2fv(loc, 1, fb);
GLES20.glUniform2fv(loc, fb.capacity() / 2, fb);
break;
case Vector3Array:
if (verboseLogging) {
logger.info("GLES20.glUniform3fv set Vector3Array." + uniform.getName());
}
fb = (FloatBuffer) uniform.getValue();
GLES20.glUniform3fv(loc, 1, fb);
GLES20.glUniform3fv(loc, fb.capacity() / 3, fb);
break;
case Vector4Array:
if (verboseLogging) {
logger.info("GLES20.glUniform4fv set Vector4Array." + uniform.getName());
}
fb = (FloatBuffer) uniform.getValue();
GLES20.glUniform4fv(loc, 1, fb);
GLES20.glUniform4fv(loc, fb.capacity() / 4, fb);
break;
case Matrix4Array:
if (verboseLogging) {
logger.info("GLES20.glUniform4fv set Matrix4Array." + uniform.getName());
}
fb = (FloatBuffer) uniform.getValue();
GLES20.glUniformMatrix4fv(loc, 1, false, fb);
GLES20.glUniformMatrix4fv(loc, fb.capacity() / 16, false, fb);
break;
case Int:
if (verboseLogging) {
@ -2426,7 +2434,7 @@ public class OGLESShaderRenderer implements Renderer {
convertFormat(vb.getFormat()),
vb.isNormalized(),
vb.getStride(),
vb.getData());
0);
attribs[loc] = vb;
}
@ -2479,7 +2487,7 @@ public class OGLESShaderRenderer implements Renderer {
if (context.boundElementArrayVBO != bufId) {
if (verboseLogging) {
logger.info("GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, " + bufId + ")");
logger.log(Level.INFO, "GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, {0})", bufId);
}
GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, bufId);
@ -2523,7 +2531,7 @@ public class OGLESShaderRenderer implements Renderer {
} else {
indexBuf.getData().position(curOffset);
if (verboseLogging) {
logger.info("glDrawElements(): " + elementLength + ", " + curOffset);
logger.log(Level.INFO, "glDrawElements(): {0}, {1}", new Object[]{elementLength, curOffset});
}
GLES20.glDrawElements(elMode, elementLength, fmt, indexBuf.getData());
@ -2554,7 +2562,7 @@ public class OGLESShaderRenderer implements Renderer {
indexData.clear();
if (verboseLogging) {
logger.info("glDrawElements(), indexBuf.capacity (" + indexBuf.getData().capacity() + "), vertCount (" + vertCount + ")");
logger.log(Level.INFO, "glDrawElements(), indexBuf.capacity ({0}), vertCount ({1})", new Object[]{indexBuf.getData().capacity(), vertCount});
}
GLES11.glDrawElements(
@ -2591,7 +2599,7 @@ public class OGLESShaderRenderer implements Renderer {
}
public void updateVertexArray(Mesh mesh) {
logger.info("updateVertexArray(" + mesh + ")");
logger.log(Level.INFO, "updateVertexArray({0})", mesh);
int id = mesh.getId();
/*
if (id == -1){
@ -2613,9 +2621,9 @@ public class OGLESShaderRenderer implements Renderer {
updateBufferData(interleavedData);
}
IntMap<VertexBuffer> buffers = mesh.getBuffers();
for (Entry<VertexBuffer> entry : buffers) {
VertexBuffer vb = entry.getValue();
ArrayList<VertexBuffer> buffersList = mesh.getBufferList();
for (int i = 0; i < buffersList.size(); i++){
VertexBuffer vb = buffersList.get(i);
if (vb.getBufferType() == Type.InterleavedData
|| vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers
@ -2674,7 +2682,8 @@ public class OGLESShaderRenderer implements Renderer {
drawTriangleList_Array(indices, mesh, count);
} else {
if (verboseLogging) {
logger.info("GLES20.glDrawArrays(" + mesh.getMode() + ", " + 0 + ", " + mesh.getVertexCount() + ")");
logger.log(Level.INFO, "GLES20.glDrawArrays({0}, {1}, {2})",
new Object[]{mesh.getMode(), 0, mesh.getVertexCount()});
}
GLES20.glDrawArrays(convertElementMode(mesh.getMode()), 0, mesh.getVertexCount());
@ -2685,7 +2694,8 @@ public class OGLESShaderRenderer implements Renderer {
private void renderMeshDefault(Mesh mesh, int lod, int count) {
if (verboseLogging) {
logger.info("renderMeshDefault(" + mesh + ", " + lod + ", " + count + ")");
logger.log(Level.INFO, "renderMeshDefault({0}, {1}, {2})",
new Object[]{mesh, lod, count});
}
VertexBuffer indices = null;
@ -2722,7 +2732,8 @@ public class OGLESShaderRenderer implements Renderer {
} else {
// throw new UnsupportedOperationException("Cannot render without index buffer");
if (verboseLogging) {
logger.info("GLES20.glDrawArrays(" + convertElementMode(mesh.getMode()) + ", 0, " + mesh.getVertexCount() + ")");
logger.log(Level.INFO, "GLES20.glDrawArrays({0}, 0, {1})",
new Object[]{convertElementMode(mesh.getMode()), mesh.getVertexCount()});
}
GLES20.glDrawArrays(convertElementMode(mesh.getMode()), 0, mesh.getVertexCount());
@ -2735,7 +2746,7 @@ public class OGLESShaderRenderer implements Renderer {
if (context.pointSize != mesh.getPointSize()) {
if (verboseLogging) {
logger.info("GLES10.glPointSize(" + mesh.getPointSize() + ")");
logger.log(Level.INFO, "GLES10.glPointSize({0})", mesh.getPointSize());
}
GLES10.glPointSize(mesh.getPointSize());
@ -2744,7 +2755,7 @@ public class OGLESShaderRenderer implements Renderer {
if (context.lineWidth != mesh.getLineWidth()) {
if (verboseLogging) {
logger.info("GLES20.glLineWidth(" + mesh.getLineWidth() + ")");
logger.log(Level.INFO, "GLES20.glLineWidth({0})", mesh.getLineWidth());
}
GLES20.glLineWidth(mesh.getLineWidth());
@ -2776,7 +2787,7 @@ public class OGLESShaderRenderer implements Renderer {
private void checkGLError() {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
logger.warning("glError " + error);
logger.log(Level.WARNING, "glError {0}", error);
// throw new RuntimeException("glError " + error);
}
}
@ -2794,7 +2805,7 @@ public class OGLESShaderRenderer implements Renderer {
*/
public void drawTriangleList_Array(VertexBuffer indexBuf, Mesh mesh, int count) {
if (verboseLogging) {
logger.info("drawTriangleList_Array(Count = " + count + ")");
logger.log(Level.INFO, "drawTriangleList_Array(Count = {0})", count);
}
if (indexBuf.getBufferType() != VertexBuffer.Type.Index) {
@ -2831,17 +2842,16 @@ public class OGLESShaderRenderer implements Renderer {
indexBuf.getData().position(curOffset);
if (verboseLogging) {
logger.info("glDrawElements(): " + elementLength + ", " + curOffset);
logger.log(Level.INFO, "glDrawElements(): {0}, {1}", new Object[]{elementLength, curOffset});
}
GLES20.glDrawElements(elMode, elementLength, fmt, indexBuf.getData());
curOffset += elementLength * elSize;
}
} else //if (mesh.getMode() == Mode.Hybrid)
{
} else {
if (verboseLogging) {
logger.info("glDrawElements(), indexBuf.capacity (" + indexBuf.getData().capacity() + "), vertCount (" + vertCount + ")");
logger.log(Level.INFO, "glDrawElements(), indexBuf.capacity ({0}), vertCount ({1})", new Object[]{indexBuf.getData().capacity(), vertCount});
}
GLES20.glDrawElements(
@ -2859,7 +2869,7 @@ public class OGLESShaderRenderer implements Renderer {
*/
public void setVertexAttrib_Array(VertexBuffer vb, VertexBuffer idb) {
if (verboseLogging) {
logger.info("setVertexAttrib_Array(" + vb + ", " + idb + ")");
logger.log(Level.INFO, "setVertexAttrib_Array({0}, {1})", new Object[]{vb, idb});
}
if (vb.getBufferType() == VertexBuffer.Type.Index) {
@ -2876,21 +2886,21 @@ public class OGLESShaderRenderer implements Renderer {
if (loc == -1) {
//throw new IllegalArgumentException("Location is invalid for attrib: [" + vb.getBufferType().name() + "]");
if (verboseLogging) {
logger.warning("attribute is invalid in shader: [" + vb.getBufferType().name() + "]");
logger.log(Level.WARNING, "attribute is invalid in shader: [{0}]", vb.getBufferType().name());
}
return;
} else if (loc == -2) {
String attributeName = "in" + vb.getBufferType().name();
if (verboseLogging) {
logger.info("GLES20.glGetAttribLocation(" + programId + ", " + attributeName + ")");
logger.log(Level.INFO, "GLES20.glGetAttribLocation({0}, {1})", new Object[]{programId, attributeName});
}
loc = GLES20.glGetAttribLocation(programId, attributeName);
if (loc < 0) {
attrib.setLocation(-1);
if (verboseLogging) {
logger.warning("attribute is invalid in shader: [" + vb.getBufferType().name() + "]");
logger.log(Level.WARNING, "attribute is invalid in shader: [{0}]", vb.getBufferType().name());
}
return; // not available in shader.
} else {
@ -2906,13 +2916,19 @@ public class OGLESShaderRenderer implements Renderer {
avb.getData().position(vb.getOffset());
if (verboseLogging) {
logger.info("GLES20.glVertexAttribPointer("
+ "location=" + loc + ", "
+ "numComponents=" + vb.getNumComponents() + ", "
+ "format=" + vb.getFormat() + ", "
+ "isNormalized=" + vb.isNormalized() + ", "
+ "stride=" + vb.getStride() + ", "
+ "data.capacity=" + avb.getData().capacity() + ")");
logger.log(Level.INFO,
"GLES20.glVertexAttribPointer(" +
"location={0}, " +
"numComponents={1}, " +
"format={2}, " +
"isNormalized={3}, " +
"stride={4}, " +
"data.capacity={5})",
new Object[]{loc, vb.getNumComponents(),
vb.getFormat(),
vb.isNormalized(),
vb.getStride(),
avb.getData().capacity()});
}

@ -568,22 +568,6 @@ public class ParticleEmitter extends Geometry {
this.endSize = endSize;
}
/**
* This method sets the gravity value of Y axis.
*
* By default the Y axis is the only one to have gravity value non zero.
*
* @param gravity
* Set the gravity of Y axis, in units/sec/sec, of particles
* spawned.
*
* @deprecated Use {@link ParticleEmitter#setGravity(float, float, float) instead.
*/
@Deprecated
public void setGravity(float gravity) {
this.gravity.y = gravity;
}
/**
* Get the gravity vector.
*
@ -836,31 +820,7 @@ public class ParticleEmitter extends Geometry {
this.particleInfluencer.setVelocityVariation(variation);
}
// private int newIndex(){
// liveParticles ++;
// return unusedIndices.remove(0);
// if (unusedIndices.size() > 0){
// liveParticles++;
// return unusedIndices.remove(0);
// }else if (next < particles.length){
// liveParticles++;
// return next++;
// }else{
// return -1;
// }
// }
// private void freeIndex(int index){
// liveParticles--;
// if (index == next-1)
// next--;
// else
// assert !unusedIndices.contains(index);
// unusedIndices.add(index);
// }
private Particle emitParticle(Vector3f min, Vector3f max) {
// int idx = newIndex();
// if (idx == -1)
// return false;
int idx = lastUsed + 1;
if (idx >= particles.length) {
return null;
@ -943,6 +903,16 @@ public class ParticleEmitter extends Geometry {
}
}
}
/**
* Kills the particle at the given index.
*
* @param index The index of the particle to kill
* @see #getParticles()
*/
public void killParticle(int index){
freeParticle(index);
}
private void freeParticle(int idx) {
Particle p = particles[idx];
@ -953,8 +923,6 @@ public class ParticleEmitter extends Geometry {
p.angle = 0;
p.rotateSpeed = 0;
// freeIndex(idx);
if (idx == lastUsed) {
while (lastUsed >= 0 && particles[lastUsed].life == 0) {
lastUsed--;

@ -0,0 +1,153 @@
package com.jme3.input;
import static com.jme3.input.KeyInput.*;
public class KeyNames {
private static final String[] KEY_NAMES = new String[0xFF];
static {
KEY_NAMES[KEY_0] = "0";
KEY_NAMES[KEY_1] = "1";
KEY_NAMES[KEY_2] = "2";
KEY_NAMES[KEY_3] = "3";
KEY_NAMES[KEY_4] = "4";
KEY_NAMES[KEY_5] = "5";
KEY_NAMES[KEY_6] = "6";
KEY_NAMES[KEY_7] = "7";
KEY_NAMES[KEY_8] = "8";
KEY_NAMES[KEY_9] = "9";
KEY_NAMES[KEY_Q] = "Q";
KEY_NAMES[KEY_W] = "W";
KEY_NAMES[KEY_E] = "E";
KEY_NAMES[KEY_R] = "R";
KEY_NAMES[KEY_T] = "T";
KEY_NAMES[KEY_Y] = "Y";
KEY_NAMES[KEY_U] = "U";
KEY_NAMES[KEY_I] = "I";
KEY_NAMES[KEY_O] = "O";
KEY_NAMES[KEY_P] = "P";
KEY_NAMES[KEY_A] = "A";
KEY_NAMES[KEY_S] = "S";
KEY_NAMES[KEY_D] = "D";
KEY_NAMES[KEY_F] = "F";
KEY_NAMES[KEY_G] = "G";
KEY_NAMES[KEY_H] = "H";
KEY_NAMES[KEY_J] = "J";
KEY_NAMES[KEY_K] = "K";
KEY_NAMES[KEY_L] = "L";
KEY_NAMES[KEY_Z] = "Z";
KEY_NAMES[KEY_X] = "X";
KEY_NAMES[KEY_C] = "C";
KEY_NAMES[KEY_V] = "V";
KEY_NAMES[KEY_B] = "B";
KEY_NAMES[KEY_N] = "N";
KEY_NAMES[KEY_M] = "M";
KEY_NAMES[KEY_F1] = "F1";
KEY_NAMES[KEY_F2] = "F2";
KEY_NAMES[KEY_F3] = "F3";
KEY_NAMES[KEY_F4] = "F4";
KEY_NAMES[KEY_F5] = "F5";
KEY_NAMES[KEY_F6] = "F6";
KEY_NAMES[KEY_F7] = "F7";
KEY_NAMES[KEY_F8] = "F8";
KEY_NAMES[KEY_F9] = "F9";
KEY_NAMES[KEY_F10] = "F10";
KEY_NAMES[KEY_F11] = "F11";
KEY_NAMES[KEY_F12] = "F12";
KEY_NAMES[KEY_F13] = "F13";
KEY_NAMES[KEY_F14] = "F14";
KEY_NAMES[KEY_F15] = "F15";
KEY_NAMES[KEY_NUMPAD0] = "Numpad 0";
KEY_NAMES[KEY_NUMPAD1] = "Numpad 1";
KEY_NAMES[KEY_NUMPAD2] = "Numpad 2";
KEY_NAMES[KEY_NUMPAD3] = "Numpad 3";
KEY_NAMES[KEY_NUMPAD4] = "Numpad 4";
KEY_NAMES[KEY_NUMPAD5] = "Numpad 5";
KEY_NAMES[KEY_NUMPAD6] = "Numpad 6";
KEY_NAMES[KEY_NUMPAD7] = "Numpad 7";
KEY_NAMES[KEY_NUMPAD8] = "Numpad 8";
KEY_NAMES[KEY_NUMPAD9] = "Numpad 9";
KEY_NAMES[KEY_NUMPADEQUALS] = "Numpad =";
KEY_NAMES[KEY_NUMPADENTER] = "Numpad Enter";
KEY_NAMES[KEY_NUMPADCOMMA] = "Numpad .";
KEY_NAMES[KEY_DIVIDE] = "Numpad /";
KEY_NAMES[KEY_LMENU] = "Left Alt";
KEY_NAMES[KEY_RMENU] = "Right Alt";
KEY_NAMES[KEY_LCONTROL] = "Left Ctrl";
KEY_NAMES[KEY_RCONTROL] = "Right Ctrl";
KEY_NAMES[KEY_LSHIFT] = "Left Shift";
KEY_NAMES[KEY_RSHIFT] = "Right Shift";
KEY_NAMES[KEY_LMETA] = "Left Option";
KEY_NAMES[KEY_RMETA] = "Right Option";
KEY_NAMES[KEY_MINUS] = "-";
KEY_NAMES[KEY_EQUALS] = "=";
KEY_NAMES[KEY_LBRACKET] = "[";
KEY_NAMES[KEY_RBRACKET] = "]";
KEY_NAMES[KEY_SEMICOLON] = ";";
KEY_NAMES[KEY_APOSTROPHE] = "'";
KEY_NAMES[KEY_GRAVE] = "`";
KEY_NAMES[KEY_BACKSLASH] = "\\";
KEY_NAMES[KEY_COMMA] = ",";
KEY_NAMES[KEY_PERIOD] = ".";
KEY_NAMES[KEY_SLASH] = "/";
KEY_NAMES[KEY_MULTIPLY] = "*";
KEY_NAMES[KEY_ADD] = "+";
KEY_NAMES[KEY_COLON] = ":";
KEY_NAMES[KEY_UNDERLINE] = "_";
KEY_NAMES[KEY_AT] = "@";
KEY_NAMES[KEY_APPS] = "Apps";
KEY_NAMES[KEY_POWER] = "Power";
KEY_NAMES[KEY_SLEEP] = "Sleep";
KEY_NAMES[KEY_STOP] = "Stop";
KEY_NAMES[KEY_ESCAPE] = "Esc";
KEY_NAMES[KEY_RETURN] = "Enter";
KEY_NAMES[KEY_SPACE] = "Space";
KEY_NAMES[KEY_BACK] = "Backspace";
KEY_NAMES[KEY_TAB] = "Tab";
KEY_NAMES[KEY_SYSRQ] = "SysEq";
KEY_NAMES[KEY_PAUSE] = "Pause";
KEY_NAMES[KEY_HOME] = "Home";
KEY_NAMES[KEY_PGUP] = "Page Up";
KEY_NAMES[KEY_PGDN] = "Page Down";
KEY_NAMES[KEY_END] = "End";
KEY_NAMES[KEY_INSERT] = "Insert";
KEY_NAMES[KEY_DELETE] = "Delete";
KEY_NAMES[KEY_UP] = "Up";
KEY_NAMES[KEY_LEFT] = "Left";
KEY_NAMES[KEY_RIGHT] = "Right";
KEY_NAMES[KEY_DOWN] = "Down";
KEY_NAMES[KEY_NUMLOCK] = "Num Lock";
KEY_NAMES[KEY_CAPITAL] = "Caps Lock";
KEY_NAMES[KEY_SCROLL] = "Scroll Lock";
KEY_NAMES[KEY_KANA] = "Kana";
KEY_NAMES[KEY_CONVERT] = "Convert";
KEY_NAMES[KEY_NOCONVERT] = "No Convert";
KEY_NAMES[KEY_YEN] = "Yen";
KEY_NAMES[KEY_CIRCUMFLEX] = "Circumflex";
KEY_NAMES[KEY_KANJI] = "Kanji";
KEY_NAMES[KEY_AX] = "Ax";
KEY_NAMES[KEY_UNLABELED] = "Unlabeled";
}
public String getName(int keyId){
return KEY_NAMES[keyId];
}
}

@ -32,7 +32,6 @@
package com.jme3.renderer;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.scene.Mesh;
import com.jme3.scene.VertexBuffer;

@ -400,11 +400,11 @@ public final class AppSettings extends HashMap<String, Object> {
/**
* Set a custom graphics renderer to use. The class should implement
* the {@link Renderer} interface.
* @param clazz The custom graphics renderer class.
* the {@link JmeContext} interface.
* @param clazz The custom context class.
* (Default: not set)
*/
public void setCustomRenderer(Class clazz){
public void setCustomRenderer(Class<? extends JmeContext> clazz){
put("Renderer", "CUSTOM" + clazz.getName());
}

@ -114,6 +114,8 @@ public class SkyFactory {
Format fmt = images[0].getFormat();
int width = images[0].getWidth();
int height = images[0].getHeight();
ByteBuffer data = images[0].getData(0);
int size = data != null ? data.capacity() : 0;
@ -125,12 +127,14 @@ public class SkyFactory {
if (image.getFormat() != fmt) {
throw new IllegalArgumentException("Images must have same format");
}
if (image.getWidth() != width) {
if (image.getWidth() != width || image.getHeight() != height) {
throw new IllegalArgumentException("Images must have same resolution");
}
ByteBuffer data2 = image.getData(0);
if (data2.capacity() != size) {
throw new IllegalArgumentException("Images must have same size");
if (data2 != null){
if (data2.capacity() != size) {
throw new IllegalArgumentException("Images must have same size");
}
}
}
}

Loading…
Cancel
Save