/** Returns the location of the tile in {@link TileSetLayout#image} */ public Vector2 getLocation (int tile) { return imageTilePositions.get(tile - firstgid); } }
/** Returns the location of the tile in {@link TileSetLayout#image} */ public Vector2 getLocation (int tile) { return imageTilePositions.get(tile - firstgid); } }
/** Gets the {@link TiledMapTile} that has the given id. * * @param id the id of the {@link TiledMapTile} to retrieve. * @return tile matching id, null if it doesn't exist */ public TiledMapTile getTile (int id) { return tiles.get(id); }
/** Gets the {@link TiledMapTile} that has the given id. * * @param id the id of the {@link TiledMapTile} to retrieve. * @return tile matching id, null if it doesn't exist */ public TiledMapTile getTile (int id) { return tiles.get(id); }
public static Gamepad getGamepad(int index) { return gamepads.get(index); }
public long getSoundId (int sourceId) { if (!sourceToSoundId.containsKey(sourceId)) return -1; return sourceToSoundId.get(sourceId); }
@Override public void beforeGroup (int group, Array<Decal> contents) { plugs.get(group).beforeGroup(contents); }
public long getSoundId (int sourceId) { if (!sourceToSoundId.containsKey(sourceId)) return -1; return sourceToSoundId.get(sourceId); }
@Override public void afterGroup (int group) { plugs.get(group).afterGroup(); }
@Override public void beforeGroup (int group, Array<Decal> contents) { plugs.get(group).beforeGroup(contents); }
@Override public void afterGroup (int group) { plugs.get(group).afterGroup(); }
public long getSoundId (int sourceId) { if (!sourceToSoundId.containsKey(sourceId)) return -1; return sourceToSoundId.get(sourceId); }
public long getSoundId (int sourceId) { if (!sourceToSoundId.containsKey(sourceId)) return -1; return sourceToSoundId.get(sourceId); }
public boolean equals (Object obj) { if (obj == this) return true; if (!(obj instanceof IntMap)) return false; IntMap<V> other = (IntMap)obj; if (other.size != size) return false; if (other.hasZeroValue != hasZeroValue) return false; if (hasZeroValue) { if (other.zeroValue == null) { if (zeroValue != null) return false; } else { if (!other.zeroValue.equals(zeroValue)) return false; } } int[] keyTable = this.keyTable; V[] valueTable = this.valueTable; for (int i = 0, n = capacity + stashSize; i < n; i++) { int key = keyTable[i]; if (key != EMPTY) { V value = valueTable[i]; if (value == null) { if (!other.containsKey(key) || other.get(key) != null) return false; } else { if (!value.equals(other.get(key))) return false; } } } return true; }
public boolean equals (Object obj) { if (obj == this) return true; if (!(obj instanceof IntMap)) return false; IntMap<V> other = (IntMap)obj; if (other.size != size) return false; if (other.hasZeroValue != hasZeroValue) return false; if (hasZeroValue) { if (other.zeroValue == null) { if (zeroValue != null) return false; } else { if (!other.zeroValue.equals(zeroValue)) return false; } } int[] keyTable = this.keyTable; V[] valueTable = this.valueTable; for (int i = 0, n = capacity + stashSize; i < n; i++) { int key = keyTable[i]; if (key != EMPTY) { V value = valueTable[i]; if (value == null) { if (!other.containsKey(key) || other.get(key) != null) return false; } else { if (!value.equals(other.get(key))) return false; } } } return true; }
private void gatherControllers(boolean sendEvent) { // gather all joysticks and gamepads, remove any disconnected ones IntMap<AndroidController> removedControllers = new IntMap<AndroidController>(); removedControllers.putAll(controllerMap); for(int deviceId: InputDevice.getDeviceIds()) { InputDevice device = InputDevice.getDevice(deviceId); AndroidController controller = controllerMap.get(deviceId); if(controller != null) { removedControllers.remove(deviceId); } else { addController(deviceId, sendEvent); } } for(Entry<AndroidController> entry: removedControllers.entries()) { removeController(entry.key); } }
int obtainSource (boolean isMusic) { if (noDevice) return 0; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceId = idleSources.get(i); int state = alGetSourcei(sourceId, AL_SOURCE_STATE); if (state != AL_PLAYING && state != AL_PAUSED) { if (isMusic) { idleSources.removeIndex(i); } else { if (sourceToSoundId.containsKey(sourceId)) { long soundId = sourceToSoundId.get(sourceId); sourceToSoundId.remove(sourceId); soundIdToSource.remove(soundId); } long soundId = nextSoundId++; sourceToSoundId.put(sourceId, soundId); soundIdToSource.put(soundId, sourceId); } alSourceStop(sourceId); alSourcei(sourceId, AL_BUFFER, 0); AL10.alSourcef(sourceId, AL10.AL_GAIN, 1); AL10.alSourcef(sourceId, AL10.AL_PITCH, 1); AL10.alSource3f(sourceId, AL10.AL_POSITION, 0, 0, 1f); return sourceId; } } return -1; }
int obtainSource (boolean isMusic) { if (noDevice) return 0; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceId = idleSources.get(i); int state = alGetSourcei(sourceId, AL_SOURCE_STATE); if (state != AL_PLAYING && state != AL_PAUSED) { if (isMusic) { idleSources.removeIndex(i); } else { if (sourceToSoundId.containsKey(sourceId)) { long soundId = sourceToSoundId.get(sourceId); sourceToSoundId.remove(sourceId); soundIdToSource.remove(soundId); } long soundId = nextSoundId++; sourceToSoundId.put(sourceId, soundId); soundIdToSource.put(soundId, sourceId); } alSourceStop(sourceId); alSourcei(sourceId, AL_BUFFER, 0); AL10.alSourcef(sourceId, AL10.AL_GAIN, 1); AL10.alSourcef(sourceId, AL10.AL_PITCH, 1); AL10.alSource3f(sourceId, AL10.AL_POSITION, 0, 0, 1f); return sourceId; } } return -1; }
int obtainSource (boolean isMusic) { if (noDevice) return 0; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceId = idleSources.get(i); int state = alGetSourcei(sourceId, AL_SOURCE_STATE); if (state != AL_PLAYING && state != AL_PAUSED) { if (isMusic) { idleSources.removeIndex(i); } else { if (sourceToSoundId.containsKey(sourceId)) { long soundId = sourceToSoundId.get(sourceId); sourceToSoundId.remove(sourceId); soundIdToSource.remove(soundId); } long soundId = nextSoundId++; sourceToSoundId.put(sourceId, soundId); soundIdToSource.put(soundId, sourceId); } alSourceStop(sourceId); alSourcei(sourceId, AL_BUFFER, 0); AL10.alSourcef(sourceId, AL10.AL_GAIN, 1); AL10.alSourcef(sourceId, AL10.AL_PITCH, 1); AL10.alSource3f(sourceId, AL10.AL_POSITION, 0, 0, 1f); return sourceId; } } return -1; }
int obtainSource (boolean isMusic) { if (noDevice) return 0; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceId = idleSources.get(i); int state = alGetSourcei(sourceId, AL_SOURCE_STATE); if (state != AL_PLAYING && state != AL_PAUSED) { if (isMusic) { idleSources.removeIndex(i); } else { if (sourceToSoundId.containsKey(sourceId)) { long soundId = sourceToSoundId.get(sourceId); sourceToSoundId.remove(sourceId); soundIdToSource.remove(soundId); } long soundId = nextSoundId++; sourceToSoundId.put(sourceId, soundId); soundIdToSource.put(soundId, sourceId); } alSourceStop(sourceId); alSourcei(sourceId, AL_BUFFER, 0); AL10.alSourcef(sourceId, AL10.AL_GAIN, 1); AL10.alSourcef(sourceId, AL10.AL_PITCH, 1); AL10.alSource3f(sourceId, AL10.AL_POSITION, 0, 0, 1f); return sourceId; } } return -1; }