private void printIntOrEnum(String method, int value, int argIndex) { IntMap<Void> argSlotMap = nonEnumArgMap.get(method); if (argSlotMap != null && argSlotMap.containsKey(argIndex)) { printInt(value); } else { printEnum(value); } }
private void invokeAnalogsAndActions(int hash, float value, float effectiveDeadZone, boolean applyTpf) { if (value < effectiveDeadZone) { invokeAnalogs(hash, value, !applyTpf); return; } ArrayList<Mapping> maps = bindings.get(hash); if (maps == null) { return; } boolean valueChanged = !axisValues.containsKey(hash); if (applyTpf) { value *= frameTPF; } int size = maps.size(); for (int i = size - 1; i >= 0; i--) { Mapping mapping = maps.get(i); ArrayList<InputListener> listeners = mapping.listeners; int listenerSize = listeners.size(); for (int j = listenerSize - 1; j >= 0; j--) { InputListener listener = listeners.get(j); if (listener instanceof ActionListener && valueChanged) { ((ActionListener) listener).onAction(mapping.name, true, frameTPF); } if (listener instanceof AnalogListener) { ((AnalogListener) listener).onAnalog(mapping.name, value, frameTPF); } } } }
private void invokeTimedActions(int hash, long time, boolean pressed) { if (!bindings.containsKey(hash)) { return; } if (pressed) { pressedButtons.put(hash, time); } else { Long pressTimeObj = pressedButtons.remove(hash); if (pressTimeObj == null) { return; // under certain circumstances it can be null, ignore } // the event then. long pressTime = pressTimeObj; long lastUpdate = lastLastUpdateTime; long releaseTime = time; long timeDelta = releaseTime - Math.max(pressTime, lastUpdate); if (timeDelta > 0) { invokeAnalogs(hash, computeAnalogValue(timeDelta), false); } } }
/** * Called by the Renderer when a texture has been set. * * @param image The image that was set * @param wasSwitched If true, the texture has required a state switch */ public void onTextureUse(Image image, boolean wasSwitched){ assert image.getId() >= 1; if( !enabled ) return; if (!texturesUsed.containsKey(image.getId())) texturesUsed.put(image.getId(), null); if (wasSwitched) numTextureBinds ++; }
/** * Called by the Renderer when a framebuffer has been set. * * @param fb The framebuffer that was set * @param wasSwitched If true, the framebuffer required a state switch */ public void onFrameBufferUse(FrameBuffer fb, boolean wasSwitched){ if( !enabled ) return; if (fb != null){ assert fb.getId() >= 1; if (!fbosUsed.containsKey(fb.getId())) fbosUsed.put(fb.getId(), null); } if (wasSwitched) numFboSwitches ++; }
/** * Sets the {@link VertexBuffer} on the mesh. * This will update the vertex/triangle counts if needed. * * @param vb The buffer to set * @throws IllegalArgumentException If the buffer type is already set */ public void setBuffer(VertexBuffer vb){ if (buffers.containsKey(vb.getBufferType().ordinal())) { throw new IllegalArgumentException("Buffer type already set: " + vb.getBufferType()); } buffers.put(vb.getBufferType().ordinal(), vb); buffersList.add(vb); updateCounts(); }
/** * Called by the Renderer when a shader has been utilized. * * @param shader The shader that was used * @param wasSwitched If true, the shader has required a state switch */ public void onShaderUse(Shader shader, boolean wasSwitched){ assert shader.getId() >= 1; if( !enabled ) return; // Reduces unnecessary hashmap lookups if // we already considered this shader. if (lastShader != shader.getId()) { lastShader = shader.getId(); if (!shadersUsed.containsKey(shader.getId())) { shadersUsed.put(shader.getId(), null); } } if (wasSwitched) numShaderSwitches++; }
if (jmeMeshes.containsKey(-1) && jmeMeshes.size() > 1) { logger.log(Level.WARNING, "Mesh has polygons with no material " + "indices (unusual) - they will use material index 0.");
int oldIndex = indexBuf.get(i); if (!oldIndicesToNewIndices.containsKey(oldIndex)) {
private void printIntOrEnum(String method, int value, int argIndex) { IntMap<Void> argSlotMap = nonEnumArgMap.get(method); if (argSlotMap != null && argSlotMap.containsKey(argIndex)) { printInt(value); } else { printEnum(value); } }
private void invokeAnalogsAndActions(int hash, float value, float effectiveDeadZone, boolean applyTpf) { if (value < effectiveDeadZone) { invokeAnalogs(hash, value, !applyTpf); return; } ArrayList<Mapping> maps = bindings.get(hash); if (maps == null) { return; } boolean valueChanged = !axisValues.containsKey(hash); if (applyTpf) { value *= frameTPF; } int size = maps.size(); for (int i = size - 1; i >= 0; i--) { Mapping mapping = maps.get(i); ArrayList<InputListener> listeners = mapping.listeners; int listenerSize = listeners.size(); for (int j = listenerSize - 1; j >= 0; j--) { InputListener listener = listeners.get(j); if (listener instanceof ActionListener && valueChanged) { ((ActionListener) listener).onAction(mapping.name, true, frameTPF); } if (listener instanceof AnalogListener) { ((AnalogListener) listener).onAnalog(mapping.name, value, frameTPF); } } } }
private void invokeAnalogsAndActions(int hash, float value, boolean applyTpf) { if (value < axisDeadZone) { invokeAnalogs(hash, value, !applyTpf); return; } ArrayList<Mapping> maps = bindings.get(hash); if (maps == null) { return; } boolean valueChanged = !axisValues.containsKey(hash); if (applyTpf) { value *= frameTPF; } int size = maps.size(); for (int i = size - 1; i >= 0; i--) { Mapping mapping = maps.get(i); ArrayList<InputListener> listeners = mapping.listeners; int listenerSize = listeners.size(); for (int j = listenerSize - 1; j >= 0; j--) { InputListener listener = listeners.get(j); if (listener instanceof ActionListener && valueChanged) { ((ActionListener) listener).onAction(mapping.name, true, frameTPF); } if (listener instanceof AnalogListener) { ((AnalogListener) listener).onAnalog(mapping.name, value, frameTPF); } } } }
private void invokeTimedActions(int hash, long time, boolean pressed) { if (!bindings.containsKey(hash)) { return; } if (pressed) { pressedButtons.put(hash, time); } else { Long pressTimeObj = pressedButtons.remove(hash); if (pressTimeObj == null) { return; // under certain circumstances it can be null, ignore } // the event then. long pressTime = pressTimeObj; long lastUpdate = lastLastUpdateTime; long releaseTime = time; long timeDelta = releaseTime - Math.max(pressTime, lastUpdate); if (timeDelta > 0) { invokeAnalogs(hash, computeAnalogValue(timeDelta), false); } } }
private void invokeTimedActions(int hash, long time, boolean pressed) { if (!bindings.containsKey(hash)) { return; } if (pressed) { pressedButtons.put(hash, time); } else { Long pressTimeObj = pressedButtons.remove(hash); if (pressTimeObj == null) { return; // under certain circumstances it can be null, ignore } // the event then. long pressTime = pressTimeObj; long lastUpdate = lastLastUpdateTime; long releaseTime = time; long timeDelta = releaseTime - Math.max(pressTime, lastUpdate); if (timeDelta > 0) { invokeAnalogs(hash, computeAnalogValue(timeDelta), false); } } }
/** * Called by the Renderer when a texture has been set. * * @param image The image that was set * @param wasSwitched If true, the texture has required a state switch */ public void onTextureUse(Image image, boolean wasSwitched){ assert image.getId() >= 1; if( !enabled ) return; if (!texturesUsed.containsKey(image.getId())) texturesUsed.put(image.getId(), null); if (wasSwitched) numTextureBinds ++; }
/** * Called by the Renderer when a framebuffer has been set. * * @param fb The framebuffer that was set * @param wasSwitched If true, the framebuffer required a state switch */ public void onFrameBufferUse(FrameBuffer fb, boolean wasSwitched){ if( !enabled ) return; if (fb != null){ assert fb.getId() >= 1; if (!fbosUsed.containsKey(fb.getId())) fbosUsed.put(fb.getId(), null); } if (wasSwitched) numFboSwitches ++; }
/** * Sets the {@link VertexBuffer} on the mesh. * This will update the vertex/triangle counts if needed. * * @param vb The buffer to set * @throws IllegalArgumentException If the buffer type is already set */ public void setBuffer(VertexBuffer vb){ if (buffers.containsKey(vb.getBufferType().ordinal())) throw new IllegalArgumentException("Buffer type already set: "+vb.getBufferType()); buffers.put(vb.getBufferType().ordinal(), vb); buffersList.add(vb); updateCounts(); }
/** * Called by the Renderer when a shader has been utilized. * * @param shader The shader that was used * @param wasSwitched If true, the shader has required a state switch */ public void onShaderUse(Shader shader, boolean wasSwitched){ assert shader.getId() >= 1; if( !enabled ) return; // Reduces unnecessary hashmap lookups if // we already considered this shader. if (lastShader != shader.getId()) { lastShader = shader.getId(); if (!shadersUsed.containsKey(shader.getId())) { shadersUsed.put(shader.getId(), null); } } if (wasSwitched) numShaderSwitches++; }
if (jmeMeshes.containsKey(-1) && jmeMeshes.size() > 1) { logger.log(Level.WARNING, "Mesh has polygons with no material " + "indices (unusual) - they will use material index 0.");
int oldIndex = indexBuf.get(i); if (!oldIndicesToNewIndices.containsKey(oldIndex)) {