Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Nov 23, 2015
2 parents 7156d7b + a617319 commit c393016
Show file tree
Hide file tree
Showing 17 changed files with 1,244 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,22 @@ static public void load () {
try {
if (isWindows) {
nativesDir = loader.extractFile(is64Bit ? "lwjgl64.dll" : "lwjgl.dll", null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio)
loader.extractFileTo(is64Bit ? "OpenAL64.dll" : "OpenAL32.dll", nativesDir);
if (!LwjglApplicationConfiguration.disableAudio) {
String windowsOpenALFile = is64Bit ? "OpenAL64.dll" : "OpenAL32.dll";
loader.extractFileTo(windowsOpenALFile, new File(nativesDir, windowsOpenALFile));
}
} else if (isMac) {
nativesDir = loader.extractFile("liblwjgl.dylib", null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio) loader.extractFileTo("openal.dylib", nativesDir);
if (!LwjglApplicationConfiguration.disableAudio) {
String macOpenALFile = "openal.dylib";
loader.extractFileTo(macOpenALFile, new File(nativesDir, macOpenALFile));
}
} else if (isLinux) {
nativesDir = loader.extractFile(is64Bit ? "liblwjgl64.so" : "liblwjgl.so", null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio)
loader.extractFileTo(is64Bit ? "libopenal64.so" : "libopenal.so", nativesDir);
if (!LwjglApplicationConfiguration.disableAudio) {
String linuxOpenALFile = is64Bit ? "libopenal64.so" : "libopenal.so";
loader.extractFileTo(linuxOpenALFile, new File(nativesDir, linuxOpenALFile));
}
}
} catch (Throwable ex) {
throw new GdxRuntimeException("Unable to extract LWJGL natives.", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,28 @@
<html>null</html>
</projects>
</extension>
<extension>
<name>gdx-dialogs</name>
<description>Provides cross-platform support for native dialogs</description>
<package>de.tomgrill.gdxdialogs</package>
<version>1.0.0</version>
<compatibility>1.7.0</compatibility>
<website>https://github.com/TomGrill/gdx-dialogs</website>
<gwtInherits></gwtInherits>
<projects>
<core>
<dependency>de.tomgrill.gdxdialogs:gdx-dialogs-core</dependency>
</core>
<desktop>
<dependency>de.tomgrill.gdxdialogs:gdx-dialogs-desktop</dependency>
</desktop>
<android>
<dependency>de.tomgrill.gdxdialogs:gdx-dialogs-android</dependency>
</android>
<ios>
<dependency>de.tomgrill.gdxdialogs:gdx-dialogs-ios</dependency>
</ios>
<html>null</html>
</projects>
</extension>
</extensions>
22 changes: 20 additions & 2 deletions gdx/src/com/badlogic/gdx/graphics/g3d/utils/MeshBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public void begin (final VertexAttributes attributes, int primitiveType) {
this.indices.clear();
this.parts.clear();
this.vindex = 0;
this.lastIndex = -1;
this.istart = 0;
this.part = null;
this.stride = attributes.vertexSize / 4;
Expand Down Expand Up @@ -268,6 +269,7 @@ public void clear () {
this.indices.clear();
this.parts.clear();
this.vindex = 0;
this.lastIndex = -1;
this.istart = 0;
this.part = null;
}
Expand Down Expand Up @@ -1316,15 +1318,17 @@ public void addMesh (Mesh mesh, int indexOffset, int numIndices) {

private static IntIntMap indicesMap = null;

private void addMesh (float[] vertices, short[] indices, int indexOffset, int numIndices) {
@Override
public void addMesh (float[] vertices, short[] indices, int indexOffset, int numIndices) {
if (indicesMap == null)
indicesMap = new IntIntMap(numIndices);
else {
indicesMap.clear();
indicesMap.ensureCapacity(numIndices);
}
ensureIndices(numIndices);
ensureVertices(vertices.length < numIndices ? vertices.length : numIndices); // a bit naive perhaps?
final int numVertices = vertices.length / stride;
ensureVertices(numVertices < numIndices ? numVertices : numIndices);
for (int i = 0; i < numIndices; i++) {
final int sidx = indices[i];
int didx = indicesMap.get(sidx, -1);
Expand All @@ -1335,4 +1339,18 @@ private void addMesh (float[] vertices, short[] indices, int indexOffset, int nu
index((short)didx);
}
}

@Override
public void addMesh (float[] vertices, short[] indices) {
final short offset = (short)(lastIndex + 1);

final int numVertices = vertices.length / stride;
ensureVertices(numVertices);
for (int v = 0; v < vertices.length; v += stride)
addVertex(vertices, v);

ensureIndices(indices.length);
for (int i = 0; i < indices.length; ++i)
index((short)(indices[i] + offset));
}
}
14 changes: 14 additions & 0 deletions gdx/src/com/badlogic/gdx/graphics/g3d/utils/MeshPartBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,20 @@ public void arrow (float x1, float y1, float z1, float x2, float y2, float z2, f
* @param numIndices The number of indices of the part of the mesh to copy. */
public void addMesh (Mesh mesh, int indexOffset, int numIndices);

/** Copies a mesh to the mesh (part) currently being build. The entire vertices array is added, even if some of the
* vertices are not indexed by the indices array. If you want to add only the vertices that are actually indexed, then
* use the {@link #addMesh(float[], short[], int, int)} method instead.
* @param vertices The vertices to copy, must be in the same vertex layout as the mesh being build.
* @param indices Array containing the indices to copy, each index should be valid in the vertices array. */
public void addMesh (float[] vertices, short[] indices);

/** Copies a (part of a) mesh to the mesh (part) currently being build.
* @param vertices The vertices to (partly) copy, must be in the same vertex layout as the mesh being build.
* @param indices Array containing the indices to (partly) copy, each index should be valid in the vertices array.
* @param indexOffset The zero-based offset of the first index of the part of indices array to copy.
* @param numIndices The number of indices of the part of the indices array to copy. */
public void addMesh (float[] vertices, short[] indices, int indexOffset, int numIndices);

/** Class that contains all vertex information the builder can use.
* @author Xoppa */
public static class VertexInfo implements Poolable {
Expand Down
3 changes: 2 additions & 1 deletion gdx/src/com/badlogic/gdx/graphics/glutils/GLFrameBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ private void build () {
int result = gl.glCheckFramebufferStatus(GL20.GL_FRAMEBUFFER);

if (result == GL20.GL_FRAMEBUFFER_UNSUPPORTED && hasDepth && hasStencil
&& Gdx.graphics.supportsExtension("GL_OES_packed_depth_stencil")) {
&& (Gdx.graphics.supportsExtension("GL_OES_packed_depth_stencil") ||
Gdx.graphics.supportsExtension("GL_EXT_packed_depth_stencil"))) {
if (hasDepth) {
gl.glDeleteRenderbuffer(depthbufferHandle);
depthbufferHandle = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ public void update () {
}

for (ObjectMap.Entry<DirectionalLight, LightProperties> e : dirCameras) {
e.value.camera.direction.set(e.key.direction);
directionalAnalyzer.analyze(e.key, e.value.camera, camera).update();
e.value.camera.update();
}

for (ObjectMap.Entry<PointLight, PointLightProperties> e : pointCameras) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
import com.badlogic.gdx.tests.g3d.shadows.utils.DirectionalAnalyzer;
import com.badlogic.gdx.tests.g3d.shadows.utils.LightFilter;
import com.badlogic.gdx.tests.g3d.shadows.utils.NearFarAnalyzer;
import com.badlogic.gdx.tests.g3d.shadows.utils.ShadowMapAllocator;

/** FirstPassBaseShadowSystem assumes that the first pass renders all depth map in one texture.
* @author realitix */
public abstract class FirstPassBaseShadowSystem extends BaseShadowSystem {

public FirstPassBaseShadowSystem () {
super();
}

public FirstPassBaseShadowSystem (NearFarAnalyzer nearFarAnalyzer, ShadowMapAllocator allocator,
DirectionalAnalyzer directionalAnalyzer, LightFilter lightFilter) {
super(nearFarAnalyzer, allocator, directionalAnalyzer, lightFilter);
}

protected static int FIRST_PASS = 0;

@Override
Expand Down
Loading

0 comments on commit c393016

Please sign in to comment.