Skip to content

Commit

Permalink
converted some lambda forEach in plain for, because of an issue with …
Browse files Browse the repository at this point in the history
…lombok :/
  • Loading branch information
riccardobl committed May 14, 2016
1 parent 2d86b55 commit 88242e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion jme3_xbuf_loader2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories{

dependencies {
compile 'com.github.riccardobl:jme3_physicsloader:-SNAPSHOT'
compileOnly "org.projectlombok:lombok:${v_lombok}"
provided "org.projectlombok:lombok:${v_lombok}"
compile "org.slf4j:slf4j-api:${v_slf4j}"
compile "com.google.guava:guava:19.0"
compile "org.xbuf:xbuf:${v_xbuf}"
Expand All @@ -31,3 +31,5 @@ dependencies {
testCompile 'junit:junit:4.12'
testRuntime 'ch.qos.logback:logback-classic:1.1.2'
}


14 changes: 10 additions & 4 deletions jme3_xbuf_loader2/src/main/java/jme3_ext_xbuf/scene/XbufMesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
import lombok.Data;
import lombok.experimental.ExtensionMethod;
import lombok.extern.slf4j.Slf4j;
import xbuf.Meshes.IndexArray;
import xbuf.Meshes.Skin;
import xbuf.Meshes.VertexArray;

@ExtensionMethod({jme3_ext_xbuf.ext.PrimitiveExt.class,jme3_ext_xbuf.ext.FloatBufferExt.class,jme3_ext_xbuf.ext.UintBufferExt.class})
@Data @Slf4j
@ExtensionMethod({jme3_ext_xbuf.ext.PrimitiveExt.class, jme3_ext_xbuf.ext.FloatBufferExt.class, jme3_ext_xbuf.ext.UintBufferExt.class})
public class XbufMesh{
protected final xbuf.Meshes.Mesh src;

Expand All @@ -27,13 +29,17 @@ public Mesh toJME() throws IllegalArgumentException {

// context.put("G~meshName~"+dst.hashCode(),src.getName());
dst.setMode(src.getPrimitive().toJME());
src.getVertexArraysList().forEach(va -> {

for(VertexArray va:src.getVertexArraysList()){
Type type=va.getAttrib().toJME();
dst.setBuffer(type,va.getFloats().getStep(),va.getFloats().array());
log.debug("add {}",dst.getBuffer(type));
});
}

for(IndexArray va:src.getIndexArraysList()){
dst.setBuffer(VertexBuffer.Type.Index,va.getInts().getStep(),va.getInts().array());
}

src.getIndexArraysList().forEach(va -> dst.setBuffer(VertexBuffer.Type.Index,va.getInts().getStep(),va.getInts().array()));
if(src.hasSkin()) applySkin(src.getSkin(),dst);

dst.updateCounts();
Expand Down

0 comments on commit 88242e5

Please sign in to comment.